]> 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)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 26 Feb 2018 08:47:13 +0000 (10:47 +0200)
src/lib-http/http-client-request.c

index c3071db73d275fbdfc8571cac024d3e23cdd9ca1..dc521c058cdb09c7f7595b44da62b116140f06af 100644 (file)
@@ -851,7 +851,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;
@@ -859,13 +859,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);
        }
 }