gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r25946 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r25946 - gnunet/src/util
Date: Wed, 30 Jan 2013 16:54:13 +0100

Author: grothoff
Date: 2013-01-30 16:54:13 +0100 (Wed, 30 Jan 2013)
New Revision: 25946

Modified:
   gnunet/src/util/connection.c
   gnunet/src/util/network.c
Log:
-check for EINPROGRESS for UNIX, hopefully fixing #2741

Modified: gnunet/src/util/connection.c
===================================================================
--- gnunet/src/util/connection.c        2013-01-30 15:06:52 UTC (rev 25945)
+++ gnunet/src/util/connection.c        2013-01-30 15:54:13 UTC (rev 25946)
@@ -864,8 +864,9 @@
     GNUNET_free (connection);
     return NULL;
   }
-  if (GNUNET_OK !=
-      GNUNET_NETWORK_socket_connect (connection->sock, connection->addr, 
connection->addrlen))
+  if ( (GNUNET_OK !=
+       GNUNET_NETWORK_socket_connect (connection->sock, connection->addr, 
connection->addrlen)) &&
+       (EINPROGRESS != errno) )
   {
     /* Just return; we expect everything to work eventually so don't fail HARD 
*/
     GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (connection->sock));

Modified: gnunet/src/util/network.c
===================================================================
--- gnunet/src/util/network.c   2013-01-30 15:06:52 UTC (rev 25945)
+++ gnunet/src/util/network.c   2013-01-30 15:54:13 UTC (rev 25946)
@@ -144,12 +144,13 @@
 
 /**
  * Set if a socket should use blocking or non-blocking IO.
+ *
  * @param fd socket
  * @param doBlock blocking mode
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
-static int
-socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, int doBlock)
+int
+GNUNET_NETWORK_socket_set_blocking (struct GNUNET_NETWORK_Handle *fd, int 
doBlock)
 {
 
 #if MINGW
@@ -307,7 +308,7 @@
     LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
                   "socket_set_inheritable");
 
-  if (GNUNET_SYSERR == socket_set_blocking (h, GNUNET_NO))
+  if (GNUNET_SYSERR == GNUNET_NETWORK_socket_set_blocking (h, GNUNET_NO))
   {
     GNUNET_break (0);
     GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (h));




reply via email to

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