aboutsummaryrefslogtreecommitdiff
path: root/lib/vtls
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vtls')
-rw-r--r--lib/vtls/mbedtls.c7
-rw-r--r--lib/vtls/mbedtls.h3
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c
index 77ff326e1..4f887a123 100644
--- a/lib/vtls/mbedtls.c
+++ b/lib/vtls/mbedtls.c
@@ -864,6 +864,11 @@ void Curl_mbedtls_cleanup(void)
(void)Curl_polarsslthreadlock_thread_cleanup();
}
-
+int Curl_mbedtls_data_pending(const struct connectdata *conn, int sockindex)
+{
+ mbedtls_ssl_context *ssl =
+ (mbedtls_ssl_context *)&conn->ssl[sockindex].ssl;
+ return ssl->in_msglen != 0;
+}
#endif /* USE_MBEDTLS */
diff --git a/lib/vtls/mbedtls.h b/lib/vtls/mbedtls.h
index eb6192eea..bd1c15bd4 100644
--- a/lib/vtls/mbedtls.h
+++ b/lib/vtls/mbedtls.h
@@ -31,6 +31,7 @@
/* Called on first use mbedTLS, setup threading if supported */
int Curl_mbedtls_init(void);
void Curl_mbedtls_cleanup(void);
+int Curl_mbedtls_data_pending(const struct connectdata *conn, int sockindex);
CURLcode Curl_mbedtls_connect(struct connectdata *conn, int sockindex);
@@ -63,7 +64,7 @@ int Curl_mbedtls_shutdown(struct connectdata *conn, int sockindex);
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
#define curlssl_version Curl_mbedtls_version
#define curlssl_check_cxn(x) (x=x, -1)
-#define curlssl_data_pending(x,y) (x=x, y=y, 0)
+#define curlssl_data_pending(x,y) Curl_mbedtls_data_pending(x, y)
#define CURL_SSL_BACKEND CURLSSLBACKEND_MBEDTLS
#define curlssl_sha256sum(a,b,c,d) mbedtls_sha256(a,b,c,0)