소스 검색

* Add set 'msgburst' to define how many commands to burst to server per msgrate.

Bryan Drewery 16 년 전
부모
커밋
bfbc8f544d
5개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 0
      doc/UPDATES
  2. 1 0
      doc/help.txt
  3. 1 1
      src/mod/server.mod/server.c
  4. 3 1
      src/set.c
  5. 1 1
      src/set.h

+ 1 - 0
doc/UPDATES

@@ -1,5 +1,6 @@
 * 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.
 
 1.2.17 - http://wraith.botpack.net/milestone/1.2.17
 * Binary / shell / startup changes

+ 1 - 0
doc/help.txt

@@ -1595,6 +1595,7 @@ See also: reload, backup
  
 [L]  $bservers$b         Comma-separated list of servers the bot will use.
 [L]  $bservers6$b        Comma-separated list of servers the bot will use (FOR IPv6).
+[N]  $bmsgburst$b        How many messages to burst at once to server. (Too high will excess flood)
 [N]  $bmsgrate$b         How often (seconds) to dequeue msgs to the server. (1 or 2 is good)
 
 [L]  $brbl-servers$b     Servers to use for RBL checking in channels that are +rbl.

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

@@ -170,7 +170,7 @@ static void deq_msg()
    */
   bool nm = 0;
   for(size_t nq = 0; nq < (sizeof(qdsc) / sizeof(qdsc[0])); ++nq) {
-    while (qdsc[nq].q->head && (burst < 4) && ((last_time - now) < MAXPENALTY)) {
+    while (qdsc[nq].q->head && (burst < msgburst) && ((last_time - now) < MAXPENALTY)) {
 #ifdef not_implemented
       if (deq_kick(qdsc[nq].idx)) {
         ++burst;

+ 3 - 1
src/set.c

@@ -55,7 +55,8 @@ int login;
  * lower this value at your own risk.  ircd is known to start flood control
  * at 512 bytes/2 seconds.
  */
-int msgrate = 1;
+int msgburst;
+int msgrate;
 char motd[512] = "";
 char msgident[21] = "";
 char msginvite[21] = "";
@@ -104,6 +105,7 @@ static variable_t vars[] = {
  VAR("msg-invite",	msginvite,		VAR_WORD|VAR_NOLHUB,				0, 0, NULL),
  VAR("msg-op",		msgop,			VAR_WORD|VAR_NOLHUB,				0, 0, NULL),
  VAR("msg-pass",	msgpass,		VAR_WORD|VAR_NOLHUB,				0, 0, NULL),
+ VAR("msgburst",	&msgburst,		VAR_INT|VAR_NOLHUB,				1, 90, "4"),
  VAR("msgrate",		&msgrate,		VAR_INT|VAR_NOLHUB,				0, 90, "2"),
  VAR("nick",		origbotname,		VAR_WORD|VAR_NOHUB|VAR_NICK|VAR_NODEF,	0, 0, NULL),
  VAR("notify-time",	&ison_time,		VAR_INT|VAR_NOLHUB,				1, 30, "10"),

+ 1 - 1
src/set.h

@@ -73,7 +73,7 @@ extern char		auth_key[], auth_prefix[2], motd[], alias[], rbl_servers[1024],
 extern bool		dccauth, auth_obscure, manop_warn, auth_chan, oidentd, ident_botnick, irc_autoaway, link_cleartext;
 extern int		cloak_script, fight_threshold, fork_interval, in_bots, set_noshare, dcc_autoaway,
 			kill_threshold, lag_threshold, op_bots, hijack, login, promisc, trace,
-                        ison_time, msgrate;
+                        ison_time, msgrate, msgburst;
 extern rate_t		op_requests, close_threshold;
 
 namespace bd {