1
Mark Eichin submitted bug report #1480821
2
(http://curl.haxx.se/bug/view.cgi?id=1480821) He found and identified a
3
problem with how libcurl dealt with GnuTLS and a case where gnutls returned
4
GNUTLS_E_AGAIN indicating it would block. It would then return an unexpected
5
return code, making Curl_ssl_send() confuse the upper layer - causing
6
random 28 bytes trash data to get inserted in the transfered stream.
8
The proper fix was to make the Curl_gtls_send() function return the proper
9
return codes that the callers would expect. The Curl_ossl_send() function
12
--- curl/lib/gtls.c.orig 2007-09-11 12:04:58.000000000 -0300
13
+++ curl/lib/gtls.c 2007-09-11 12:05:51.000000000 -0300
16
rc = gnutls_record_send(conn->ssl[sockindex].session, mem, len);
19
+ if(rc == GNUTLS_E_AGAIN)
20
+ return 0; /* EWOULDBLOCK equivalent */
21
+ rc = -1; /* generic error code for send failure */