]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Added http_client_queue_requests_active().
authorStephan Bosch <stephan@dovecot.fi>
Thu, 15 Sep 2016 20:49:54 +0000 (22:49 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 9 Nov 2016 12:26:54 +0000 (14:26 +0200)
It counts how many active requests a queue has.

src/lib-http/http-client-private.h
src/lib-http/http-client-queue.c

index d8402454db38edc4e97f3df2b2f735600410fa27..0cc9fd4958bf496da4f728558d7f2da168c532b9 100644 (file)
@@ -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);
index c3032689461067c8844477b8bb0834160db377a3..8262dd57b4031718dfc7df659b936295189b9f5e 100644 (file)
@@ -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
  */