From ef490f500f6910b0c620319020a4cd395e31e12b Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Mon, 25 May 2020 12:01:57 +0200 Subject: [PATCH] receive_and_send_encrypted_post_data(): Loop until no data is left ... if the content length is known. Previously data that wasn't received yet was ignored which could result in incomplete uploads. Sponsored by: Robert Klemme --- jcc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jcc.c b/jcc.c index 4354fd2e..85c41825 100644 --- a/jcc.c +++ b/jcc.c @@ -2053,7 +2053,8 @@ static jb_err receive_and_send_encrypted_post_data(struct client_state *csp) { int content_length_known = csp->expected_client_content_length != 0; - while (is_ssl_pending(&(csp->mbedtls_client_attr.ssl))) + while (is_ssl_pending(&(csp->mbedtls_client_attr.ssl)) + || (content_length_known && csp->expected_client_content_length != 0)) { unsigned char buf[BUFFER_SIZE]; int len; -- 2.39.2