only request next transmission if not already ready
authorChristian Grothoff <christian@grothoff.org>
Mon, 30 May 2011 16:03:05 +0000 (16:03 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 30 May 2011 16:03:05 +0000 (16:03 +0000)
src/core/core_api.c

index 4ffd07d9ed8f27992c90b405fc56c611ab537459..3dfc193dd71afb0217c34b9a68c7bf724e27a944 100644 (file)
@@ -1662,7 +1662,10 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle,
              "Transmission request added to queue\n");
 #endif
   if ( (pr->pending_head == th)  &&
-       (pr->ntr_task == GNUNET_SCHEDULER_NO_TASK) )
+       (pr->ntr_task == GNUNET_SCHEDULER_NO_TASK) &&
+       (pr->next == NULL) &&
+       (pr->prev == NULL) &&
+       (handle->ready_peer_head != pr) )
     pr->ntr_task = GNUNET_SCHEDULER_add_now (&run_request_next_transmission, pr);
   return th;
 }