-fix double-sending in stream if finish_cb behaves in a certain way
authorChristian Grothoff <christian@grothoff.org>
Sun, 25 Nov 2012 12:31:00 +0000 (12:31 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 25 Nov 2012 12:31:00 +0000 (12:31 +0000)
src/stream/stream_api.c

index 5f0fbaa77748505fdd534842267f26693acac773..66c24dc869c84714f4c5e4f4a51323ff17095cf8 100644 (file)
@@ -626,6 +626,8 @@ send_message_notify (void *cls, size_t size, void *buf)
                               head);
   GNUNET_free (head->message);
   GNUNET_free (head);
+  if (NULL != socket->transmit_handle)
+    return ret; /* 'finish_cb' might have triggered message already! */
   head = socket->queue_head;
   if (NULL != head)    /* more pending messages to send */
   {