Skip to content

Commit

Permalink
lib-http: http-client - Rename event setting to event_parent.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanbosch committed Mar 12, 2019
1 parent 03960c3 commit 3c38f63
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/auth/auth-policy.c
Expand Up @@ -174,7 +174,7 @@ void auth_policy_init(void)
MASTER_SERVICE_SSL_SETTINGS_TYPE_CLIENT,
&ssl_set);
http_client_set.ssl = &ssl_set;
http_client_set.event = auth_event;
http_client_set.event_parent = auth_event;
http_client = http_client_init(&http_client_set);

/* prepare template */
Expand Down
6 changes: 3 additions & 3 deletions src/lib-http/http-client.c
Expand Up @@ -127,8 +127,8 @@ http_client_init_shared(struct http_client_context *cctx,
}

struct event *parent_event;
if (set != NULL && set->event != NULL)
parent_event = set->event;
if (set != NULL && set->event_parent != NULL)
parent_event = set->event_parent;
else if (cctx->event == NULL)
parent_event = NULL;
else {
Expand Down Expand Up @@ -441,7 +441,7 @@ http_client_context_create(const struct http_client_settings *set)
cctx->refcount = 1;
cctx->ioloop = current_ioloop;

cctx->event = event_create(set->event);
cctx->event = event_create(set->event_parent);
event_set_forced_debug(cctx->event, set->debug);
event_set_append_log_prefix(cctx->event, "http-client: ");

Expand Down
7 changes: 4 additions & 3 deletions src/lib-http/http-client.h
Expand Up @@ -125,9 +125,10 @@ struct http_client_settings {
size_t socket_send_buffer_size;
size_t socket_recv_buffer_size;

/* Event to use for the http client. For specific requests this can be
overridden with http_client_request_set_event(). */
struct event *event;
/* Event to use as parent for the http client event. For specific
requests this can be overridden with http_client_request_set_event().
*/
struct event *event_parent;

/* enable logging debug messages */
bool debug;
Expand Down
Expand Up @@ -69,7 +69,7 @@ push_notification_driver_ox_init_global(struct mail_user *user,
http_set.debug = user->mail_debug;
http_set.max_attempts = config->http_max_retries+1;
http_set.request_timeout_msecs = config->http_timeout_msecs;
http_set.event = user->event;
http_set.event_parent = user->event;
i_zero(&ssl_set);
mail_user_init_ssl_client_settings(user, &ssl_set);
http_set.ssl = &ssl_set;
Expand Down

0 comments on commit 3c38f63

Please sign in to comment.