- New function Client_DestroyNow().

This commit is contained in:
Alexander Barton 2003-01-15 14:28:25 +00:00
parent dccb297678
commit 939767d502
2 changed files with 98 additions and 62 deletions

View File

@ -17,7 +17,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: client.c,v 1.72 2003/01/08 22:03:21 alex Exp $";
static char UNUSED id[] = "$Id: client.c,v 1.73 2003/01/15 14:28:25 alex Exp $";
#include "imp.h"
#include <assert.h>
@ -59,6 +59,10 @@ LOCAL CLIENT *New_Client_Struct PARAMS(( VOID ));
LOCAL VOID Generate_MyToken PARAMS(( CLIENT *Client ));
LOCAL VOID Adjust_Counters PARAMS(( CLIENT *Client ));
#ifndef Client_DestroyNow
GLOBAL VOID Client_DestroyNow PARAMS((CLIENT *Client ));
#endif
LONG Max_Users = 0, My_Max_Users = 0;
@ -292,6 +296,35 @@ Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit )
} /* Client_Destroy */
GLOBAL VOID
Client_DestroyNow( CLIENT *Client )
{
/* Destroy client structure immediately. This function is only
* intended for the connection layer to remove client structures
* of connections that can't be established! */
CLIENT *last, *c;
assert( Client != NULL );
last = NULL;
c = My_Clients;
while( c )
{
if( c == Client )
{
/* Wir haben den Client gefunden: entfernen */
if( last ) last->next = c->next;
else My_Clients = (CLIENT *)c->next;
free( c );
break;
}
last = c;
c = (CLIENT *)c->next;
}
} /* Client_DestroyNow */
GLOBAL VOID
Client_SetHostname( CLIENT *Client, CHAR *Hostname )
{

View File

@ -8,7 +8,7 @@
* (at your option) any later version.
* Please read the file COPYING, README and AUTHORS for more information.
*
* $Id: client.h,v 1.33 2002/12/22 23:29:09 alex Exp $
* $Id: client.h,v 1.34 2003/01/15 14:28:25 alex Exp $
*
* Client management (header)
*/
@ -71,6 +71,9 @@ GLOBAL CLIENT *Client_NewRemoteUser PARAMS((CLIENT *Introducer, CHAR *Nick, INT
GLOBAL CLIENT *Client_New PARAMS(( CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes, BOOLEAN Idented ));
GLOBAL VOID Client_Destroy PARAMS(( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN SendQuit ));
#ifdef CONN_MODULE
GLOBAL VOID Client_DestroyNow PARAMS(( CLIENT *Client ));
#endif
GLOBAL CLIENT *Client_ThisServer PARAMS(( VOID ));