Commit ad0003b4 authored by Philip Withnall's avatar Philip Withnall

socket: Handle ECONNRESET as EWOULDBLOCK on Windows

Some versions of Windows can return ECONNRESET for UDP recvmsg() calls
if they would otherwise block. Hence, handle the two equivalently; this
should not affect behaviour on Linux, which apparently does not return
ECONNRESET for UDP recvmsg() calls at all.

https://phabricator.freedesktop.org/T121
parent e1f748cc
......@@ -204,7 +204,10 @@ socket_recv_messages (NiceSocket *sock,
recv_message->length = MAX (recvd, 0);
if (recvd < 0) {
if (g_error_matches (gerr, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
/* Handle ECONNRESET here as if it were EWOULDBLOCK; see
* https://phabricator.freedesktop.org/T121 */
if (g_error_matches (gerr, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK) ||
g_error_matches (gerr, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED))
recvd = 0;
else
error = TRUE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment