]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Call switching ioloop for shared peer from shared client context.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 28 Dec 2017 23:30:27 +0000 (00:30 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 4 Jan 2018 11:06:20 +0000 (12:06 +0100)
Before, it was called from the client peer.

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

index 8436441b196ffdd10d3e35fb6c3eff4c58cd8a6f..3650614fe3966bd92e486cf3cfe1895e6918209d 100644 (file)
@@ -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);
 }
index 17e0d40370c6b42f8ee37fd4b61b5325d69e75fc..5a99c91f526415e3105f9e6fc6fe152bb31fff51 100644 (file)
@@ -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
@@ -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)