mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
use GIO resolver
change: rename resolve_prefer_ipv6 -> irssiproxy_prefer_ipv6
This commit is contained in:
parent
d5be7d7756
commit
51f2a4f7fb
18 changed files with 313 additions and 339 deletions
|
|
@ -711,16 +711,19 @@ static void add_listen(const char *ircnet, int port, const char *port_or_path)
|
|||
/* bind to specific host/ip? */
|
||||
my_ip = NULL;
|
||||
if (*settings_get_str("irssiproxy_bind") != '\0') {
|
||||
if (net_gethostbyname(settings_get_str("irssiproxy_bind"),
|
||||
&ip4, &ip6) != 0) {
|
||||
if (net_gethostbyname_first_ips(settings_get_str("irssiproxy_bind"),
|
||||
G_RESOLVER_NAME_LOOKUP_FLAGS_DEFAULT, &ip4,
|
||||
&ip6) != 0) {
|
||||
printtext(NULL, NULL, MSGLEVEL_CLIENTERROR,
|
||||
"Proxy: can not resolve '%s' - aborting",
|
||||
settings_get_str("irssiproxy_bind"));
|
||||
return;
|
||||
}
|
||||
|
||||
my_ip = ip6.family == 0 ? &ip4 : ip4.family == 0 ||
|
||||
settings_get_bool("resolve_prefer_ipv6") ? &ip6 : &ip4;
|
||||
my_ip = ip6.family == 0 ? &ip4 :
|
||||
ip4.family == 0 || settings_get_bool("irssiproxy_prefer_ipv6") ?
|
||||
&ip6 :
|
||||
&ip4;
|
||||
}
|
||||
handle = net_listen(my_ip, &port);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ static void irc_proxy_setup_changed(void)
|
|||
|
||||
void irc_proxy_init(void)
|
||||
{
|
||||
settings_add_bool("irssiproxy", "irssiproxy_prefer_ipv6", TRUE);
|
||||
settings_add_str("irssiproxy", "irssiproxy_ports", "");
|
||||
settings_add_str("irssiproxy", "irssiproxy_password", "");
|
||||
settings_add_str("irssiproxy", "irssiproxy_bind", "");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue