mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-06 01:16:17 +01:00
simpleproxyresolver: Ignore host with scope id
Ignore host successfully when a ipv6 address contains a scope id.
This commit is contained in:
parent
4416d9dcce
commit
a4a516a8ab
@ -26,6 +26,7 @@
|
||||
|
||||
#include "gsimpleproxyresolver.h"
|
||||
#include "ginetaddress.h"
|
||||
#include "ginetsocketaddress.h"
|
||||
#include "ginetaddressmask.h"
|
||||
#include "gnetworkingprivate.h"
|
||||
#include "gtask.h"
|
||||
@ -264,9 +265,13 @@ ignore_host (GSimpleProxyResolver *resolver,
|
||||
if (priv->ignore_ips)
|
||||
{
|
||||
GInetAddress *iaddr;
|
||||
GInetSocketAddress *isaddr = NULL;
|
||||
|
||||
iaddr = g_inet_address_new_from_string (host);
|
||||
if (iaddr)
|
||||
/* Grab the GInetAddress from the GInetSocketAddress in order to support
|
||||
* scope ID. */
|
||||
isaddr = (GInetSocketAddress *) g_inet_socket_address_new_from_string (host, 0);
|
||||
iaddr = (isaddr != NULL) ? g_inet_socket_address_get_address (isaddr) : NULL;
|
||||
if (iaddr != NULL)
|
||||
{
|
||||
for (i = 0; i < priv->ignore_ips->len; i++)
|
||||
{
|
||||
@ -278,11 +283,12 @@ ignore_host (GSimpleProxyResolver *resolver,
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_object_unref (iaddr);
|
||||
if (ignore)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_clear_object (&isaddr);
|
||||
|
||||
if (ignore)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (priv->ignore_domains)
|
||||
|
Loading…
Reference in New Issue
Block a user