X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fconn.c;h=92d9939ab291445e53806b75609dfaa8209915ad;hp=f62e96754fa9ef610ef556f246f7b6f3711648cd;hb=629a45ee0f4469729f6a9c22a983000fcc39fe61;hpb=bb1d014abad85b6938cf9d3e88e64f4ee6757ede diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index f62e9675..92d9939a 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -10,6 +10,7 @@ */ #define CONN_MODULE +#define CONN_MODULE_GLOBAL_INIT #include "portab.h" @@ -1271,6 +1272,9 @@ Handle_Write( CONN_ID Idx ) if (errno == EAGAIN || errno == EINTR) return true; + /* Log write errors but do not close the connection yet. + * Calling Conn_Close() now could result in too many recursive calls. + */ if (!Conn_OPTION_ISSET(&My_Connections[Idx], CONN_ISCLOSING)) Log(LOG_ERR, "Write error on connection %d (socket %d): %s!", @@ -1278,7 +1282,7 @@ Handle_Write( CONN_ID Idx ) else LogDebug("Recursive write error on connection %d (socket %d): %s!", Idx, My_Connections[Idx].sock, strerror(errno)); - Conn_Close(Idx, "Write error", NULL, false); + return false; }