comparison main.c @ 606:2cc5434a8ce0

Change proxy authentication handling.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 20 May 2014 04:34:23 +0300
parents 0a30bf8db004
children c7b8e299c612
comparison
equal deleted inserted replaced
605:ad00f2bbb615 606:2cc5434a8ce0
57 57
58 /* Options 58 /* Options
59 */ 59 */
60 int optPort = 8005, 60 int optPort = 8005,
61 optProxyPort = 1080, 61 optProxyPort = 1080,
62 optProxyType = NN_PROXY_NONE; 62 optProxyType = NN_PROXY_NONE,
63 optProxyAuthType = NN_PROXY_AUTH_NONE;
63 int optUserColor = 0x000000; 64 int optUserColor = 0x000000;
64 char *optServer = "chat.newbienudes.com", 65 char *optServer = "chat.newbienudes.com",
65 *optProxyServer = NULL, 66 *optProxyServer = NULL,
66 *optProxyUserID = NULL, 67 *optProxyUserID = NULL,
67 *optProxyPassword = NULL, 68 *optProxyPassword = NULL,
2087 if (optProxyType != NN_PROXY_NONE && optProxyServer != NULL) 2088 if (optProxyType != NN_PROXY_NONE && optProxyServer != NULL)
2088 { 2089 {
2089 if (optProxyUserID == NULL) 2090 if (optProxyUserID == NULL)
2090 optProxyUserID = "James Bond"; 2091 optProxyUserID = "James Bond";
2091 2092
2092 if (nn_conn_set_proxy(conn, optProxyType, optProxyPort, optProxyServer, 2093 if (nn_conn_set_proxy(conn, optProxyType, optProxyPort, optProxyServer, optProxyAuthType) != 0 ||
2093 optProxyUserID, optProxyPassword) != 0) 2094 nn_conn_set_proxy_auth_user(conn, optProxyUserID, optProxyPassword) != 0)
2094 { 2095 {
2095 errorMsg("Error setting proxy information.\n"); 2096 errorMsg("Error setting proxy information.\n");
2096 goto err_exit; 2097 goto err_exit;
2097 } 2098 }
2098 } 2099 }