X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fconn-func.c;h=c14a56ae2a28fe60f1549fd5b82ce851ebdfe191;hp=4a2d32d6a70bcb270981da9b671acc99c6630df3;hb=HEAD;hpb=79a917f954bef8089967786bd3597a6e5ff5c336 diff --git a/src/ngircd/conn-func.c b/src/ngircd/conn-func.c index 4a2d32d6..c14a56ae 100644 --- a/src/ngircd/conn-func.c +++ b/src/ngircd/conn-func.c @@ -21,11 +21,8 @@ #include #include -#ifdef DEBUG -# include "log.h" -#endif +#include "log.h" #include "conn.h" - #include "conf.h" #include "conn-func.h" @@ -45,13 +42,17 @@ Conn_UpdateIdle(CONN_ID Idx) /** * Update "ping timestamp", the time of the last outgoing PING request. * + * the value 0 signals a newly connected client including servers during the + * initial "server burst"; and 1 means that no PONG is pending for a PING. + * * @param Idx Connection index. + * @param TimeStamp 0, 1, or time stamp. */ GLOBAL void -Conn_UpdatePing(CONN_ID Idx) +Conn_UpdatePing(CONN_ID Idx, time_t TimeStamp) { assert(Idx > NONE); - My_Connections[Idx].lastping = My_Connections[Idx].lastdata = time(NULL); + My_Connections[Idx].lastping = TimeStamp; } /* @@ -67,7 +68,7 @@ Conn_GetSignon(CONN_ID Idx) GLOBAL time_t Conn_GetIdle( CONN_ID Idx ) { - /* Return Idle-Timer of a connetion */ + /* Return Idle-Timer of a connection */ assert( Idx > NONE ); return time( NULL ) - My_Connections[Idx].lastprivmsg; } /* Conn_GetIdle */ @@ -112,13 +113,10 @@ Conn_SetPenalty(CONN_ID Idx, time_t Seconds) My_Connections[Idx].delaytime += Seconds; -#ifdef DEBUG - Log(LOG_DEBUG, - "Add penalty time on connection %d: %ld second%s, total %ld second%s.", + LogDebug("Add penalty time on connection %d: %ld second%s, total %ld second%s.", Idx, (long)Seconds, Seconds != 1 ? "s" : "", My_Connections[Idx].delaytime - t, My_Connections[Idx].delaytime - t != 1 ? "s" : ""); -#endif } /* Conn_SetPenalty */ GLOBAL void