repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 1d8da4b5258ee1685d0443a182c6106ceb608a23:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 1d8da4b5258ee1685d0443a182c6106ceb608a23
Author: Alexander Barton 
Date:   Sun Apr 25 14:06:11 2004 +0000

    Fixed a wrong assert() which could cause the daemon to exit spuriously
    when closing down connections.

diff --git a/ChangeLog b/ChangeLog
index 783382725e7de9ad68c95083cf905e339a30797c..
index ..87594db7f5b6a8175c979036aac73be2b1b023c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,8 @@

 ngIRCd CVSHEAD

+  - Fixed a wrong assert() which could cause the daemon to exit spuriously
+    when closing down connections.
   - Better logging of decompression errors returned by zlib.
   - Servers other than the destination server didn't clean up the invite
     list of an "invite-only" channel properly when an INVITE'd user joined.
@@ -511,4 +513,4 @@ ngIRCd 0.0.1, 31.12.2001


 -- 
-$Id: ChangeLog,v 1.231 2004/04/25 13:55:34 alex Exp $
+$Id: ChangeLog,v 1.232 2004/04/25 14:06:11 alex Exp $
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index c40961c795ef8551628dddac68cdc157058da976..
index ..d548efc26b6fe48002b1bc4e7dfcc09dae0921d9 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -16,7 +16,7 @@

 #include "portab.h"

-static char UNUSED id[] = "$Id: conn.c,v 1.133 2004/03/11 22:16:31 alex Exp $";
+static char UNUSED id[] = "$Id: conn.c,v 1.134 2004/04/25 14:06:12 alex Exp $";

 #include "imp.h"
 #include 
@@ -622,7 +622,6 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
 #endif

 	assert( Idx > NONE );
-	assert( My_Connections[Idx].sock > NONE );

 	/* Is this link already shutting down? */
 	if( My_Connections[Idx].options & CONN_ISCLOSING )
@@ -632,6 +631,8 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
 		return;
 	}

+	assert( My_Connections[Idx].sock > NONE );
+
 	/* Mark link as "closing" */
 	My_Connections[Idx].options |= CONN_ISCLOSING;

-----END OF PAGE-----