X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fdatastore%2Fdatastore_api.c;h=916e6acaef930121af9a4bfa04f0be4c72437d35;hb=0945dcf2c250dea65d520ef26f9917e9be3ac4ac;hp=311a612832ec4067b9e578428be060a1828fd52a;hpb=4e96704538f882095eca84fed92a7811b299aca1;p=oweals%2Fgnunet.git diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index 311a61283..916e6acae 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c @@ -498,8 +498,17 @@ make_queue_entry (struct GNUNET_DATASTORE_Handle *h, struct GNUNET_DATASTORE_QueueEntry *pos; unsigned int c; - c = 0; - pos = h->queue_head; + if ( (NULL != h->queue_tail) && + (h->queue_tail->priority >= queue_priority) ) + { + c = h->queue_size; + pos = NULL; + } + else + { + c = 0; + pos = h->queue_head; + } while ( (NULL != pos) && (c < max_queue_size) && (pos->priority >= queue_priority) )