#include "portab.h"
-static char UNUSED id[] = "$Id: client.c,v 1.87 2006/03/11 01:37:31 alex Exp $";
+static char UNUSED id[] = "$Id: client.c,v 1.90 2006/03/24 23:25:38 fw Exp $";
#include "imp.h"
#include <assert.h>
{
if( c->id[0] ) Log( LOG_NOTICE, "Client \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt );
else Log( LOG_NOTICE, "Client unregistered (connection %d): %s", c->conn_id, txt );
- }
- else
- {
- if( c->id[0] ) Log( LOG_WARNING, "Unregistered unknown client \"%s\": %s", c->id, txt );
- else Log( LOG_WARNING, "Unregistered unknown client: %s", c->id, txt );
+ } else {
+ Log(LOG_WARNING, "Unregistered unknown client \"%s\": %s",
+ c->id[0] ? c->id : "(No Nick)", txt );
}
}
GLOBAL CLIENT *
Client_GetFromConn( CONN_ID Idx )
{
- /* return Client-Structure that belongs to the local Connection Idx gehoert.
+ /* return Client-Structure that belongs to the local Connection Idx.
* If none is found, return NULL.
*/
Client_RegisterWhowas( CLIENT *Client )
{
int slot;
+ time_t now;
assert( Client != NULL );
+ now = time(NULL);
/* Don't register clients that were connected less than 30 seconds. */
- if( time(NULL) - Client->starttime < 30 )
+ if( now - Client->starttime < 30 )
return;
slot = Last_Whowas + 1;
Log( LOG_DEBUG, "Saving WHOWAS information to slot %d ...", slot );
#endif
- My_Whowas[slot].time = time( NULL );
+ My_Whowas[slot].time = now;
strlcpy( My_Whowas[slot].id, Client_ID( Client ),
sizeof( My_Whowas[slot].id ));
strlcpy( My_Whowas[slot].user, Client_User( Client ),