소스 검색

* On hybrid/ratbox servers, burst some commands on connect

Bryan Drewery 16 년 전
부모
커밋
dced750ff7
3개의 변경된 파일19개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 0
      doc/UPDATES
  2. 3 1
      src/mod/server.mod/server.c
  3. 15 2
      src/mod/server.mod/servmsg.c

+ 1 - 0
doc/UPDATES

@@ -1,6 +1,7 @@
 * Speedup irc server queue by bursting more often and fully. Thanks VXP.
 * Add set 'msgrate' to define how often to dequeue to the server. (1 or 2 is good)
 * Add set 'msgburst' to define how many commands to burst to server per msgrate.
+* On hybrid/ratbox servers, burst some commands on connect
 
 1.2.17 - http://wraith.botpack.net/milestone/1.2.17
 * Binary / shell / startup changes

+ 3 - 1
src/mod/server.mod/server.c

@@ -114,6 +114,8 @@ static bool replaying_cache = 0;
 static bind_table_t *BT_raw = NULL, *BT_msg = NULL;
 bind_table_t *BT_ctcr = NULL, *BT_ctcp = NULL, *BT_msgc = NULL;
 
+void deq_msg();
+
 #include "servmsg.c"
 
 #define MAXPENALTY 10
@@ -140,7 +142,7 @@ static int burst;
  * it will *not* send anything from hq until the 'burst' value drops
  * down to 0 again (allowing a sudden mq flood to sneak through).
  */
-static void deq_msg()
+void deq_msg()
 {
   if (serv < 0)
     return;

+ 15 - 2
src/mod/server.mod/servmsg.c

@@ -213,8 +213,6 @@ static int got001(char *from, char *msg)
   rehash_server(from, msg);
   /* Ok...param #1 of 001 = what server thinks my nick is */
 
-  join_chans();
-
 #ifdef no
   if (strcasecmp(from, dcc[servidx].host)) {
     struct server_list *x = serverlist;
@@ -251,10 +249,25 @@ got004(char *from, char *msg)
 
   tmp = newsplit(&msg);
 
+  bool connect_burst = 0;
+
   /* cookies won't work on ircu or Unreal or snircd */
   if (strstr(tmp, "u2.") || strstr(tmp, "Unreeal") || strstr(tmp, "snircd")) {
     putlog(LOG_DEBUG, "*", "Disabling cookies as they are not supported on %s", cursrvname);
     cookies_disabled = true;
+  } else if (strstr(tmp, "hybrid") || strstr(tmp, "ratbox"))
+    connect_burst = 1;
+
+  if (replaying_cache || !connect_burst)
+    join_chans();
+  else {
+    // Hybrid/ratbox allows bursting 5*8 lines on connect until certain commands are sent, for up to 30 seconds
+    int oldburst = msgburst;
+    msgburst = 5 * 8;
+    join_chans();
+    last_time.sec = now - 100;
+    deq_msg();
+    msgburst = oldburst;
   }
 
   return 0;