mirror of
https://github.com/curl/curl.git
synced 2026-08-25 21:43:37 +03:00
Mark Eichin submitted bug report #1480821
(http://curl.haxx.se/bug/view.cgi?id=1480821) He found and identified a problem with how libcurl dealt with GnuTLS and a case where gnutls returned GNUTLS_E_AGAIN indicating it would block. It would then return an unexpected return code, making Curl_ssl_send() confuse the upper layer - causing random 28 bytes trash data to get inserted in the transfered stream. The proper fix was to make the Curl_gtls_send() function return the proper return codes that the callers would expect. The Curl_ossl_send() function already did this.
This commit is contained in:
parent
80ee5d3bd8
commit
758f6eed51
3 changed files with 20 additions and 1 deletions
|
|
@ -458,6 +458,12 @@ int Curl_gtls_send(struct connectdata *conn,
|
|||
int rc;
|
||||
rc = gnutls_record_send(conn->ssl[sockindex].session, mem, len);
|
||||
|
||||
if(rc < 0 ) {
|
||||
if(rc == GNUTLS_E_AGAIN)
|
||||
return 0; /* EWOULDBLOCK equivalent */
|
||||
rc = -1; /* generic error code for send failure */
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue