From: Christian Grothoff Date: Fri, 8 Jun 2012 18:20:38 +0000 (+0000) Subject: -LRN: fix udp plugin on W32 X-Git-Tag: initial-import-from-subversion-38251~13221 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=44fabc12da537bbe3c44eb3b150d8acabe505170;p=oweals%2Fgnunet.git -LRN: fix udp plugin on W32 --- diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index c5a4c7b3d..ad87ea68d 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c @@ -1741,8 +1741,15 @@ udp_select_read (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *rsock) memset (&addr, 0, sizeof (addr)); size = GNUNET_NETWORK_socket_recvfrom (rsock, buf, sizeof (buf), (struct sockaddr *) &addr, &fromlen); - - if (size < sizeof (struct GNUNET_MessageHeader)) +#if MINGW + /* On SOCK_DGRAM UDP sockets recvfrom might fail with a + * WSAECONNRESET error to indicate that previous sendto() (???) + * on this socket has failed. + */ + if ( (-1 == size) && (ECONNRESET == errno) ) + return; +#endif + if ( (-1 == size) || (size < sizeof (struct GNUNET_MessageHeader))) { GNUNET_break_op (0); return;