Просмотр исходного кода

CPRIVMSG/CNOTICE/TIME/TOPIC/OPER should end connection bursting on ratbox.

src/packet.c flood_endgrace()
Bryan Drewery 7 лет назад
Родитель
Сommit
b0f1786f4c
2 измененных файлов с 10 добавлено и 3 удалено
  1. 1 0
      doc/UPDATES.md
  2. 9 3
      src/mod/server.mod/server.cc

+ 1 - 0
doc/UPDATES.md

@@ -10,6 +10,7 @@
   * Add 'chanset homechan-user [nothing/voice/op]' to auto-voice or auto-op
   * Add 'chanset homechan-user [nothing/voice/op]' to auto-voice or auto-op
     clients who are opped in 'set homechan'.
     clients who are opped in 'set homechan'.
   * Some small performance improvements.
   * Some small performance improvements.
+  * CPRIVMSG/CNOTICE/TIME/TOPIC/OPER should end connection bursting on ratbox.
 
 
 # maint
 # maint
   * Clear FiSH keys when a client quits.
   * Clear FiSH keys when a client quits.

+ 9 - 3
src/mod/server.mod/server.cc

@@ -184,11 +184,10 @@ burst_mode_ok(const char *msg, size_t len) {
   return 0;
   return 0;
 }
 }
 
 
-// Hybrid/ratbox allows bursting 5*8 lines on connect until certain commands are sent, for up to 30 seconds
+// Hybrid/ratbox allows bursting MAX_FLOOD_BURST=5(MAX_FLOOD)*8 lines on connect until certain commands are sent, for up to 30 seconds
 /*
 /*
-   BAD:
+   BAD (src/packet.c flood_endgrace()):
      JOIN 0
      JOIN 0
-     MODE #chan b
      NICK
      NICK
      PART
      PART
      KICK
      KICK
@@ -206,6 +205,8 @@ burst_mode_ok(const char *msg, size_t len) {
      WHO !
      WHO !
      WHO #Chan
      WHO #Chan
      WHO NICK
      WHO NICK
+     MODE #chan
+     MODE #chan b
 */
 */
 static inline bool
 static inline bool
 __attribute__((pure))
 __attribute__((pure))
@@ -213,10 +214,15 @@ burst_ok(const char* msg, size_t len) {
   if (strstr(msg, "JOIN 0") ||
   if (strstr(msg, "JOIN 0") ||
       (strstr(msg, "MODE") && !burst_mode_ok(msg, len)) ||
       (strstr(msg, "MODE") && !burst_mode_ok(msg, len)) ||
       strstr(msg, "NICK") ||
       strstr(msg, "NICK") ||
+      strstr(msg, "CPRIVMSG") ||
       strstr(msg, "PRIVMSG") ||
       strstr(msg, "PRIVMSG") ||
+      strstr(msg, "CNOTICE") ||
       strstr(msg, "NOTICE") ||
       strstr(msg, "NOTICE") ||
       strstr(msg, "PART") ||
       strstr(msg, "PART") ||
       strstr(msg, "KICK") ||
       strstr(msg, "KICK") ||
+      strstr(msg, "TIME") ||
+      strstr(msg, "OPER") ||
+      strstr(msg, "TOPIC") ||
       strstr(msg, "INVITE") ||
       strstr(msg, "INVITE") ||
       strstr(msg, "AWAY")) {
       strstr(msg, "AWAY")) {
     return 0;
     return 0;