prevent same message from being requested twice by always skipping head-of-queue...
authorChristian Grothoff <christian@grothoff.org>
Thu, 24 Nov 2011 10:23:14 +0000 (10:23 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 24 Nov 2011 10:23:14 +0000 (10:23 +0000)
src/core/core_api.c

index 09a5c54a8f461f4404a3e3658f126fe4ed1002c3..a279874d7a10c3893947f277fcd39b082c3bb457 100644 (file)
@@ -1423,15 +1423,12 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork,
     GNUNET_free (minp);
   }
 
-  /* Order entries by deadline, but SKIP 'HEAD' if
-   * we're in the 'ready_peer_*' DLL */
+  /* Order entries by deadline, but SKIP 'HEAD' (as we may have transmitted
+     that request already or might even already be approved to transmit that
+     message to core) */
   pos = pr->pending_head;
-  if ((pr->prev != NULL) || (pr->next != NULL) ||
-      (pr == handle->ready_peer_head))
-  {
-    GNUNET_assert (pos != NULL);
+  if (pos != NULL)
     pos = pos->next;            /* skip head */
-  }
 
   /* insertion sort */
   prev = pos;