From 85d042d7944cb0a24af1c8563826d3e4d9beb720 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Mon, 11 Mar 2013 02:39:49 +0100 Subject: [PATCH] remove superfluous autoreconnectonfail and fix SSL reconnect ... i dont see a point in a separate prefs.autoreconnectonfail if we already have prefs.autoreconnect. even worse, the setting was not reachable via gui and could only be set via /SET. as for the handler code for this error: "error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number" "Are you sure this is a SSL capable server and port?" the gtk frontend seems to ignore the return value of the function that handles it (ssl_do_connect()), but in the text frontend the timeout handler job was removed if the function returned 0. now, if autoreconnect is set, it will reconnect on this error in both frontends. --- src/common/cfgfiles.c | 1 - src/common/server.c | 14 +++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 57a4e35..ca1a6b8 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -451,7 +451,6 @@ const struct prefs vars[] = { {"irc_whois_front", P_OFFINT (irc_whois_front), TYPE_BOOL}, {"net_auto_reconnect", P_OFFINT (autoreconnect), TYPE_BOOL}, - {"net_auto_reconnectonfail", P_OFFINT (autoreconnectonfail), TYPE_BOOL}, {"net_bind_host", P_OFFSET (hostname), TYPE_STR}, {"net_ping_timeout", P_OFFINT (pingtimeout), TYPE_INT}, {"net_proxy_auth", P_OFFINT (proxy_auth), TYPE_BOOL}, diff --git a/src/common/server.c b/src/common/server.c index f22bb06..3a67baa 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -609,8 +609,10 @@ ssl_do_connect (server * serv) server_cleanup (serv); - if (prefs.autoreconnectonfail) + if (prefs.autoreconnect) { auto_reconnect (serv, FALSE, -1); + return 1; + } return (0); /* remove it (0) */ } @@ -733,8 +735,10 @@ ssl_do_connect (server * serv) NULL, NULL, 0); server_cleanup (serv); /* ->connecting = FALSE */ - if (prefs.autoreconnectonfail) + if (prefs.autoreconnect) { auto_reconnect (serv, FALSE, -1); + return 1; + } return (0); /* remove it (0) */ } @@ -836,7 +840,7 @@ server_connect_success (server *serv) /* send(serv->sok, "STLS\r\n", 6, 0); sleep(1); */ set_nonblocking (serv->sok); serv->ssl_do_connect_tag = fe_timeout_add (SSLDOCONNTMOUT, - ssl_do_connect, serv); + ssl_do_connect, serv); return; } @@ -880,7 +884,7 @@ server_read_child (GIOChannel *source, GIOCondition condition, server *serv) #endif EMIT_SIGNAL (XP_TE_UKNHOST, sess, NULL, NULL, NULL, NULL, 0); if (!servlist_cycle (serv)) - if (prefs.autoreconnectonfail) + if (prefs.autoreconnect) auto_reconnect (serv, FALSE, -1); break; case '2': /* connection failed */ @@ -898,7 +902,7 @@ server_read_child (GIOChannel *source, GIOCondition condition, server *serv) EMIT_SIGNAL (XP_TE_CONNFAIL, sess, errorstring (atoi (tbuf)), NULL, NULL, NULL, 0); if (!servlist_cycle (serv)) - if (prefs.autoreconnectonfail) + if (prefs.autoreconnect) auto_reconnect (serv, FALSE, -1); break; case '3': /* gethostbyname finished */ -- 2.11.4.GIT