]> jfr.im git - irc/ircd-hybrid/bopm.git/commitdiff
scan.c/options.h: Added MAXREAD (default 4096), max amount of bytes read from
authorstrtok <redacted>
Thu, 25 Apr 2002 04:41:30 +0000 (04:41 +0000)
committerstrtok <redacted>
Thu, 25 Apr 2002 04:41:30 +0000 (04:41 +0000)
         any port before the connection is considered a flood and failed.

options.h
scan.c

index 763445b6d1087c55e96df0a5a3e340a5528f8d85..d298eef34e7e8e62e24b6ca6346ef346f9fea1db 100644 (file)
--- a/options.h
+++ b/options.h
  * Increase as needed, but should never need to be be over 512 bytes */
 
 #define SCANBUFFER 128
+
+/* Max data to read from any port before closing the connection
+ * (to avoid flood attempts)
+ */
+#define MAXREAD 4096
      
 #endif /* OPTIONS_H */
diff --git a/scan.c b/scan.c
index a047cf8e01e0e3a381febf63d3008cd86d510bb8..1bc8fff457459e3903b60357daf749ba17c055c4 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -446,7 +446,7 @@ void scan_readready(scan_struct *conn)
                                continue;
                            }
                           /* Avoid freezing from reading endless data */
-                          if(conn->datasize >= SCANBUFFER)
+                          if(conn->bytes_read >= MAXREAD)
                            {
                                conn->state = STATE_CLOSED;
                                return;