about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2005-06-12 16:39:42 +0000
committerAlexander Barton <alex@barton.de>2005-06-12 16:39:42 +0000
commit5c20474fdb245df8c4a01b3aa59628b06712e89b (patch)
tree6946602b6907c5a2eb4e33217782626c78436895
parent8b0ac2306e798d4f1838dabcc73f867765088f71 (diff)
downloadngircd-5c20474fdb245df8c4a01b3aa59628b06712e89b.tar.gz
ngircd-5c20474fdb245df8c4a01b3aa59628b06712e89b.zip
Only register clients that have been connected at least 30 sec. in WHOIS database.
-rw-r--r--src/ngircd/client.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ngircd/client.c b/src/ngircd/client.c
index e2d477f8..2a7f10ba 100644
--- a/src/ngircd/client.c
+++ b/src/ngircd/client.c
@@ -17,7 +17,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: client.c,v 1.83 2005/06/12 16:18:49 alex Exp $";
+static char UNUSED id[] = "$Id: client.c,v 1.84 2005/06/12 16:39:42 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -1142,6 +1142,9 @@ Adjust_Counters( CLIENT *Client )
 
 /**
  * Register client in My_Whowas structure for further recall by WHOWAS.
+ * Note: Only clients that have been connected at least 30 seconds will be
+ * registered to prevent automated IRC bots to "destroy" a nice server
+ * history database.
  */
 GLOBAL void
 Client_RegisterWhowas( CLIENT *Client )
@@ -1150,6 +1153,10 @@ Client_RegisterWhowas( CLIENT *Client )
 	
 	assert( Client != NULL );
 
+	/* Don't register clients that were connected less than 30 seconds. */
+	if( time(NULL) - Client->starttime < 30 )
+		return;
+
 	slot = Last_Whowas + 1;
 	if( slot >= MAX_WHOWAS || slot < 0 ) slot = 0;