aboutsummaryrefslogtreecommitdiff
path: root/src/udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/udp.c')
-rw-r--r--src/udp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/udp.c b/src/udp.c
index 6647711..58119cd 100644
--- a/src/udp.c
+++ b/src/udp.c
@@ -100,7 +100,7 @@ static int meth_send(lua_State *L)
100 int err; 100 int err;
101 const char *data = luaL_checklstring(L, 2, &count); 101 const char *data = luaL_checklstring(L, 2, &count);
102 tm_markstart(tm); 102 tm_markstart(tm);
103 err = sock_send(&udp->sock, data, count, &sent, tm_get(tm)); 103 err = sock_send(&udp->sock, data, count, &sent, tm_getsuccess(tm));
104 if (err == IO_DONE) lua_pushnumber(L, sent); 104 if (err == IO_DONE) lua_pushnumber(L, sent);
105 else lua_pushnil(L); 105 else lua_pushnil(L);
106 /* a 'closed' error on an unconnected means the target address was not 106 /* a 'closed' error on an unconnected means the target address was not
@@ -129,7 +129,7 @@ static int meth_sendto(lua_State *L)
129 addr.sin_port = htons(port); 129 addr.sin_port = htons(port);
130 tm_markstart(tm); 130 tm_markstart(tm);
131 err = sock_sendto(&udp->sock, data, count, &sent, 131 err = sock_sendto(&udp->sock, data, count, &sent,
132 (SA *) &addr, sizeof(addr), tm_get(tm)); 132 (SA *) &addr, sizeof(addr), tm_getsuccess(tm));
133 if (err == IO_DONE) lua_pushnumber(L, sent); 133 if (err == IO_DONE) lua_pushnumber(L, sent);
134 else lua_pushnil(L); 134 else lua_pushnil(L);
135 /* a 'closed' error on an unconnected means the target address was not 135 /* a 'closed' error on an unconnected means the target address was not
@@ -150,7 +150,7 @@ static int meth_receive(lua_State *L)
150 p_tm tm = &udp->tm; 150 p_tm tm = &udp->tm;
151 count = MIN(count, sizeof(buffer)); 151 count = MIN(count, sizeof(buffer));
152 tm_markstart(tm); 152 tm_markstart(tm);
153 err = sock_recv(&udp->sock, buffer, count, &got, tm_get(tm)); 153 err = sock_recv(&udp->sock, buffer, count, &got, tm_getsuccess(tm));
154 if (err == IO_DONE) lua_pushlstring(L, buffer, got); 154 if (err == IO_DONE) lua_pushlstring(L, buffer, got);
155 else lua_pushnil(L); 155 else lua_pushnil(L);
156 io_pusherror(L, err); 156 io_pusherror(L, err);
@@ -172,7 +172,7 @@ static int meth_receivefrom(lua_State *L)
172 tm_markstart(tm); 172 tm_markstart(tm);
173 count = MIN(count, sizeof(buffer)); 173 count = MIN(count, sizeof(buffer));
174 err = sock_recvfrom(&udp->sock, buffer, count, &got, 174 err = sock_recvfrom(&udp->sock, buffer, count, &got,
175 (SA *) &addr, &addr_len, tm_get(tm)); 175 (SA *) &addr, &addr_len, tm_getsuccess(tm));
176 if (err == IO_DONE) { 176 if (err == IO_DONE) {
177 lua_pushlstring(L, buffer, got); 177 lua_pushlstring(L, buffer, got);
178 lua_pushstring(L, inet_ntoa(addr.sin_addr)); 178 lua_pushstring(L, inet_ntoa(addr.sin_addr));