1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

polarssl, mbedtls: Fix detection of pending data

Reported-by: Dan Fandrich
Bug: https://curl.haxx.se/mail/lib-2017-02/0032.html
This commit is contained in:
Michael Kaufmann 2017-02-08 22:09:31 +01:00
parent 3cc2229c13
commit a7e4348cf8
2 changed files with 2 additions and 6 deletions

View File

@ -937,9 +937,7 @@ void Curl_mbedtls_cleanup(void)
int Curl_mbedtls_data_pending(const struct connectdata *conn, int sockindex) int Curl_mbedtls_data_pending(const struct connectdata *conn, int sockindex)
{ {
mbedtls_ssl_context *ssl = return mbedtls_ssl_get_bytes_avail(&conn->ssl[sockindex].ssl) != 0;
(mbedtls_ssl_context *)&conn->ssl[sockindex].ssl;
return ssl->in_msglen != 0;
} }
#endif /* USE_MBEDTLS */ #endif /* USE_MBEDTLS */

View File

@ -819,9 +819,7 @@ void Curl_polarssl_cleanup(void)
int Curl_polarssl_data_pending(const struct connectdata *conn, int sockindex) int Curl_polarssl_data_pending(const struct connectdata *conn, int sockindex)
{ {
ssl_context *ssl = return ssl_get_bytes_avail(&conn->ssl[sockindex].ssl) != 0;
(ssl_context *)&conn->ssl[sockindex].ssl;
return ssl->in_msglen != 0;
} }
#endif /* USE_POLARSSL */ #endif /* USE_POLARSSL */