2013-11-25 15:27:56 +00:00

67 lines
2.7 KiB
Plaintext

$OpenBSD: patch-src_tcp_c,v 1.2 2013/11/25 15:27:56 dcoppa Exp $
--- src/tcp.c.orig Fri Nov 15 10:55:01 2013
+++ src/tcp.c Fri Nov 15 10:56:14 2013
@@ -124,22 +124,22 @@ int tcp_open(lua_State *L)
\*-------------------------------------------------------------------------*/
static int meth_send(lua_State *L) {
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
- return buffer_meth_send(L, &tcp->buf);
+ return ls_buffer_meth_send(L, &tcp->buf);
}
static int meth_receive(lua_State *L) {
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
- return buffer_meth_receive(L, &tcp->buf);
+ return ls_buffer_meth_receive(L, &tcp->buf);
}
static int meth_getstats(lua_State *L) {
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
- return buffer_meth_getstats(L, &tcp->buf);
+ return ls_buffer_meth_getstats(L, &tcp->buf);
}
static int meth_setstats(lua_State *L) {
p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1);
- return buffer_meth_setstats(L, &tcp->buf);
+ return ls_buffer_meth_setstats(L, &tcp->buf);
}
/*-------------------------------------------------------------------------*\
@@ -178,7 +178,7 @@ static int meth_setfd(lua_State *L)
static int meth_dirty(lua_State *L)
{
p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1);
- lua_pushboolean(L, !buffer_isempty(&tcp->buf));
+ lua_pushboolean(L, !ls_buffer_isempty(&tcp->buf));
return 1;
}
@@ -203,7 +203,7 @@ static int meth_accept(lua_State *L)
io_init(&clnt->io, (p_send) socket_send, (p_recv) socket_recv,
(p_error) socket_ioerror, &clnt->sock);
timeout_init(&clnt->tm, -1, -1);
- buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
+ ls_buffer_init(&clnt->buf, &clnt->io, &clnt->tm);
clnt->family = server->family;
return 1;
} else {
@@ -375,7 +375,7 @@ static int tcp_create(lua_State *L, int family) {
io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv,
(p_error) socket_ioerror, &tcp->sock);
timeout_init(&tcp->tm, -1, -1);
- buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
+ ls_buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
tcp->family = family;
return 1;
} else {
@@ -454,7 +454,7 @@ static int global_connect(lua_State *L) {
io_init(&tcp->io, (p_send) socket_send, (p_recv) socket_recv,
(p_error) socket_ioerror, &tcp->sock);
timeout_init(&tcp->tm, -1, -1);
- buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
+ ls_buffer_init(&tcp->buf, &tcp->io, &tcp->tm);
tcp->sock = SOCKET_INVALID;
tcp->family = PF_UNSPEC;
/* allow user to pick local address and port */