about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2011-03-21 09:42:01 +0100
committerAlexander Barton <alex@barton.de>2011-03-21 09:42:01 +0100
commit62f705f97e580fe61520793b3387081915f240ba (patch)
tree5cc9e14b781c7ed12e21b68e1a64d2132608f052 /src
parenta39e2f22c928a8bd8d16c2e008a62800f6412fe6 (diff)
downloadngircd-62f705f97e580fe61520793b3387081915f240ba.tar.gz
ngircd-62f705f97e580fe61520793b3387081915f240ba.zip
Allow servers to send more commands in the first 10 secods
This helps to speed up server login and network synchronisation.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/conn.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 397bc915..63093c25 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -1629,18 +1629,25 @@ Handle_Buffer(CONN_ID Idx)
 	CLIENT *c;
 
 	c = Conn_GetClient(Idx);
-	assert( c != NULL);
+	starttime = time(NULL);
+
+	assert(c != NULL);
 
 	/* Servers do get special command limits, so they can process
 	 * all the messages that are required while peering. */
 	switch (Client_Type(c)) {
 	    case CLIENT_SERVER:
-		maxcmd = MAX_COMMANDS_SERVER; break;
+		/* Allow servers to send more commands in the first 10 secods
+		 * to speed up server login and network synchronisation. */
+		if (starttime - Client_StartTime(c) < 10)
+			maxcmd = MAX_COMMANDS_SERVER * 5;
+		else
+			maxcmd = MAX_COMMANDS_SERVER;
+		break;
 	    case CLIENT_SERVICE:
 		maxcmd = MAX_COMMANDS_SERVICE; break;
 	}
 
-	starttime = time(NULL);
 	for (i=0; i < maxcmd; i++) {
 		/* Check penalty */
 		if (My_Connections[Idx].delaytime > starttime)