]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Simplified initiation of connection setup upon request submission.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 4 Dec 2016 15:00:49 +0000 (16:00 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 7 Dec 2017 16:40:45 +0000 (18:40 +0200)
src/lib-http/http-client-host.c
src/lib-http/http-client-queue.c

index 2d1f3f2f236d2b4203ba495df0181235208b2134..1350f5c8ffd4aa252031b906f6341f7f064209bf 100644 (file)
@@ -256,19 +256,6 @@ void http_client_host_submit_request(struct http_client_host *host,
 
        /* cancel host idle timeout */
        timeout_remove(&host->to_idle);
-
-       if (host->unix_local) {
-               http_client_queue_connection_setup(queue);
-               return;
-       }
-
-       /* start DNS lookup if necessary */
-       if (host->ips_count == 0 && host->dns_lookup == NULL)   
-               http_client_host_lookup(host);
-
-       /* make a connection if we have an IP already */
-       if (host->ips_count > 0)
-               http_client_queue_connection_setup(queue);
 }
 
 void http_client_host_free(struct http_client_host **_host)
index 2c62c1816f0932b65c40d7d3fac430f468473043..743a710b900ae9b2588046a7779ebbfebf492624 100644 (file)
@@ -838,7 +838,8 @@ static void http_client_queue_submit_now(struct http_client_queue *queue,
 
        } else if (timeval_diff_msecs(&req->timeout_time, &ioloop_timeval) <= 1) {
                /* pretty much already timed out; don't bother */
-               
+               return;
+
        } else {
                unsigned int insert_idx;
 
@@ -847,6 +848,8 @@ static void http_client_queue_submit_now(struct http_client_queue *queue,
                        &req, http_client_queue_request_timeout_cmp, &insert_idx);
                array_insert(req_queue, insert_idx, &req, 1);
        }
+
+       http_client_queue_connection_setup(queue);
 }
 
 /*
@@ -881,8 +884,6 @@ http_client_queue_delay_timeout(struct http_client_queue *queue)
                http_client_queue_set_delay_timer(queue, reqs[i]->release_time);
        }
        array_delete(&queue->delayed_requests, 0, finished);
-
-       http_client_queue_connection_setup(queue);
 }
 
 static void