This commit is contained in:
LemonBoy 2017-04-19 04:55:23 +00:00 committed by GitHub
commit 9fab105843
3 changed files with 6 additions and 1 deletions

View file

@ -36,6 +36,7 @@ unsigned int server_operator:1;
unsigned int usermode_away:1; unsigned int usermode_away:1;
unsigned int banned:1; /* not allowed to connect to this server */ unsigned int banned:1; /* not allowed to connect to 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 */
unsigned int dns_reverse:1;
GTimeVal lag_sent; /* 0 or time when last lag query was sent to server */ GTimeVal lag_sent; /* 0 or time when last lag query was sent to server */
time_t lag_last_check; /* last time we checked lag */ time_t lag_last_check; /* last time we checked lag */

View file

@ -250,7 +250,10 @@ static void sig_reconnect(SERVER_REC *server)
sserver->dns_error = server->dns_error; sserver->dns_error = server->dns_error;
} }
if (sserver == NULL || conn->chatnet == NULL) { /* server_setup_fill fails if we've reverse-resolved the connrec
* address, so let's pick another server from the chatnet if possible. */
if ((sserver == NULL && server->dns_reverse == FALSE) ||
conn->chatnet == NULL) {
/* not in any chatnet, just reconnect back to same server */ /* not in any chatnet, just reconnect back to same server */
conn->family = server->connrec->family; conn->family = server->connrec->family;
conn->address = g_strdup(server->connrec->address); conn->address = g_strdup(server->connrec->address);

View file

@ -307,6 +307,7 @@ static void server_connect_callback_readpipe(SERVER_REC *server)
if (servername) { if (servername) {
g_free(server->connrec->address); g_free(server->connrec->address);
server->connrec->address = g_strdup(servername); server->connrec->address = g_strdup(servername);
server->dns_reverse = TRUE;
} }
server_real_connect(server, ip, NULL); server_real_connect(server, ip, NULL);
errormsg = NULL; errormsg = NULL;