changeset 16564:185dfd05b57a

lib-http: Added http_client_get_pending_request_count()
author Timo Sirainen <tss@iki.fi>
date Thu, 27 Jun 2013 18:03:38 +0300
parents c2c09416d8a4
children af23c7a899a9
files src/lib-http/http-client.c src/lib-http/http-client.h
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-http/http-client.c	Wed Jun 26 22:23:20 2013 +0300
+++ b/src/lib-http/http-client.c	Thu Jun 27 18:03:38 2013 +0300
@@ -189,6 +189,11 @@
 	io_loop_destroy(&client->ioloop);
 }
 
+unsigned int http_client_get_pending_request_count(struct http_client *client)
+{
+	return client->pending_requests;
+}
+
 int http_client_init_ssl_ctx(struct http_client *client, const char **error_r)
 {
 	struct ssl_iostream_settings ssl_set;
--- a/src/lib-http/http-client.h	Wed Jun 26 22:23:20 2013 +0300
+++ b/src/lib-http/http-client.h	Thu Jun 27 18:03:38 2013 +0300
@@ -121,5 +121,7 @@
 
 /* blocks until all currently submitted requests are handled */
 void http_client_wait(struct http_client *client);
+/* Returns number of pending HTTP requests. */
+unsigned int http_client_get_pending_request_count(struct http_client *client);
 
 #endif