# HG changeset patch # User Tim Ringenbach # Date 1136651538 0 # Node ID 91424393b70b6857ca0ebee8bafd86f4dee3a59a # Parent 038f92bd20b66725f3574bf4158763364ac383f6 [gaim-migrate @ 15099] This should work around a bug where receiving a null byte over irc would basicly make gaim ignore all further input on that irc connection, eventually resulting in a ping timeout. Since you can't see null bytes, This was actually pretty weird and confusing. Of course, IRC should never send a client a null byte. But we're doing some odd things with irc at work, so... committer: Tailor Script diff -r 038f92bd20b6 -r 91424393b70b src/protocols/irc/irc.c --- a/src/protocols/irc/irc.c Sat Jan 07 08:16:44 2006 +0000 +++ b/src/protocols/irc/irc.c Sat Jan 07 16:32:18 2006 +0000 @@ -488,6 +488,13 @@ irc->inbuf[irc->inbufused] = '\0'; cur = irc->inbuf; + + /* This is a hack to work around the fact that marv gets messages + * with null bytes in them while using some weird irc server at work + */ + while ((cur < (irc->inbuf + irc->inbufused)) && !*cur) + cur++; + while (cur < irc->inbuf + irc->inbufused && ((end = strstr(cur, "\r\n")) || (end = strstr(cur, "\n")))) { int step = (*end == '\r' ? 2 : 1);