X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fclient.c;h=bfc3a4f8af43aec4fe0390a9503ba34aecc0846e;hp=bea728b92ab996c1fa913fe6545f0ed01dc11d4c;hb=939767d502c6e9e028c9ef2cfe132dd3bb312c22;hpb=dccb2976785d6ff50a59b1e930a6e2a2b340d498 diff --git a/src/ngircd/client.c b/src/ngircd/client.c index bea728b9..bfc3a4f8 100644 --- a/src/ngircd/client.c +++ b/src/ngircd/client.c @@ -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 @@ -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 ) {