Split long PRIVMSG and NOTICE commands into multiple messages to avoid truncation
authorJack Allnutt <m2ys4u@gmail.com>
Wed, 16 Jan 2013 11:19:13 +0000 (11:19 +0000)
committerJack Allnutt <m2ys4u@gmail.com>
Wed, 16 Jan 2013 11:19:13 +0000 (11:19 +0000)
commit5328acca519c0404c7b48cf2c9430c19d775184b
tree74a05aa5d287fc6d797723f3e3bf67681bbeabda
parentdb8af19dae9b6e6f40fa470c325ad0257896e471
Split long PRIVMSG and NOTICE commands into multiple messages to avoid truncation

RFC1459 specifies that each IRC command has a character limit of 512 characters, including the trailing
CRLF meaning that the entire command (including the verb [e.g. PRIVMSG] and target [e.g. #kiwiirc]) must
fit in 510 characters.

The limit is applied to both client -> IRCd and IRCd -> client messages, so we must be conservative and
leave room for the sender's prefix to ensure that the message is not truncated when the IRCd sends the
message to the target(s).

For this reason, I have chosen 350 characters as the break point.
server/clientcommands.js