- fix
[oweals/gnunet.git] / src / util / connection.c
index d7ae12fb3e09778e3ac0cbbafe2ccfa8b1e7a525..ea35b04e1da009501ca49835bfe001195c48f106 100644 (file)
@@ -864,8 +864,9 @@ GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct
     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));
@@ -1152,14 +1153,22 @@ process_notify (struct GNUNET_CONNECTION_Handle *connection)
   size_t size;
   GNUNET_CONNECTION_TransmitReadyNotify notify;
 
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "process_notify is running\n");
+
   GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == connection->write_task);
   if (NULL == (notify = connection->nth.notify_ready))
+  {
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "Noone to notify\n");
     return GNUNET_NO;
+  }
   used = connection->write_buffer_off - connection->write_buffer_pos;
   avail = connection->write_buffer_size - used;
   size = connection->nth.notify_size;
   if (size > avail)
+  {
+    LOG (GNUNET_ERROR_TYPE_DEBUG, "Not enough buffer\n");
     return GNUNET_NO;
+  }
   connection->nth.notify_ready = NULL;
   if (connection->write_buffer_size - connection->write_buffer_off < size)
   {