#include "portab.h"
-static char UNUSED id[] = "$Id: client.c,v 1.93 2006/10/07 10:40:52 fw Exp $";
+static char UNUSED id[] = "$Id: client.c,v 1.96 2007/10/25 11:01:19 fw Exp $";
#include "imp.h"
#include <assert.h>
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;
This_Server->hops = 0;
gethostname( This_Server->host, CLIENT_HOST_LEN );
- h = gethostbyname( This_Server->host );
- if( h ) strlcpy( This_Server->host, h->h_name, sizeof( This_Server->host ));
-
+ if (!Conf_NoDNS) {
+ h = gethostbyname( This_Server->host );
+ if (h) strlcpy(This_Server->host, h->h_name, sizeof(This_Server->host));
+ }
Client_SetID( This_Server, Conf_ServerName );
Client_SetInfo( This_Server, Conf_ServerInfo );
} /* 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 )
{
/* Hostname eines Clients setzen */
-
+
assert( Client != NULL );
assert( Hostname != NULL );
-
+
strlcpy( Client->host, Hostname, sizeof( Client->host ));
} /* Client_SetHostname */
Client_User( CLIENT *Client )
{
assert( Client != NULL );
- if( Client->user[0] ) return Client->user;
- else return "~";
+ return Client->user[0] ? Client->user : "~";
} /* Client_User */
Client_MyServerCount( void )
{
CLIENT *c;
- unsigned long cnt;
+ unsigned long cnt = 0;
- cnt = 0;
c = My_Clients;
while( c )
{
Client_OperCount( void )
{
CLIENT *c;
- unsigned long cnt;
+ unsigned long cnt = 0;
- cnt = 0;
c = My_Clients;
while( c )
{