repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 429f85b77a203bb367a2e5ed2244e7c200db0295:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 429f85b77a203bb367a2e5ed2244e7c200db0295
Author: Alexander Barton 
Date:   Tue Jan 23 16:07:19 2007 +0000

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

diff --git a/src/ngircd/client.c b/src/ngircd/client.c
index ce97c1eeb797cdf7e3f190c8db4059dece02f44c..
index ..1e35fd81dc64994cfd7694e8d756d5a954352850 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.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 
@@ -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 )
 {
diff --git a/src/ngircd/client.h b/src/ngircd/client.h
index 0de367956bd8c5ebfb93b800d2c19a6583db6b58..
index ..d211d23e11a24e7367fee37b382089615c568dc3 100644
--- a/src/ngircd/client.h
+++ b/src/ngircd/client.h
@@ -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 ));

diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 60128eae429d3439025dc7d558485c9a8be9ae23..
index ..4a55bd2a0ffbec7b3af5c62663623bbbf731c8d6 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -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 
@@ -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;
 	}

-----END OF PAGE-----