From: David Barksdale Date: Wed, 10 Jan 2018 19:15:12 +0000 (-0600) Subject: Try to keep the fs->core MQ from growing too large X-Git-Tag: v0.11.0pre66~249^2~21 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c9a693fc4221ddcec8c0582174ad87488ea64650;p=oweals%2Fgnunet.git Try to keep the fs->core MQ from growing too large --- diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 817aed257..6e28ca606 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c @@ -1230,7 +1230,9 @@ handle_p2p_get (void *cls, GNUNET_NO); return; } - if (cp->ppd.pending_replies + cp->delay_queue_size > MAX_QUEUE_PER_PEER) + unsigned int queue_size = GNUNET_MQ_get_length (cp->mq); + queue_size += cp->ppd.pending_replies + cp->delay_queue_size; + if (queue_size > MAX_QUEUE_PER_PEER) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer `%s' has too many replies queued already. Dropping query.\n",