]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conn-func.c
Ignore unknown commands received before the client is registered.
[ngircd-alex.git] / src / ngircd / conn-func.c
index 61516d68c6f34da4eb0f4d2065a1a40f30e77175..84fe1e4ca929abcc269572a97df9a8c299c76c1d 100644 (file)
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: conn-func.c,v 1.4 2005/03/19 18:43:48 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"
@@ -149,31 +150,6 @@ Conn_Next( CONN_ID Idx )
 } /* Conn_Next */
 
 
-GLOBAL void
-Conn_SetOption( CONN_ID Idx, int Option )
-{
-       /* Option fuer Verbindung setzen.
-        * Initial sind alle Optionen _nicht_ gesetzt. */
-
-       assert( Idx > NONE );
-       assert( Option != 0 );
-
-       My_Connections[Idx].options |= Option;
-} /* Conn_SetOption */
-
-
-GLOBAL void
-Conn_UnsetOption( CONN_ID Idx, int Option )
-{
-       /* Option fuer Verbindung loeschen */
-
-       assert( Idx > NONE );
-       assert( Option != 0 );
-
-       My_Connections[Idx].options &= ~Option;
-} /* Conn_UnsetOption */
-
-
 GLOBAL int
 Conn_Options( CONN_ID Idx )
 {
@@ -182,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