changeset 13279:0c50401679d3

[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: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 13 Feb 2006 22:03:20 +0000
parents c7cf6912c982
children 3de53fe8345f
files src/protocols/jabber/jabber.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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