about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2013-08-21 01:15:19 +0200
committerAlexander Barton <alex@barton.de>2013-08-21 01:16:16 +0200
commit8f530eb3154c7d62201c28a53fac5594a956b447 (patch)
tree4855c161c456f49f7ee128cbeb9e6a5e33e7ccbb /src
parentd56341c77b19b3e1d4cf13c2f95ec1612e8d52c9 (diff)
downloadngircd-8f530eb3154c7d62201c28a53fac5594a956b447.tar.gz
ngircd-8f530eb3154c7d62201c28a53fac5594a956b447.zip
Enhance log messages on "recursive" connection errors
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/conn.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 53497e3b..30dfd094 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -1181,8 +1181,8 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
 	/* Is this link already shutting down? */
 	if( Conn_OPTION_ISSET( &My_Connections[Idx], CONN_ISCLOSING )) {
 		/* Conn_Close() has been called recursively for this link;
-		 * probabe reason: Handle_Write() failed  -- see below. */
-		LogDebug("Recursive request to close connection: %d", Idx );
+		 * probable reason: Handle_Write() failed -- see below. */
+		LogDebug("Recursive request to close connection %d!", Idx );
 		return;
 	}
 
@@ -1450,8 +1450,13 @@ Handle_Write( CONN_ID Idx )
 		if (errno == EAGAIN || errno == EINTR)
 			return true;
 
-		Log(LOG_ERR, "Write error on connection %d (socket %d): %s!",
-		    Idx, My_Connections[Idx].sock, strerror(errno));
+		if (!Conn_OPTION_ISSET(&My_Connections[Idx], CONN_ISCLOSING))
+			Log(LOG_ERR,
+			    "Write error on connection %d (socket %d): %s!",
+			    Idx, My_Connections[Idx].sock, strerror(errno));
+		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;
 	}
@@ -2459,7 +2464,8 @@ cb_Read_Resolver_Result( int r_fd, UNUSED short events )
 		Class_HandleServerBans(c);
 	}
 #ifdef DEBUG
-		else Log( LOG_DEBUG, "Resolver: discarding result for already registered connection %d.", i );
+	else
+		LogDebug("Resolver: discarding result for already registered connection %d.", i);
 #endif
 } /* cb_Read_Resolver_Result */