Skip to content

Fixing the new line bug. #206

Closed
wants to merge 1 commit into from

3 participants

@lan17
lan17 commented Nov 20, 2013

I started using this library to connect to bitlbee via irssi proxy. I found that no events were being emitted after I connected (even though the IRC messages were going back and forth on the socket). After some debugging I found the culprit that you can see in the diff. After the change the events emit just fine and I can use the library.

\r seems to be trimmed anyway from the lines so it should be safe and fine to split only by \n.

@damianb
damianb commented Nov 22, 2013

Bitblee or irssi proxy is the problem, not node-irc. They aren't complying with RFC 1459.

https://tools.ietf.org/html/rfc1459#section-2.3

IRC messages are always lines of characters terminated with a CR-LF
(Carriage Return - Line Feed) pair, and these messages shall not
exceed 512 characters in length, counting all characters including
the trailing CR-LF. Thus, there are 510 characters maximum allowed
for the command and its parameters. There is no provision for
continuation message lines. See section 7 for more details about
current implementations.

Move to close.

@lan17
lan17 commented Nov 23, 2013

Is it ok to make a patch that would support both? I need this library to work with irssi, and both bitlbee and irssi are popular software.

@lan17
lan17 commented Nov 23, 2013

I think a good compromise would be to split by \n then trim \r. That would ensure this library works with non complying irc servers.

@jfhbrook

I'd check to see if irssi fixed this in versions later than the one you're using, and/or if there's an open bug report.

You can also maintain your own fork of node-irc. For your needs, that probably isn't too bad.

Also, keep in mind that this means multi-line irc messages (with only \n and not \r\n) would break.

@damianb
damianb commented Nov 23, 2013

File bugs with bitlbee and/or irssi instead. They're violating the spec - by using newline terminators, they're not providing a true IRC interface. These things are standardized for a reason, and must not be worked around as there will be side effects.

@lan17
lan17 commented Nov 23, 2013

Thank you for feed back. Will complain to irssi/bitlbee after i figure out what is not compliant.

@lan17 lan17 closed this Nov 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.