mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	New function Conn_UpdatePing() to update the "ping timestamp"
This commit is contained in:
		| @@ -43,6 +43,17 @@ Conn_UpdateIdle(CONN_ID Idx) | |||||||
| 	My_Connections[Idx].lastprivmsg = time(NULL); | 	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. |  * Get signon time of a connection. | ||||||
|   | |||||||
| @@ -29,7 +29,9 @@ | |||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  |  | ||||||
| GLOBAL void Conn_UpdateIdle PARAMS(( CONN_ID Idx )); | GLOBAL void Conn_UpdateIdle PARAMS((CONN_ID Idx)); | ||||||
|  | GLOBAL void Conn_UpdatePing PARAMS((CONN_ID Idx)); | ||||||
|  |  | ||||||
| GLOBAL time_t Conn_GetSignon PARAMS((CONN_ID Idx)); | GLOBAL time_t Conn_GetSignon PARAMS((CONN_ID Idx)); | ||||||
| GLOBAL time_t Conn_GetIdle PARAMS(( CONN_ID Idx )); | GLOBAL time_t Conn_GetIdle PARAMS(( CONN_ID Idx )); | ||||||
| GLOBAL time_t Conn_LastPing PARAMS(( CONN_ID Idx )); | GLOBAL time_t Conn_LastPing PARAMS(( CONN_ID Idx )); | ||||||
|   | |||||||
| @@ -1850,7 +1850,7 @@ Check_Connections(void) | |||||||
| 				   time(NULL) - Conf_PingTimeout) { | 				   time(NULL) - Conf_PingTimeout) { | ||||||
| 				/* We need to send a PING ... */ | 				/* We need to send a PING ... */ | ||||||
| 				LogDebug("Connection %d: sending PING ...", i); | 				LogDebug("Connection %d: sending PING ...", i); | ||||||
| 				My_Connections[i].lastping = time(NULL); | 				Conn_UpdatePing(i); | ||||||
| 				Conn_WriteStr(i, "PING :%s", | 				Conn_WriteStr(i, "PING :%s", | ||||||
| 					      Client_ID(Client_ThisServer())); | 					      Client_ID(Client_ThisServer())); | ||||||
| 			} | 			} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Alexander Barton
					Alexander Barton