From 44fabc12da537bbe3c44eb3b150d8acabe505170 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 8 Jun 2012 18:20:38 +0000 Subject: [PATCH] -LRN: fix udp plugin on W32 --- src/transport/plugin_transport_udp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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; -- 2.25.1