Fix bug with proxy connection
This commit is contained in:
parent
b7d09bf2a1
commit
bc5bb29970
@ -65,6 +65,13 @@ enum t_config_look_save_layout_on_exit
|
|||||||
CONFIG_LOOK_SAVE_LAYOUT_ON_EXIT_ALL,
|
CONFIG_LOOK_SAVE_LAYOUT_ON_EXIT_ALL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum t_config_proxy_type
|
||||||
|
{
|
||||||
|
CONFIG_PROXY_TYPE_HTTP = 0,
|
||||||
|
CONFIG_PROXY_TYPE_SOCKS4,
|
||||||
|
CONFIG_PROXY_TYPE_SOCKS5,
|
||||||
|
};
|
||||||
|
|
||||||
extern struct t_config_file *weechat_config_file;
|
extern struct t_config_file *weechat_config_file;
|
||||||
extern struct t_config_section *weechat_config_section_bar;
|
extern struct t_config_section *weechat_config_section_bar;
|
||||||
|
|
||||||
|
@ -447,12 +447,18 @@ network_pass_proxy (int sock, const char *address, int port)
|
|||||||
rc = 0;
|
rc = 0;
|
||||||
if (CONFIG_BOOLEAN(config_proxy_use))
|
if (CONFIG_BOOLEAN(config_proxy_use))
|
||||||
{
|
{
|
||||||
if (string_strcasecmp (CONFIG_STRING(config_proxy_type), "http") == 0)
|
switch (CONFIG_INTEGER(config_proxy_type))
|
||||||
rc = network_pass_httpproxy (sock, address, port);
|
{
|
||||||
if (string_strcasecmp (CONFIG_STRING(config_proxy_type), "socks4") == 0)
|
case CONFIG_PROXY_TYPE_HTTP:
|
||||||
rc = network_pass_socks4proxy (sock, address, port);
|
rc = network_pass_httpproxy (sock, address, port);
|
||||||
if (string_strcasecmp (CONFIG_STRING(config_proxy_type), "socks5") == 0)
|
break;
|
||||||
rc = network_pass_socks5proxy (sock, address, port);
|
case CONFIG_PROXY_TYPE_SOCKS4:
|
||||||
|
rc = network_pass_socks4proxy (sock, address, port);
|
||||||
|
break;
|
||||||
|
case CONFIG_PROXY_TYPE_SOCKS5:
|
||||||
|
rc = network_pass_socks5proxy (sock, address, port);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user