#include "portab.h"
-static char UNUSED id[] = "$Id: client.c,v 1.71 2002/12/26 17:14:48 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>
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;
} /* 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 )
{
GLOBAL VOID
Client_SetAway( CLIENT *Client, CHAR *Txt )
{
- /* Von einem Client gelieferte AWAY-Nachricht */
+ /* Set AWAY reason of client */
assert( Client != NULL );
+ assert( Txt != NULL );
- if( Txt )
- {
- /* Client AWAY setzen */
- strlcpy( Client->away, Txt, sizeof( Client->away ));
- Client_ModeAdd( Client, 'a' );
- Log( LOG_DEBUG, "User \"%s\" is away: %s", Client_Mask( Client ), Txt );
- }
- else
- {
- /* AWAY loeschen */
- Client_ModeDel( Client, 'a' );
- Log( LOG_DEBUG, "User \"%s\" is no longer away.", Client_Mask( Client ));
- }
+ strlcpy( Client->away, Txt, sizeof( Client->away ));
+ Log( LOG_DEBUG, "User \"%s\" is away: %s", Client_Mask( Client ), Txt );
} /* Client_SetAway */