From: Timo Sirainen Date: Fri, 15 Dec 2017 12:11:37 +0000 (+0200) Subject: lib-http: Add http_client_init_private() X-Git-Tag: 2.3.9~2655 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff8a751fb9227a4fd73b2cdaa16d7a2616b3e7e7;p=thirdparty%2Fdovecot%2Fcore.git lib-http: Add http_client_init_private() This allows creating a HTTP client without a shared context, in case it's needed for some reason. --- diff --git a/src/lib-http/http-client.c b/src/lib-http/http-client.c index f3c2a605f7..aca8546ce4 100644 --- a/src/lib-http/http-client.c +++ b/src/lib-http/http-client.c @@ -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; diff --git a/src/lib-http/http-client.h b/src/lib-http/http-client.h index f4a0f4f813..26fd0a9057 100644 --- a/src/lib-http/http-client.h +++ b/src/lib-http/http-client.h @@ -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);