Skip to content

Commit

Permalink
lib-http: Add http_client_init_private()
Browse files Browse the repository at this point in the history
This allows creating a HTTP client without a shared context, in case it's
needed for some reason.
  • Loading branch information
sirainen committed Dec 15, 2017
1 parent e7bc4ce commit ff8a751
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib-http/http-client.c
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/lib-http/http-client.h
Expand Up @@ -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);
Expand Down

0 comments on commit ff8a751

Please sign in to comment.