1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

/SERVER ADD: added -noproxy option and -proxy which just removes the

-noproxy.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2344 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-01-24 20:57:16 +00:00 committed by cras
parent d74d284463
commit 182adb805c
4 changed files with 9 additions and 1 deletions

View File

@ -14,6 +14,7 @@ IPADDR *own_ip4, *own_ip6; /* resolved own_address if not NULL */
time_t last_connect; /* to avoid reconnecting too fast.. */ time_t last_connect; /* to avoid reconnecting too fast.. */
unsigned int autoconnect:1; unsigned int autoconnect:1;
unsigned int no_proxy:1;
unsigned int last_failed:1; /* if last connection attempt failed */ unsigned int last_failed:1; /* if last connection attempt failed */
unsigned int banned:1; /* if we're banned from this server */ unsigned int banned:1; /* if we're banned from this server */
unsigned int dns_error:1; /* DNS said the host doesn't exist */ unsigned int dns_error:1; /* DNS said the host doesn't exist */

View File

@ -156,6 +156,9 @@ static void server_setup_fill_server(SERVER_CONNECT_REC *conn,
sserver->last_connect = time(NULL); sserver->last_connect = time(NULL);
if (sserver->no_proxy)
g_free_and_null(conn->proxy);
if (sserver->family != 0 && conn->family == 0) if (sserver->family != 0 && conn->family == 0)
conn->family = sserver->family; conn->family = sserver->family;
if (sserver->port > 0 && conn->port <= 0) if (sserver->port > 0 && conn->port <= 0)

View File

@ -146,6 +146,8 @@ static void cmd_server_add(const char *data)
if (g_hash_table_lookup(optlist, "auto")) rec->autoconnect = TRUE; if (g_hash_table_lookup(optlist, "auto")) rec->autoconnect = TRUE;
if (g_hash_table_lookup(optlist, "noauto")) rec->autoconnect = FALSE; if (g_hash_table_lookup(optlist, "noauto")) rec->autoconnect = FALSE;
if (g_hash_table_lookup(optlist, "proxy")) rec->no_proxy = FALSE;
if (g_hash_table_lookup(optlist, "noproxy")) rec->no_proxy = TRUE;
if (*password != '\0' && strcmp(password, "-") != 0) rec->password = g_strdup(password); if (*password != '\0' && strcmp(password, "-") != 0) rec->password = g_strdup(password);
value = g_hash_table_lookup(optlist, "host"); value = g_hash_table_lookup(optlist, "host");
@ -322,7 +324,7 @@ void fe_server_init(void)
command_bind("server connect", NULL, (SIGNAL_FUNC) cmd_server_connect); command_bind("server connect", NULL, (SIGNAL_FUNC) cmd_server_connect);
command_bind("server add", NULL, (SIGNAL_FUNC) cmd_server_add); command_bind("server add", NULL, (SIGNAL_FUNC) cmd_server_add);
command_bind("server remove", NULL, (SIGNAL_FUNC) cmd_server_remove); command_bind("server remove", NULL, (SIGNAL_FUNC) cmd_server_remove);
command_set_options("server add", "4 6 auto noauto -host -port"); command_set_options("server add", "4 6 auto noauto proxy noproxy -host -port");
signal_add("server looking", (SIGNAL_FUNC) sig_server_looking); signal_add("server looking", (SIGNAL_FUNC) sig_server_looking);
signal_add("server connecting", (SIGNAL_FUNC) sig_server_connecting); signal_add("server connecting", (SIGNAL_FUNC) sig_server_connecting);

View File

@ -75,6 +75,8 @@ static void cmd_server_list(const char *data)
g_string_append(str, "(pass), "); g_string_append(str, "(pass), ");
if (rec->autoconnect) if (rec->autoconnect)
g_string_append(str, "autoconnect, "); g_string_append(str, "autoconnect, ");
if (rec->no_proxy)
g_string_append(str, "noproxy, ");
if (rec->max_cmds_at_once > 0) if (rec->max_cmds_at_once > 0)
g_string_sprintfa(str, "cmdmax: %d, ", rec->max_cmds_at_once); g_string_sprintfa(str, "cmdmax: %d, ", rec->max_cmds_at_once);
if (rec->cmd_queue_speed > 0) if (rec->cmd_queue_speed > 0)