about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2005-06-12 16:32:17 +0000
committerAlexander Barton <alex@barton.de>2005-06-12 16:32:17 +0000
commit8b0ac2306e798d4f1838dabcc73f867765088f71 (patch)
treee9b1c6e04046187a38473f185bbbf50ce2a75311
parent5195555c5a5d71d5c96b5d543eacb2d1150a68fd (diff)
downloadngircd-8b0ac2306e798d4f1838dabcc73f867765088f71.tar.gz
ngircd-8b0ac2306e798d4f1838dabcc73f867765088f71.zip
Modified Conn_StartTime() to use information of the CLIENT structure.
-rw-r--r--src/ngircd/conn-func.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/ngircd/conn-func.c b/src/ngircd/conn-func.c
index 974c151a..84fe1e4c 100644
--- a/src/ngircd/conn-func.c
+++ b/src/ngircd/conn-func.c
@@ -16,13 +16,14 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: conn-func.c,v 1.5 2005/04/25 18:37:16 fw Exp $";
+static char UNUSED id[] = "$Id: conn-func.c,v 1.6 2005/06/12 16:32:17 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
 #include <log.h>
 
 #include "conn.h"
+#include "client.h"
 
 #include "exp.h"
 #include "conn-func.h"
@@ -157,14 +158,25 @@ Conn_Options( CONN_ID Idx )
 } /* Conn_Options */
 
 
+/**
+ * Get the start time of the connection.
+ * The result is the start time in seconds since 1970-01-01, as reported
+ * by the C function time(NULL).
+ */
 GLOBAL time_t
 Conn_StartTime( CONN_ID Idx )
 {
-	/* Zeitpunkt des Link-Starts liefern (in Sekunden) */
+	CLIENT *c;
 
-	assert( Idx > NONE );
-	return My_Connections[Idx].starttime;
-} /* Conn_Uptime */
+	assert(Idx > NONE);
+
+	/* Search client structure for this link ... */
+	c = Client_GetFromConn(Idx);
+	if(c != NULL)
+		return Client_StartTime(c);
+
+	return 0;
+} /* Conn_StartTime */
 
 
 GLOBAL int