The call to WSAEnumNetworkEvents() was reseting network
events in particular WSAECONNRESET was sometimes being lost
causing the client to not exit. The WSAEnumNetworkEvents()
was called from fd_is_socket() and has been replace with
getsockopt() to determine if the fd is socket or not.
Broken in commit
4d40a275, v4.3.23
fd_is_socket(int fd, SOCKET *sockp)
{
SOCKET sock;
- WSANETWORKEVENTS ev;
+ BOOL val;
+ int size = sizeof(val);
sock = W32_FD_TO_SOCKET(fd);
if (sockp)
*sockp = sock;
- return WSAEnumNetworkEvents(sock, NULL, &ev) == 0;
+ return getsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&val, &size) == 0;
+ //WSAEnumNetworkEvents(sock, NULL, &ev) == 0;
}
void