summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-11-07 08:17:16 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-11-07 08:17:16 +0100
commitbc5bb29970ee029ee646b8805b83b3a9d71a2ef8 (patch)
treeea620f6263bd0fd7c83113321f9143d4eeac1e5d
parentb7d09bf2a1f02453bcbba469ea4ef12a0508d3c3 (diff)
downloadweechat-bc5bb29970ee029ee646b8805b83b3a9d71a2ef8.zip
Fix bug with proxy connection
-rw-r--r--src/core/wee-config.h7
-rw-r--r--src/core/wee-network.c18
2 files changed, 19 insertions, 6 deletions
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index a35151745..178ed9196 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -65,6 +65,13 @@ enum t_config_look_save_layout_on_exit
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_section *weechat_config_section_bar;
diff --git a/src/core/wee-network.c b/src/core/wee-network.c
index 592a4a093..17ba8d89b 100644
--- a/src/core/wee-network.c
+++ b/src/core/wee-network.c
@@ -447,12 +447,18 @@ network_pass_proxy (int sock, const char *address, int port)
rc = 0;
if (CONFIG_BOOLEAN(config_proxy_use))
{
- if (string_strcasecmp (CONFIG_STRING(config_proxy_type), "http") == 0)
- rc = network_pass_httpproxy (sock, address, port);
- if (string_strcasecmp (CONFIG_STRING(config_proxy_type), "socks4") == 0)
- rc = network_pass_socks4proxy (sock, address, port);
- if (string_strcasecmp (CONFIG_STRING(config_proxy_type), "socks5") == 0)
- rc = network_pass_socks5proxy (sock, address, port);
+ switch (CONFIG_INTEGER(config_proxy_type))
+ {
+ case CONFIG_PROXY_TYPE_HTTP:
+ rc = network_pass_httpproxy (sock, address, port);
+ break;
+ 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;
}