Mercurial > dovecot > core-2.2
changeset 21046:5b3dc5fef64c
lib-http: client: Added http_client_queue_requests_active().
It counts how many active requests a queue has.
author | Stephan Bosch <stephan@dovecot.fi> |
---|---|
date | Thu, 15 Sep 2016 22:49:54 +0200 |
parents | c926a09729f0 |
children | 3a481a8f2ff2 |
files | src/lib-http/http-client-private.h src/lib-http/http-client-queue.c |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-http/http-client-private.h Fri Sep 16 01:58:27 2016 +0200 +++ b/src/lib-http/http-client-private.h Thu Sep 15 22:49:54 2016 +0200 @@ -489,6 +489,8 @@ unsigned int http_client_queue_requests_pending(struct http_client_queue *queue, unsigned int *num_urgent_r) ATTR_NULL(2); +unsigned int +http_client_queue_requests_active(struct http_client_queue *queue); void http_client_queue_connection_success(struct http_client_queue *queue, const struct http_client_peer_addr *addr);
--- a/src/lib-http/http-client-queue.c Fri Sep 16 01:58:27 2016 +0200 +++ b/src/lib-http/http-client-queue.c Thu Sep 15 22:49:54 2016 +0200 @@ -904,6 +904,12 @@ return array_count(&queue->queued_requests) + urg_count; } +unsigned int +http_client_queue_requests_active(struct http_client_queue *queue) +{ + return array_count(&queue->requests); +} + /* * ioloop */