1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-05-25 02:24:08 +00:00

Remove Client_DestroyNow() to keep semantik "every CONNECTON has a CLIENT".

This commit is contained in:
Alexander Barton 2007-01-23 16:07:19 +00:00
parent ea2a4b3370
commit 429f85b77a
3 changed files with 4 additions and 48 deletions

View File

@ -17,7 +17,7 @@
#include "portab.h"
static char UNUSED id[] = "$Id: client.c,v 1.94 2006/12/07 22:24:14 fw Exp $";
static char UNUSED id[] = "$Id: client.c,v 1.95 2007/01/23 16:07:19 alex Exp $";
#include "imp.h"
#include <assert.h>
@ -68,10 +68,6 @@ static CLIENT *Init_New_Client PARAMS((CONN_ID Idx, CLIENT *Introducer,
CLIENT *TopServer, int Type, char *ID, char *User, char *Hostname,
char *Info, int Hops, int Token, char *Modes, bool Idented));
#ifndef Client_DestroyNow
GLOBAL void Client_DestroyNow PARAMS((CLIENT *Client ));
#endif
long Max_Users = 0, My_Max_Users = 0;
@ -336,35 +332,6 @@ Client_Destroy( CLIENT *Client, char *LogMsg, char *FwdMsg, bool 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.45 2006/10/07 10:40:52 fw Exp $
* $Id: client.h,v 1.46 2007/01/23 16:07:19 alex Exp $
*
* Client management (header)
*/
@ -80,9 +80,6 @@ GLOBAL CLIENT *Client_NewRemoteServer PARAMS(( CLIENT *Introducer, char *Hostnam
GLOBAL CLIENT *Client_NewRemoteUser PARAMS(( CLIENT *Introducer, char *Nick, int Hops, char *User, char *Hostname, int Token, char *Modes, char *Info, bool Idented ));
GLOBAL void Client_Destroy PARAMS(( CLIENT *Client, char *LogMsg, char *FwdMsg, bool SendQuit ));
#ifdef CONN_MODULE
GLOBAL void Client_DestroyNow PARAMS(( CLIENT *Client ));
#endif
GLOBAL CLIENT *Client_ThisServer PARAMS(( void ));

View File

@ -17,7 +17,7 @@
#include "portab.h"
#include "io.h"
static char UNUSED id[] = "$Id: conn.c,v 1.201 2006/12/25 01:11:12 fw Exp $";
static char UNUSED id[] = "$Id: conn.c,v 1.202 2007/01/23 16:07:19 alex Exp $";
#include "imp.h"
#include <assert.h>
@ -123,7 +123,6 @@ cb_connserver(int sock, UNUSED short what)
{
int res, err;
socklen_t sock_len;
CLIENT *c;
CONN_ID idx = Socket2Index( sock );
if (idx <= NONE) {
LogDebug("cb_connserver wants to write on unknown socket?!");
@ -150,14 +149,7 @@ cb_connserver(int sock, UNUSED short what)
Conf_Server[Conf_GetServer(idx)].port,
idx, strerror(err));
/* Clean up the CLIENT structure (to avoid silly log
* messages) and call Conn_Close() to do the rest. */
c = Conn_GetClient(idx);
if (c)
Client_DestroyNow(c);
Conn_Close(idx, "Can't connect!", NULL, false);
Conn_Close(idx, "Can't connect!", NULL, false);
return;
}