aboutsummaryrefslogtreecommitdiff
path: root/src/io.h
diff options
context:
space:
mode:
authorunknown <diego.nehab@gmail.com>2013-05-28 00:09:30 +0800
committerunknown <diego.nehab@gmail.com>2013-05-28 00:09:30 +0800
commit734cc23e1f03372314ebad07ffd35117c152afcd (patch)
tree808531d9c0c84aae57657aff353b08d466a3dcfb /src/io.h
parent66cd8cfcee1f14b59450147c16a6bc44ef298edc (diff)
downloadluasocket-734cc23e1f03372314ebad07ffd35117c152afcd.tar.gz
luasocket-734cc23e1f03372314ebad07ffd35117c152afcd.tar.bz2
luasocket-734cc23e1f03372314ebad07ffd35117c152afcd.zip
Fixed inet_pton and a new Winsock UDP bug.
inet_pton was copying the entire sockaddr_in struct, rather than just the sin_addr field... I am a bit unsure about the UDP fix, because it may affect TCP as well. On UDP sockets, when a sendto fails, the next receive/receivefrom fails with CONNRESET. I changed sock_recv/sock_recvfrom in wsocket.c to skip the CONNRESET from the recv/recvfrom, hoping that if the socket is TCP, sock_waitfd will get the CONNRESET again. The tests pass, but this should be tested more thoroughly.
Diffstat (limited to 'src/io.h')
-rw-r--r--src/io.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/io.h b/src/io.h
index 8cca08a..76a3e58 100644
--- a/src/io.h
+++ b/src/io.h
@@ -22,7 +22,7 @@ enum {
22 IO_DONE = 0, /* operation completed successfully */ 22 IO_DONE = 0, /* operation completed successfully */
23 IO_TIMEOUT = -1, /* operation timed out */ 23 IO_TIMEOUT = -1, /* operation timed out */
24 IO_CLOSED = -2, /* the connection has been closed */ 24 IO_CLOSED = -2, /* the connection has been closed */
25 IO_UNKNOWN = -3 25 IO_UNKNOWN = -3
26}; 26};
27 27
28/* interface to error message function */ 28/* interface to error message function */