receive_and_send_encrypted_post_data(): Additionally check for data being available
[privoxy.git] / jcc.c
diff --git a/jcc.c b/jcc.c
index 23679b5..c8367e5 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -2370,8 +2370,9 @@ static int 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->ssl_client_attr))
-      || (content_length_known && csp->expected_client_content_length != 0))
+   while ((content_length_known && csp->expected_client_content_length != 0) ||
+      (is_ssl_pending(&(csp->ssl_client_attr)) ||
+            data_is_available(csp->cfd, csp->config->socket_timeout)))
    {
       unsigned char buf[BUFFER_SIZE];
       int len;