Complain to the client when it sends a line that is too long.
authorMichael Poole <mdpoole@troilus.org>
Tue, 29 May 2007 03:08:34 +0000 (03:08 +0000)
committerMichael Poole <mdpoole@troilus.org>
Tue, 29 May 2007 03:08:34 +0000 (03:08 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1815 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/numeric.h
ircd/s_bsd.c
ircd/s_err.c

index e1c088f13e154e6d72dd8220326149c5a514fc24..40c804f54e5af1764cc0ea8ffb3791745adc957c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-05-28  Michael Poole <mdpoole@troilus.org>
+
+       * include/numeric.h (ERR_INPUTTOOLONG): New numeric.
+
+       * ircd/s_bsd.c (read_packet): Use it.
+
+       * ircd/s_err.c (replyTable): Give it a format string.
+
 2007-05-20  Michael Poole <mdpoole@troilus.org>
 
        * ircd/m_burst.c (ms_burst): Do not let bursting servers join a
index 26fbfb9256caf7ab46c45d7b18bb5f52b0a5b561..48df5b2205b4bacaca03aaf4df4f79d86a24c957 100644 (file)
@@ -336,6 +336,7 @@ extern const struct Numeric* get_error_numeric(int err);
      /* ERR_BADMASK          415           IRCnet extension */
 #define ERR_QUERYTOOLONG     416        /* Undernet extension */
      /* ERR_TOOMANYMATCHES   416           IRCnet extension */
+#define ERR_INPUTTOOLONG     417
 /*      ERR_LENGTHTRUNCATED  419           aircd */
 
 #define ERR_UNKNOWNCOMMAND   421
index 3989ca0efa1acc021c27a7ed507d0a5ac5058290..ab7d2616b05218c63c08498cf009e7af84d9154b 100644 (file)
@@ -635,7 +635,13 @@ static int read_packet(struct Client *cptr, int socket_ready)
         if (DBufLength(&(cli_recvQ(cptr))) < 510)
           SetFlag(cptr, FLAG_NONL);
         else
+        {
+          /* More than 512 bytes in the line - drop the input and yell
+           * at the client.
+           */
           DBufClear(&(cli_recvQ(cptr)));
+          send_reply(cptr, ERR_INPUTTOOLONG);
+        }
       }
       else if (client_dopacket(cptr, dolen) == CPTR_KILLED)
         return CPTR_KILLED;
index a7c0236fe0bc404237d551a07d1e9e0ae94deee9..b86224f901c28690ca3cd1d6c10434da80ddda8c 100644 (file)
@@ -866,7 +866,7 @@ static Numeric replyTable[] = {
 /* 416 */
   { ERR_QUERYTOOLONG, "%s :Too many lines in the output, restrict your query", "416" },
 /* 417 */
-  { 0 },
+  { ERR_INPUTTOOLONG, ":Input line was too long", "417" },
 /* 418 */
   { 0 },
 /* 419 */