Skip to content

Commit

Permalink
lib-http: client: Call switching ioloop for shared peer from shared c…
Browse files Browse the repository at this point in the history
…lient context.

Before, it was called from the client peer.
  • Loading branch information
stephanbosch authored and villesavolainen committed Mar 12, 2018
1 parent 8570767 commit 96215d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/lib-http/http-client-peer.c
Expand Up @@ -1291,6 +1291,4 @@ void http_client_peer_switch_ioloop(struct http_client_peer *peer)
peer->to_req_handling =
io_loop_move_timeout(&peer->to_req_handling);
}

http_client_peer_shared_switch_ioloop(peer->shared);
}
6 changes: 6 additions & 0 deletions src/lib-http/http-client.c
Expand Up @@ -530,6 +530,7 @@ void http_client_context_switch_ioloop(struct http_client_context *cctx)
{
struct connection *_conn = cctx->conn_list->connections;
struct http_client_host_shared *hshared;
struct http_client_peer_shared *pshared;

/* move connections */
/* FIXME: we wouldn't necessarily need to switch all of them
Expand All @@ -542,6 +543,11 @@ void http_client_context_switch_ioloop(struct http_client_context *cctx)
http_client_connection_switch_ioloop(conn);
}

/* move backoff timeouts */
for (pshared = cctx->peers_list; pshared != NULL;
pshared = pshared->next)
http_client_peer_shared_switch_ioloop(pshared);

/* move dns lookups and delayed requests */
for (hshared = cctx->hosts_list; hshared != NULL;
hshared = hshared->next)
Expand Down

0 comments on commit 96215d6

Please sign in to comment.