Tell core that we want to have this packet delivered
[oweals/gnunet.git] / src / util / connection.c
index a25dc0350eb8f9300c44ae15bfcce32783472258..aa5db91bf41e1a14976a4c1ce21f4584635ce5a5 100644 (file)
@@ -461,7 +461,7 @@ destroy_continuation (void *cls,
   struct GNUNET_CONNECTION_Handle *sock = cls;
   GNUNET_CONNECTION_TransmitReadyNotify notify;
   struct AddressProbe *pos;
-  
+
   sock->destroy_task = GNUNET_SCHEDULER_NO_TASK;
   GNUNET_assert (sock->dns_active == NULL);
   if (0 != (sock->ccs & COCO_TRANSMIT_READY))
@@ -497,7 +497,12 @@ destroy_continuation (void *cls,
                   "Shutting down socket (%p)\n", sock);
 #endif
       if (sock->persist != GNUNET_YES)
-        GNUNET_NETWORK_socket_shutdown (sock->sock, SHUT_RDWR);
+      {
+        if ( (GNUNET_YES != GNUNET_NETWORK_socket_shutdown (sock->sock, SHUT_RDWR)) &&
+            (errno != ENOTCONN) &&
+             (errno != ECONNRESET) )
+          GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "shutdown");
+      }
     }
   if (sock->read_task != GNUNET_SCHEDULER_NO_TASK)
     {
@@ -945,6 +950,7 @@ GNUNET_CONNECTION_create_from_sockaddr (int af_family,
   struct GNUNET_NETWORK_Handle *s;
   struct GNUNET_CONNECTION_Handle *ret;
 
+
   s = GNUNET_NETWORK_socket_create (af_family, SOCK_STREAM, 0);
   if (s == NULL)
     {