diff plugins/ssl/ssl-gnutls.c @ 7834:99ffabc6ce73

[gaim-migrate @ 8487] This patch from Mike Hearn should fix HTTP proxy support for MSN, and provides another step toward the MSN HTTP access method working. The HTTP proxy may need testing from other people, but looks like it shouldn't give any problems. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 12 Dec 2003 00:14:40 +0000
parents ea2d07ad05a9
children 01e6e9c46a01
line wrap: on
line diff
--- a/plugins/ssl/ssl-gnutls.c	Thu Dec 11 19:28:00 2003 +0000
+++ b/plugins/ssl/ssl-gnutls.c	Fri Dec 12 00:14:40 2003 +0000
@@ -88,7 +88,14 @@
 	gnutls_transport_set_ptr(gnutls_data->session, GINT_TO_POINTER(source));
 
 	gaim_debug_info("gnutls", "Handshaking\n");
-	ret = gnutls_handshake(gnutls_data->session);
+
+	do
+	{
+		ret = gnutls_handshake(gnutls_data->session);
+	}
+	while ((ret == GNUTLS_E_AGAIN) || (ret == GNUTLS_E_INTERRUPTED));
+
+	gaim_debug_info("gnutls", "Handshake complete\n");
 
 	if (ret < 0)
 	{
@@ -127,10 +134,17 @@
 	GaimSslGnutlsData *gnutls_data = GAIM_SSL_GNUTLS_DATA(gsc);
 	int s;
 
-	s = gnutls_record_recv(gnutls_data->session, data, len);
+	do
+	{
+		s = gnutls_record_recv(gnutls_data->session, data, len);
+	}
+	while ((s == GNUTLS_E_AGAIN) || (s == GNUTLS_E_INTERRUPTED));
 
 	if (s < 0)
+	{
+		gaim_debug_error("gnutls", "receive failed: %d\n", s);
 		s = 0;
+	}
 
 	return s;
 }