]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Check whether client is running in a wait loop with the correct...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 14 Dec 2017 20:50:58 +0000 (21:50 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 14 Dec 2017 20:50:58 +0000 (21:50 +0100)
This used to check client->ioloop != NULL, but now it should check client->waiting.
Previous commit (e8a1b62fe4a81b211dcccd1a58b44f254074eab6) omitted a few instances where this should have been changed.

src/lib-http/http-client-connection.c
src/lib-http/http-client-host.c
src/lib-http/http-client-request.c
src/lib-http/http-client.c

index 8a7388c252caf9c4aef616781a4f8585960eb21d..52281e40f7addb4b52b25d5e7cc94b994258650e 100644 (file)
@@ -135,7 +135,7 @@ http_client_connection_server_close(struct http_client_connection **_conn)
        }       
        array_clear(&conn->request_wait_list);
 
-       if (client != NULL && client->ioloop != NULL)
+       if (client != NULL && client->waiting)
                io_loop_stop(client->ioloop);
 
        http_client_connection_close(_conn);
@@ -437,7 +437,7 @@ void http_client_connection_check_idle(struct http_client_connection *conn)
                i_assert(peer != NULL);
                client = peer->client;
 
-               if (client->ioloop != NULL)
+               if (client->waiting)
                        io_loop_stop(client->ioloop);
 
                count = array_count(&peer->conns);
index ac589e1ccc2461f4c358baa3f62e87f3f630fbba..2fa8785079a09feb1e03c7268ecae06bc0a010eb 100644 (file)
@@ -393,7 +393,7 @@ http_client_host_lookup_done(
                requests += http_client_queue_host_lookup_done(*queue_idx);
        }
 
-       if (requests == 0 && client->ioloop != NULL)
+       if (requests == 0 && client->waiting)
                io_loop_stop(client->ioloop);
 }
 
index 2418d04487670536a3bbae60971c1331296408fe..bf88c7c5ec1d65dedcd39b645f5e919415b47bfb 100644 (file)
@@ -628,7 +628,7 @@ void http_client_request_get_stats(struct http_client_request *req,
                        (ioloop_global_wait_usecs - req->sent_global_ioloop_usecs + 999) / 1000;
 
                /* time spent in the http-client's own ioloop */
-               if (client->ioloop != NULL) {
+               if (client->waiting) {
                        wait_usecs = io_wait_timer_get_usecs(req->conn->io_wait_timer);
                        i_assert(wait_usecs >= req->sent_http_ioloop_usecs);
                        stats_r->http_ioloop_msecs = (unsigned int)
index 3503b6120c00a7c8eb0c067b204941dd23dff56d..08c9cceb569bead1ba819be4346ee8e1ab5c1b94 100644 (file)
@@ -282,8 +282,6 @@ void http_client_wait(struct http_client *client)
 {
        struct ioloop *prev_ioloop, *client_ioloop, *prev_client_ioloop;
 
-       i_assert(client->ioloop == NULL);
-
        if (client->requests_count == 0)
                return;