fixing handling of transmit errors
authorChristian Grothoff <christian@grothoff.org>
Tue, 25 May 2010 16:04:21 +0000 (16:04 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 25 May 2010 16:04:21 +0000 (16:04 +0000)
src/util/connection.c

index 290a361b3ed9562110fb660930da5ee730bc736a..8c7a2c4f829e966466bd3edcc72f46c42c1e66bd 100644 (file)
@@ -1352,6 +1352,14 @@ transmit_error (struct GNUNET_CONNECTION_Handle *sock)
                    GNUNET_NETWORK_socket_close (sock->sock));
       sock->sock = NULL;
     }
+  if (sock->read_task != GNUNET_SCHEDULER_NO_TASK)
+    {
+      GNUNET_SCHEDULER_cancel (sock->sched,
+                              sock->read_task);
+      sock->read_task = GNUNET_SCHEDULER_NO_TASK;
+      signal_timeout (sock);
+      return;
+    }
   if (sock->nth.notify_ready == NULL)
     return;                     /* nobody to tell about it */
   notify = sock->nth.notify_ready;