]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Add http_client_init_private()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 15 Dec 2017 12:11:37 +0000 (14:11 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 15 Dec 2017 12:12:21 +0000 (14:12 +0200)
This allows creating a HTTP client without a shared context, in case it's
needed for some reason.

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

index f3c2a605f73d809a145593f41d51af17038fb149..aca8546ce4c19931f35dec328cc64edebe1c2589 100644 (file)
@@ -212,6 +212,12 @@ http_client_init(const struct http_client_settings *set)
        return http_client_init_shared(http_client_get_global_context(), set);
 }
 
+struct http_client *
+http_client_init_private(const struct http_client_settings *set)
+{
+       return http_client_init_shared(NULL, set);
+}
+
 void http_client_deinit(struct http_client **_client)
 {
        struct http_client *client = *_client;
index f4a0f4f813e76eefec8295cec9bcb34fda9e8a12..26fd0a90570b664d62769a44230caa531fae420f 100644 (file)
@@ -425,6 +425,9 @@ void http_client_request_start_tunnel(struct http_client_request *req,
 /* Create a client using the global shared client context. */
 struct http_client *
 http_client_init(const struct http_client_settings *set);
+/* Create a client without a shared context. */
+struct http_client *
+http_client_init_private(const struct http_client_settings *set);
 struct http_client *
 http_client_init_shared(struct http_client_context *cctx,
        const struct http_client_settings *set) ATTR_NULL(1);