Skip to content

Commit

Permalink
remove superfluous autoreconnectonfail and fix SSL reconnect ...
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rofl0r committed Mar 11, 2013
1 parent a6f2148 commit 85d042d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/common/cfgfiles.c
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
14 changes: 9 additions & 5 deletions src/common/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
}
Expand Down Expand Up @@ -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) */
}
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 */
Expand All @@ -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 */
Expand Down

0 comments on commit 85d042d

Please sign in to comment.