diff options
author | unknown <diego.nehab@gmail.com> | 2013-05-28 00:09:30 +0800 |
---|---|---|
committer | unknown <diego.nehab@gmail.com> | 2013-05-28 00:09:30 +0800 |
commit | 734cc23e1f03372314ebad07ffd35117c152afcd (patch) | |
tree | 808531d9c0c84aae57657aff353b08d466a3dcfb /src/io.h | |
parent | 66cd8cfcee1f14b59450147c16a6bc44ef298edc (diff) | |
download | luasocket-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.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 */ |