From aa0b09ebeff911c9c9d2ca6c3efd06ff45a339f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 7 Jul 2020 13:03:44 +0400 Subject: [PATCH] gio: use g_uri_split_network() in g_simple_proxy_resolver_lookup() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau --- gio/gsimpleproxyresolver.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gio/gsimpleproxyresolver.c b/gio/gsimpleproxyresolver.c index f33d49f8c..58368ea4e 100644 --- a/gio/gsimpleproxyresolver.c +++ b/gio/gsimpleproxyresolver.c @@ -327,10 +327,11 @@ g_simple_proxy_resolver_lookup (GProxyResolver *proxy_resolver, if (priv->ignore_ips || priv->ignore_domains) { gchar *host = NULL; - gushort port; + gint port; - if (_g_uri_parse_authority (uri, &host, &port, NULL, NULL) && - ignore_host (resolver, host, port)) + if (g_uri_split_network (uri, G_URI_FLAGS_PARSE_STRICT, NULL, + &host, &port, NULL) && + ignore_host (resolver, host, port > 0 ? port : 0)) proxy = "direct://"; g_free (host);