mirror of
https://github.com/osmarks/ngircd.git
synced 2025-09-07 13:17:55 +00:00
ngIRCd now handles recursive calls to Conn_Close() correctly (from HEAD).
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "portab.h"
|
#include "portab.h"
|
||||||
|
|
||||||
static char UNUSED id[] = "$Id: conn.c,v 1.106 2002/12/18 13:50:22 alex Exp $";
|
static char UNUSED id[] = "$Id: conn.c,v 1.106.2.1 2003/03/09 20:16:46 alex Exp $";
|
||||||
|
|
||||||
#include "imp.h"
|
#include "imp.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -574,6 +574,18 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
|
|||||||
assert( Idx > NONE );
|
assert( Idx > NONE );
|
||||||
assert( My_Connections[Idx].sock > NONE );
|
assert( My_Connections[Idx].sock > NONE );
|
||||||
|
|
||||||
|
/* Is this link already shutting down? */
|
||||||
|
if( My_Connections[Idx].options & CONN_ISCLOSING )
|
||||||
|
{
|
||||||
|
/* Conn_Close() has been called recursively for this link;
|
||||||
|
* probabe reason: Try_Write() failed -- see below. */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Mark link as "closing" */
|
||||||
|
My_Connections[Idx].options |= CONN_ISCLOSING;
|
||||||
|
|
||||||
|
/* Search client, if any */
|
||||||
c = Client_GetFromConn( Idx );
|
c = Client_GetFromConn( Idx );
|
||||||
|
|
||||||
if( InformClient )
|
if( InformClient )
|
||||||
@@ -592,9 +604,8 @@ Conn_Close( CONN_ID Idx, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN InformClient )
|
|||||||
if( My_Connections[Idx].sock == NONE ) return;
|
if( My_Connections[Idx].sock == NONE ) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* zunaechst versuchen, noch im Schreibpuffer vorhandene
|
/* Try to write out the write buffer */
|
||||||
* Daten auf den Socket zu schreiben ... */
|
(VOID)Try_Write( Idx );
|
||||||
Try_Write( Idx );
|
|
||||||
|
|
||||||
if( close( My_Connections[Idx].sock ) != 0 )
|
if( close( My_Connections[Idx].sock ) != 0 )
|
||||||
{
|
{
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
* Please read the file COPYING, README and AUTHORS for more information.
|
* Please read the file COPYING, README and AUTHORS for more information.
|
||||||
*
|
*
|
||||||
* $Id: conn.h,v 1.26 2002/12/18 13:50:22 alex Exp $
|
* $Id: conn.h,v 1.26.2.1 2003/03/09 20:16:46 alex Exp $
|
||||||
*
|
*
|
||||||
* Connection management (header)
|
* Connection management (header)
|
||||||
*/
|
*/
|
||||||
@@ -18,11 +18,13 @@
|
|||||||
#define __conn_h__
|
#define __conn_h__
|
||||||
|
|
||||||
|
|
||||||
#include <time.h> /* wg. time_t, s.u. */
|
#include <time.h> /* fro time_t, see below */
|
||||||
|
|
||||||
|
|
||||||
|
#define CONN_ISCLOSING 1 /* Conn_Close() already called */
|
||||||
|
|
||||||
#ifdef USE_ZLIB
|
#ifdef USE_ZLIB
|
||||||
#define CONN_ZIP 4 /* Kompression mit zlib */
|
#define CONN_ZIP 2 /* zlib compressed link */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user