changeset 12752:91424393b70b

[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 <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sat, 07 Jan 2006 16:32:18 +0000
parents 038f92bd20b6
children ddae10386677
files src/protocols/irc/irc.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);