]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn.c
New function Conn_UpdatePing() to update the "ping timestamp"
[ngircd-alex.git] / src / ngircd / conn.c
index 40a2af6e17f5b10f24467833b0f8ac4c9043020b..f743d1f81b2331a81a3cbcc6bbbf9ca99b645b58 100644 (file)
@@ -1226,6 +1226,20 @@ Conn_SyncServerStruct(void)
 } /* SyncServerStruct */
 
 
+/**
+ * Get IP address string of a connection.
+ *
+ * @param Idx Connection index.
+ * @return Pointer to a global buffer containing the IP address as string.
+ */
+GLOBAL const char *
+Conn_GetIPAInfo(CONN_ID Idx)
+{
+       assert(Idx > NONE);
+       return ng_ipaddr_tostr(&My_Connections[Idx].addr);
+}
+
+
 /**
  * Send out data of write buffer; connect new sockets.
  *
@@ -1836,7 +1850,7 @@ Check_Connections(void)
                                   time(NULL) - Conf_PingTimeout) {
                                /* We need to send a PING ... */
                                LogDebug("Connection %d: sending PING ...", i);
-                               My_Connections[i].lastping = time(NULL);
+                               Conn_UpdatePing(i);
                                Conn_WriteStr(i, "PING :%s",
                                              Client_ID(Client_ThisServer()));
                        }