]> 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)
committerGitLab <gitlab@git.dovecot.net>
Wed, 2 Nov 2016 11:42:18 +0000 (13:42 +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 0a5c58b0dd8758afbe99fc8865780194ba63086d..4f13542aeea24790a93fe4f7095b916237b12b0b 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
  */