[gaim-migrate @ 15645]

Mon, 13 Feb 2006 22:03:20 +0000

author
Greg Hudson <ghudson@mit.edu>
date
Mon, 13 Feb 2006 22:03:20 +0000
changeset 13280
8d45d67480e6
parent 13279
546db3a422a4
child 13281
3558cb15ebb9

[gaim-migrate @ 15645]
This is Greg Hudson's original fix to read the entire waiting ssl buffer so that we don't get stuck in a situation where the input function isn't triggered and there is still data that could be read. This is bug #1048535.

committer: Daniel Atallah <datallah@pidgin.im>

src/protocols/jabber/jabber.c file | annotate | diff | comparison | revisions
--- a/src/protocols/jabber/jabber.c	Mon Feb 13 21:34:34 2006 +0000
+++ b/src/protocols/jabber/jabber.c	Mon Feb 13 22:03:20 2006 +0000
@@ -343,15 +343,16 @@
 		return;
 	}
 
-	if((len = gaim_ssl_read(gsc, buf, sizeof(buf) - 1)) > 0) {
+	while((len = gaim_ssl_read(gsc, buf, sizeof(buf) - 1)) > 0) {
 		buf[len] = '\0';
 		gaim_debug(GAIM_DEBUG_INFO, "jabber", "Recv (ssl)(%d): %s\n", len, buf);
 		jabber_parser_process(js, buf, len);
-	} else if(errno == EAGAIN)
+	}
+
+	if(errno == EAGAIN)
 		return;
-	else {
+	else
 		gaim_connection_error(gc, _("Read Error"));
-	}
 }
 
 static void

mercurial