Mercurial > hg > nnchat
changeset 609:b10d81ddfc55
Use URI form of proxy configuration in the config file as well.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 20 May 2014 04:44:45 +0300 |
parents | a8fa7803284a |
children | 224b28e82698 |
files | main.c |
diffstat | 1 files changed, 6 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/main.c Tue May 20 04:35:24 2014 +0300 +++ b/main.c Tue May 20 04:44:45 2014 +0300 @@ -1928,7 +1928,7 @@ nn_editbuf_t *editBuf = nn_editbuf_new(NN_TMPBUF_SIZE); nn_editstate_t editState; th_cfgitem_t *tmpcfg; - char *setHomeDir = NULL; + char *setHomeDir = NULL, *setProxyURI = NULL; memset(editHistBuf, 0, sizeof(editHistBuf)); clearEditState(&editState); @@ -1976,16 +1976,8 @@ th_cfg_add_section(&cfg, "server", tmpcfg); tmpcfg = NULL; - th_cfg_add_comment(&tmpcfg, "Proxy server type (0 = none, 1 = SOCKS 4, 2 = SOCKS 4a)"); - th_cfg_add_int(&tmpcfg, "type", &optProxyType, optProxyType); - th_cfg_add_comment(&tmpcfg, "Proxy server host name"); - th_cfg_add_string(&tmpcfg, "host", &optProxyServer, optProxyServer); - th_cfg_add_comment(&tmpcfg, "Proxy port, 1080 is the standard SOCKS port"); - th_cfg_add_int(&tmpcfg, "port", &optProxyPort, optProxyPort); - th_cfg_add_comment(&tmpcfg, "Proxy user ID"); - th_cfg_add_string(&tmpcfg, "userid", &optProxyUserID, optProxyUserID); -// th_cfg_add_comment(&tmpcfg, "Proxy password (only available for SOCKS 5)"); -// th_cfg_add_string(&tmpcfg, "password", &optProxyPassword, optProxyPassword); + th_cfg_add_comment(&tmpcfg, "Proxy URI (see comandline help for more information)"); + th_cfg_add_string(&tmpcfg, "uri", &setProxyURI, NULL); th_cfg_add_section(&cfg, "proxy", tmpcfg); @@ -2045,6 +2037,9 @@ } } + if (setProxyURI && !argHandleProxyURI(setProxyURI)) + goto err_exit; + optNickSep = optNickSepStr ? optNickSepStr[0] : SET_NICK_SEPARATOR; setBrowser = getenv("BROWSER");