From 734cc23e1f03372314ebad07ffd35117c152afcd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 May 2013 00:09:30 +0800 Subject: 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. --- src/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/io.h') 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 { IO_DONE = 0, /* operation completed successfully */ IO_TIMEOUT = -1, /* operation timed out */ IO_CLOSED = -2, /* the connection has been closed */ - IO_UNKNOWN = -3 + IO_UNKNOWN = -3 }; /* interface to error message function */ -- cgit v1.2.3-55-g6feb