# HG changeset patch # User Matti Hamalainen # Date 1403407185 -10800 # Node ID 43eee625021a4b5a2ad5d48337b89ead4f9ff22e # Parent 5269a8cdbd96815a3657427d88a80288f86f94fd Fixes in proxy usage. diff -r 5269a8cdbd96 -r 43eee625021a main.c --- a/main.c Sun Jun 22 03:32:39 2014 +0300 +++ b/main.c Sun Jun 22 06:19:45 2014 +0300 @@ -2229,24 +2229,18 @@ if (th_conn_set_proxy(conn, optProxyType, optProxyPort, optProxyServer, optProxyAuthType) != THERR_OK || th_conn_set_proxy_auth_user(conn, optProxyUserID, optProxyPassword) != THERR_OK || th_conn_set_proxy_mode(conn, TH_PROXY_CMD_CONNECT) != THERR_OK || - th_conn_set_proxy_addr_type(conn, optProxyAddrType)) + th_conn_set_proxy_addr_type(conn, optProxyAddrType) != THERR_OK) { errorMsg("Error setting proxy information.\n"); goto err_exit; } } - // Okay, try to resolve the hostname - conn->host = th_strdup(optServer); - conn->hst = th_resolve_host(conn, optServer); - if (conn->hst == NULL) - goto err_exit; - #ifdef FINAL_BUILD /* To emulate the official client, we first make a request for * policy file, even though we don't use it for anything... */ - if (th_conn_open(conn, 843, NULL) != 0) + if (th_conn_open(conn, 843, optServer) != 0) { errorMsg("Policy file request connection setup failed!\n"); goto err_exit; @@ -2274,7 +2268,7 @@ #endif // Okay, now do the proper connection ... - if (th_conn_open(conn, optPort, NULL) != 0) + if (th_conn_open(conn, optPort, optServer) != 0) { errorMsg("Main connection setup failed!\n"); goto err_exit;