comparison 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
comparison
equal deleted inserted replaced
7833:ecb31b5d728d 7834:99ffabc6ce73
86 xcred); 86 xcred);
87 87
88 gnutls_transport_set_ptr(gnutls_data->session, GINT_TO_POINTER(source)); 88 gnutls_transport_set_ptr(gnutls_data->session, GINT_TO_POINTER(source));
89 89
90 gaim_debug_info("gnutls", "Handshaking\n"); 90 gaim_debug_info("gnutls", "Handshaking\n");
91 ret = gnutls_handshake(gnutls_data->session); 91
92 do
93 {
94 ret = gnutls_handshake(gnutls_data->session);
95 }
96 while ((ret == GNUTLS_E_AGAIN) || (ret == GNUTLS_E_INTERRUPTED));
97
98 gaim_debug_info("gnutls", "Handshake complete\n");
92 99
93 if (ret < 0) 100 if (ret < 0)
94 { 101 {
95 gaim_debug_error("gnutls", "Handshake failed. Error %d\n", ret); 102 gaim_debug_error("gnutls", "Handshake failed. Error %d\n", ret);
96 103
125 ssl_gnutls_read(GaimSslConnection *gsc, void *data, size_t len) 132 ssl_gnutls_read(GaimSslConnection *gsc, void *data, size_t len)
126 { 133 {
127 GaimSslGnutlsData *gnutls_data = GAIM_SSL_GNUTLS_DATA(gsc); 134 GaimSslGnutlsData *gnutls_data = GAIM_SSL_GNUTLS_DATA(gsc);
128 int s; 135 int s;
129 136
130 s = gnutls_record_recv(gnutls_data->session, data, len); 137 do
138 {
139 s = gnutls_record_recv(gnutls_data->session, data, len);
140 }
141 while ((s == GNUTLS_E_AGAIN) || (s == GNUTLS_E_INTERRUPTED));
131 142
132 if (s < 0) 143 if (s < 0)
144 {
145 gaim_debug_error("gnutls", "receive failed: %d\n", s);
133 s = 0; 146 s = 0;
147 }
134 148
135 return s; 149 return s;
136 } 150 }
137 151
138 static size_t 152 static size_t