gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r9553 - GNUnet/src/util/network


From: gnunet
Subject: [GNUnet-SVN] r9553 - GNUnet/src/util/network
Date: Mon, 16 Nov 2009 06:20:32 -0700

Author: grothoff
Date: 2009-11-16 06:20:32 -0700 (Mon, 16 Nov 2009)
New Revision: 9553

Modified:
   GNUnet/src/util/network/select.c
Log:
trying to fix 1450, or at least provide better diagnostics

Modified: GNUnet/src/util/network/select.c
===================================================================
--- GNUnet/src/util/network/select.c    2009-11-16 12:49:44 UTC (rev 9552)
+++ GNUnet/src/util/network/select.c    2009-11-16 13:20:32 UTC (rev 9553)
@@ -683,7 +683,7 @@
           if ((sh->listen_sock != NULL) &&
               (FD_ISSET (sh->listen_sock->handle, &readSet)))
             {
-              int pending;
+              unsigned int pending;
               int udp_sock;
               int error;
               socklen_t optlen;
@@ -697,9 +697,9 @@
               error = GETSOCKOPT (udp_sock,
                                   SOL_SOCKET, SO_NREAD, &pending, &optlen);
 #elif MINGW
-              error = ioctlsocket (udp_sock, FIONREAD, &pending);
+              error = ioctlsocket (udp_sock, FIONREAD, &pending); 
 #else
-              error = ioctl (udp_sock, FIONREAD, &pending);
+              error = ioctl (udp_sock, FIONREAD, &pending); 
 #endif
               if ((error != 0) || (optlen != sizeof (pending)))
                 {
@@ -717,7 +717,12 @@
 #endif
               GNUNET_GE_ASSERT (sh->ectx, pending >= 0);
               if (pending >= 65536)
-                pending = 65536;
+               {
+                  GNUNET_GE_LOG (sh->ectx, GNUNET_GE_WARNING | GNUNET_GE_BULK, 
+                                 _("OS tells us about very large message (%u 
bytes) pending on UDP socket, truncating at 64k\n"),
+                                 pending);
+                   pending = 65536;
+               }
               if (pending == 0)
                 {
                   /* maybe empty UDP packet was sent (see report on bug-gnunet,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]