From: Stephan Bosch Date: Thu, 15 Sep 2016 20:49:54 +0000 (+0200) Subject: lib-http: client: Added http_client_queue_requests_active(). X-Git-Tag: 2.2.27~222 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9fee0b80da4f292edb09e81485fe65dc4ee1fec;p=thirdparty%2Fdovecot%2Fcore.git lib-http: client: Added http_client_queue_requests_active(). It counts how many active requests a queue has. --- diff --git a/src/lib-http/http-client-private.h b/src/lib-http/http-client-private.h index d8402454db..0cc9fd4958 100644 --- a/src/lib-http/http-client-private.h +++ b/src/lib-http/http-client-private.h @@ -489,6 +489,8 @@ http_client_queue_claim_request(struct http_client_queue *queue, 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); diff --git a/src/lib-http/http-client-queue.c b/src/lib-http/http-client-queue.c index c303268946..8262dd57b4 100644 --- a/src/lib-http/http-client-queue.c +++ b/src/lib-http/http-client-queue.c @@ -904,6 +904,12 @@ http_client_queue_requests_pending(struct http_client_queue *queue, 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 */