diff options
Diffstat (limited to 'src/datastore')
-rw-r--r-- | src/datastore/datastore_api.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index b2fc18947..916e6acae 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c | |||
@@ -498,19 +498,17 @@ make_queue_entry (struct GNUNET_DATASTORE_Handle *h, | |||
498 | struct GNUNET_DATASTORE_QueueEntry *pos; | 498 | struct GNUNET_DATASTORE_QueueEntry *pos; |
499 | unsigned int c; | 499 | unsigned int c; |
500 | 500 | ||
501 | if ( (h->queue_size == max_queue_size) && | 501 | if ( (NULL != h->queue_tail) && |
502 | (h->queue_tail->priority >= queue_priority) ) | 502 | (h->queue_tail->priority >= queue_priority) ) |
503 | { | 503 | { |
504 | GNUNET_STATISTICS_update (h->stats, | 504 | c = h->queue_size; |
505 | gettext_noop ("# queue overflows"), | 505 | pos = NULL; |
506 | 1, | 506 | } |
507 | GNUNET_NO); | 507 | else |
508 | GNUNET_MQ_discard (env); | 508 | { |
509 | return NULL; | 509 | c = 0; |
510 | pos = h->queue_head; | ||
510 | } | 511 | } |
511 | |||
512 | c = 0; | ||
513 | pos = h->queue_head; | ||
514 | while ( (NULL != pos) && | 512 | while ( (NULL != pos) && |
515 | (c < max_queue_size) && | 513 | (c < max_queue_size) && |
516 | (pos->priority >= queue_priority) ) | 514 | (pos->priority >= queue_priority) ) |