diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-02-11 03:31:53 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-02-11 03:31:53 +0000 |
| commit | 390846b640ee7013d51a766b4b2472bdcfbbdfcc (patch) | |
| tree | 3bedd023a0a84feb714615245b58eab5ffb4309b /src/wsocket.c | |
| parent | 0b2542d1a61fc5425ff65ab3dbf7ba7de174763f (diff) | |
| download | luasocket-390846b640ee7013d51a766b4b2472bdcfbbdfcc.tar.gz luasocket-390846b640ee7013d51a766b4b2472bdcfbbdfcc.tar.bz2 luasocket-390846b640ee7013d51a766b4b2472bdcfbbdfcc.zip | |
Added ltn12 module. Modified mime to be stand alone.
Still crashes on invalid input. Dunno why.
Diffstat (limited to 'src/wsocket.c')
| -rw-r--r-- | src/wsocket.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wsocket.c b/src/wsocket.c index fcd2fff..2993c35 100644 --- a/src/wsocket.c +++ b/src/wsocket.c | |||
| @@ -191,7 +191,7 @@ int sock_send(p_sock ps, const char *data, size_t count, size_t *sent, | |||
| 191 | int timeout) | 191 | int timeout) |
| 192 | { | 192 | { |
| 193 | t_sock sock = *ps; | 193 | t_sock sock = *ps; |
| 194 | ssize_t put; | 194 | int put; |
| 195 | int ret; | 195 | int ret; |
| 196 | /* avoid making system calls on closed sockets */ | 196 | /* avoid making system calls on closed sockets */ |
| 197 | if (sock == SOCK_INVALID) return IO_CLOSED; | 197 | if (sock == SOCK_INVALID) return IO_CLOSED; |
| @@ -227,7 +227,7 @@ int sock_sendto(p_sock ps, const char *data, size_t count, size_t *sent, | |||
| 227 | SA *addr, socklen_t addr_len, int timeout) | 227 | SA *addr, socklen_t addr_len, int timeout) |
| 228 | { | 228 | { |
| 229 | t_sock sock = *ps; | 229 | t_sock sock = *ps; |
| 230 | ssize_t put; | 230 | int put; |
| 231 | int ret; | 231 | int ret; |
| 232 | /* avoid making system calls on closed sockets */ | 232 | /* avoid making system calls on closed sockets */ |
| 233 | if (sock == SOCK_INVALID) return IO_CLOSED; | 233 | if (sock == SOCK_INVALID) return IO_CLOSED; |
| @@ -262,7 +262,7 @@ int sock_sendto(p_sock ps, const char *data, size_t count, size_t *sent, | |||
| 262 | int sock_recv(p_sock ps, char *data, size_t count, size_t *got, int timeout) | 262 | int sock_recv(p_sock ps, char *data, size_t count, size_t *got, int timeout) |
| 263 | { | 263 | { |
| 264 | t_sock sock = *ps; | 264 | t_sock sock = *ps; |
| 265 | ssize_t taken; | 265 | int taken; |
| 266 | if (sock == SOCK_INVALID) return IO_CLOSED; | 266 | if (sock == SOCK_INVALID) return IO_CLOSED; |
| 267 | taken = recv(sock, data, (int) count, 0); | 267 | taken = recv(sock, data, (int) count, 0); |
| 268 | if (taken <= 0) { | 268 | if (taken <= 0) { |
| @@ -288,7 +288,7 @@ int sock_recvfrom(p_sock ps, char *data, size_t count, size_t *got, | |||
| 288 | SA *addr, socklen_t *addr_len, int timeout) | 288 | SA *addr, socklen_t *addr_len, int timeout) |
| 289 | { | 289 | { |
| 290 | t_sock sock = *ps; | 290 | t_sock sock = *ps; |
| 291 | ssize_t taken; | 291 | int taken; |
| 292 | if (sock == SOCK_INVALID) return IO_CLOSED; | 292 | if (sock == SOCK_INVALID) return IO_CLOSED; |
| 293 | taken = recvfrom(sock, data, (int) count, 0, addr, addr_len); | 293 | taken = recvfrom(sock, data, (int) count, 0, addr, addr_len); |
| 294 | if (taken <= 0) { | 294 | if (taken <= 0) { |
