push_read line does not work as expected with line ending of "\015\015\012"

Lee Aylward lee at laylward.com
Wed Sep 29 02:48:25 CEST 2010


Hi,

I am trying to read from to an IRC server that has an extra carriage return on their MOTD lines (e.g. "\015\015\012"). I assume this was caused by someone pasting text from a Windows editor or something.

This is wreaking havoc with AE::Handle's line based read type. I realize that this could be fixed by providing a custom $eol argument to the push_read function (something like qr{\015?\015?\012}), but maybe this is worth solving in AE::Handle instead of adding a custom kludge to my local AE::IRC?

After some testing it looks like this could be fixed by changing the line read_type from:

    /^([^\015\012]*)(\015?\012)/

to:

    /^([^\012]*)(\015?\012)/

Maybe there is a reason for the \015 in there that I am missing, in which case I'll stick with the custom $eol argument.

Thanks,
-- 
Lee






More information about the anyevent mailing list