X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fconn-func.c;h=b56e0f0742fb5298f5d53bac0583c40a52b02873;hb=a98bbc8e0b937f4fedf7ad852eaf109c6a9c5b8f;hp=32001f08d93c97bb3ee454c7564ae1ef0b43b184;hpb=b24d645ca183194b0158cd7bba1e0c1f468a7de9;p=ngircd-alex.git diff --git a/src/ngircd/conn-func.c b/src/ngircd/conn-func.c index 32001f08..b56e0f07 100644 --- a/src/ngircd/conn-func.c +++ b/src/ngircd/conn-func.c @@ -30,13 +30,30 @@ #include "conn-func.h" +/** + * Update "idle timestamp", the time of the last visible user action + * (e. g. like sending messages, joining or leaving channels). + * + * @param Idx Connection index. + */ GLOBAL void -Conn_UpdateIdle( CONN_ID Idx ) +Conn_UpdateIdle(CONN_ID Idx) { - assert( Idx > NONE ); - My_Connections[Idx].lastprivmsg = time( NULL ); + assert(Idx > NONE); + My_Connections[Idx].lastprivmsg = time(NULL); } +/** + * Update "ping timestamp", the time of the last outgoing PING request. + * + * @param Idx Connection index. + */ +GLOBAL void +Conn_UpdatePing(CONN_ID Idx) +{ + assert(Idx > NONE); + My_Connections[Idx].lastping = time(NULL); +} /* * Get signon time of a connection. @@ -100,24 +117,6 @@ Conn_SetPenalty(CONN_ID Idx, time_t Seconds) } /* Conn_SetPenalty */ -/** - * Reset the "penalty time" for one connection. - * - * @param Idx Connection index. - * @see Conn_SetPenalty - */ -GLOBAL void -Conn_ResetPenalty(CONN_ID Idx) -{ - assert(Idx > NONE); - - My_Connections[Idx].delaytime = 0; -#ifdef DEBUG - Log(LOG_DEBUG, "Penalty time on connection %d has been reset."); -#endif -} /* Conn_ResetPenalty */ - - GLOBAL void Conn_ClearFlags( void ) { @@ -138,8 +137,6 @@ Conn_Flag( CONN_ID Idx ) GLOBAL void Conn_SetFlag( CONN_ID Idx, int Flag ) { - /* Connection markieren */ - assert( Idx > NONE ); My_Connections[Idx].flag = Flag; } /* Conn_SetFlag */ @@ -148,9 +145,6 @@ Conn_SetFlag( CONN_ID Idx, int Flag ) GLOBAL CONN_ID Conn_First( void ) { - /* Connection-Struktur der ersten Verbindung liefern; - * Ist keine Verbindung vorhanden, wird NONE geliefert. */ - CONN_ID i; for( i = 0; i < Pool_Size; i++ ) @@ -164,9 +158,6 @@ Conn_First( void ) GLOBAL CONN_ID Conn_Next( CONN_ID Idx ) { - /* Naechste Verbindungs-Struktur liefern; existiert keine - * weitere, so wird NONE geliefert. */ - CONN_ID i = NONE; assert( Idx > NONE );