[Privoxy-commits] [privoxy] branch master updated: handle_established_connection(): Check for pending TLS data from the client

User Git git at git.privoxy.org
Tue Mar 29 15:06:14 UTC 2022


This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository privoxy.

The following commit(s) were added to refs/heads/master by this push:
     new b15aee14 handle_established_connection(): Check for pending TLS data from the client
b15aee14 is described below

commit b15aee14f3dc660a966acb7c3f542586a768a1a0
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Sat Mar 27 10:16:00 2021 +0100

    handle_established_connection(): Check for pending TLS data from the client
    
    ... before checking if data is available on the connection.
    
    The TLS library may have already consumed all the data from the client
    response in which case poll() and select() will not detect that data is
    available to be read.
    
    Sponsored by: Robert Klemme
---
 jcc.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/jcc.c b/jcc.c
index 780969c2..36ac4f06 100644
--- a/jcc.c
+++ b/jcc.c
@@ -3109,6 +3109,16 @@ static void handle_established_connection(struct client_state *csp)
           */
          goto server_wants_to_talk;
       }
+      if (watch_client_socket && client_use_ssl(csp) &&
+         is_ssl_pending(&(csp->ssl_client_attr)))
+      {
+         /*
+          * The TLS libray may also consume all of the remaining data
+          * from the client when we're shuffling the data from an
+          * unbuffered request body to the server.
+          */
+         goto client_wants_to_talk;
+      }
 #endif
 #ifndef HAVE_POLL
       FD_ZERO(&rfds);
@@ -3250,7 +3260,13 @@ static void handle_established_connection(struct client_state *csp)
       if (FD_ISSET(csp->cfd, &rfds))
 #endif /* def HAVE_POLL*/
       {
-         int max_bytes_to_read = (int)csp->receive_buffer_size;
+         int max_bytes_to_read;
+
+#ifdef FEATURE_HTTPS_INSPECTION
+         client_wants_to_talk:
+#endif
+
+         max_bytes_to_read = (int)csp->receive_buffer_size;
 
 #ifdef FEATURE_CONNECTION_KEEP_ALIVE
          if ((csp->flags & CSP_FLAG_CLIENT_REQUEST_COMPLETELY_READ))

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list