mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-05 21:30:29 +00:00
Fix Bugzilla #64 -- ngicrd did not reconnect to other servers after failed forward dns lookup.
This commit is contained in:
parent
a293088027
commit
4b2f966b7e
@ -17,7 +17,7 @@
|
|||||||
#include "portab.h"
|
#include "portab.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
||||||
static char UNUSED id[] = "$Id: conn.c,v 1.185 2005/11/21 15:06:37 alex Exp $";
|
static char UNUSED id[] = "$Id: conn.c,v 1.186 2005/12/09 09:26:55 fw Exp $";
|
||||||
|
|
||||||
#include "imp.h"
|
#include "imp.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -1557,15 +1557,15 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
|
|||||||
|
|
||||||
/* Read result from pipe */
|
/* Read result from pipe */
|
||||||
len = Resolve_Read(&My_Connections[i].res_stat, readbuf, sizeof readbuf -1);
|
len = Resolve_Read(&My_Connections[i].res_stat, readbuf, sizeof readbuf -1);
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
return;
|
goto out;
|
||||||
|
|
||||||
readbuf[len] = '\0';
|
readbuf[len] = '\0';
|
||||||
identptr = strchr(readbuf, '\n');
|
identptr = strchr(readbuf, '\n');
|
||||||
assert(identptr != NULL);
|
assert(identptr != NULL);
|
||||||
if (!identptr) {
|
if (!identptr) {
|
||||||
Log( LOG_CRIT, "Resolver: Got malformed result!");
|
Log( LOG_CRIT, "Resolver: Got malformed result!");
|
||||||
return;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
*identptr = '\0';
|
*identptr = '\0';
|
||||||
@ -1610,6 +1610,16 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
|
|||||||
|
|
||||||
/* Reset penalty time */
|
/* Reset penalty time */
|
||||||
Conn_ResetPenalty( i );
|
Conn_ResetPenalty( i );
|
||||||
|
return;
|
||||||
|
out:
|
||||||
|
if (My_Connections[i].sock == SERVER_WAIT) {
|
||||||
|
n = Conf_GetServer( i );
|
||||||
|
assert(n > NONE );
|
||||||
|
if (n > NONE) {
|
||||||
|
Conf_Server[n].conn_id = NONE;
|
||||||
|
Init_Conn_Struct(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
} /* cb_Read_Resolver_Result */
|
} /* cb_Read_Resolver_Result */
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user