]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: host: Moved http_client_host_submit_request() function.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 4 Dec 2016 11:51:02 +0000 (12:51 +0100)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 7 Dec 2017 16:40:45 +0000 (18:40 +0200)
This is a preparation for a subsequent change.

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

index d8488eccedfb8a3130bdcd90188fa353fd73fb76..bcebda90836e59cf632f7b4a47d83664f63f8a2e 100644 (file)
@@ -270,33 +270,6 @@ struct http_client_host *http_client_host_get
        return host;
 }
 
-void http_client_host_submit_request(struct http_client_host *host,
-       struct http_client_request *req)
-{
-       struct http_client_queue *queue;
-       struct http_client_peer_addr addr;
-       const char *error;
-
-       req->host = host;
-
-       http_client_request_get_peer_addr(req, &addr);
-       if (http_client_peer_addr_is_https(&addr) &&
-               host->client->ssl_ctx == NULL) {
-               if (http_client_init_ssl_ctx(host->client, &error) < 0) {
-                       http_client_request_error(&req,
-                               HTTP_CLIENT_REQUEST_ERROR_CONNECT_FAILED, error);
-                       return;
-               }
-       }
-
-       /* add request to queue (grouped by tcp port) */
-       queue = http_client_queue_get(host, &addr);
-       http_client_queue_submit_request(queue, req);
-
-       /* cancel host idle timeout */
-       timeout_remove(&host->to_idle);
-}
-
 void http_client_host_free(struct http_client_host **_host)
 {
        struct http_client_host *host = *_host;
@@ -333,6 +306,33 @@ void http_client_host_free(struct http_client_host **_host)
        i_free(host);
 }
 
+void http_client_host_submit_request(struct http_client_host *host,
+       struct http_client_request *req)
+{
+       struct http_client_queue *queue;
+       struct http_client_peer_addr addr;
+       const char *error;
+
+       req->host = host;
+
+       http_client_request_get_peer_addr(req, &addr);
+       if (http_client_peer_addr_is_https(&addr) &&
+               host->client->ssl_ctx == NULL) {
+               if (http_client_init_ssl_ctx(host->client, &error) < 0) {
+                       http_client_request_error(&req,
+                               HTTP_CLIENT_REQUEST_ERROR_CONNECT_FAILED, error);
+                       return;
+               }
+       }
+
+       /* add request to queue (grouped by tcp port) */
+       queue = http_client_queue_get(host, &addr);
+       http_client_queue_submit_request(queue, req);
+
+       /* cancel host idle timeout */
+       timeout_remove(&host->to_idle);
+}
+
 bool http_client_host_get_ip_idx(struct http_client_host *host,
        const struct ip_addr *ip, unsigned int *idx_r)
 {