]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-client-connection - Use http_client_connection_is_active() to check...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 19 Aug 2020 22:17:49 +0000 (00:17 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Thu, 27 Aug 2020 09:40:39 +0000 (11:40 +0200)
This makes the check shorter and easier to understand.

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

index 3af2caae68d8493f4e73bdeb0fedf05ea156c354..a60a05d7ed2e708b3ddf12c78a0c4512cb71e2a5 100644 (file)
@@ -522,10 +522,7 @@ void http_client_connection_check_idle(struct http_client_connection *conn)
                return;
        }
 
-       if (conn->connected &&
-           array_is_created(&conn->request_wait_list) &&
-           array_count(&conn->request_wait_list) == 0 &&
-           !conn->in_req_callback && conn->incoming_payload == NULL) {
+       if (conn->connected && !http_client_connection_is_active(conn)) {
                struct http_client *client = peer->client;
 
                i_assert(conn->to_requests == NULL);