Skip to content
  • Marco Mastropaolo's avatar
    Windows: fix FD_READ condition flag still set on recoverable UDP socket errors. · 43b13d7a
    Marco Mastropaolo authored and Sebastian Dröge's avatar Sebastian Dröge committed
    Contrary to what the WSARecvFrom seem to imply, a UDP socket is perfectly recoverable and usable after a WSAECONNRESET error (and, I assume, WSAENETRESET).
    However GSocket condition has the FD_READ bit set after a UDP socket fails with WSAECONNRESET, even if no data is available on the socket anymore; this causes select calls to report the socket as readable when, in fact, it's not.
    
    The change resets FD_READ flag on a socket upon the above error conditions; there's no 'if' to filter between datagram and stream sockets as the change should be harmless in the case of stream sockets which are, however, very unlikely to be usable after a WSAECONNRESET.
    43b13d7a