]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Use the new http_url_get_port*() functions.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 21 Jan 2018 15:00:31 +0000 (16:00 +0100)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 12 Mar 2018 09:07:37 +0000 (11:07 +0200)
src/lib-http/http-client-request.c

index 5d12715498fda2b16f24782edd8ef7069ac2f654..e0f9f897184b924916c83c770d142422336a25f1 100644 (file)
@@ -852,7 +852,7 @@ http_client_request_get_peer_addr(const struct http_client_request *req,
                addr->type = HTTP_CLIENT_PEER_ADDR_RAW;
                addr->a.tcp.ip = host_url->host.ip;
                addr->a.tcp.port =
-                       (host_url->port != 0 ? host_url->port : HTTPS_DEFAULT_PORT);
+                       http_url_get_port_default(host_url, HTTPS_DEFAULT_PORT);
        } else if (host_url->have_ssl) {
                if (req->ssl_tunnel)
                        addr->type = HTTP_CLIENT_PEER_ADDR_HTTPS_TUNNEL;
@@ -860,13 +860,11 @@ http_client_request_get_peer_addr(const struct http_client_request *req,
                        addr->type = HTTP_CLIENT_PEER_ADDR_HTTPS;
                addr->a.tcp.ip = host_url->host.ip;
                addr->a.tcp.https_name = host_url->host.name;
-               addr->a.tcp.port =
-                       (host_url->port != 0 ? host_url->port : HTTPS_DEFAULT_PORT);
+               addr->a.tcp.port = http_url_get_port(host_url);
        } else {
                addr->type = HTTP_CLIENT_PEER_ADDR_HTTP;
                addr->a.tcp.ip = host_url->host.ip;
-               addr->a.tcp.port =
-                       (host_url->port != 0 ? host_url->port : HTTP_DEFAULT_PORT);
+               addr->a.tcp.port = http_url_get_port(host_url);
        }
 }