[Privoxy-commits] [privoxy] 10/11: handle_established_connection(): Skip the poll()/select() calls

User Git git at git.privoxy.org
Fri Mar 12 11:37:53 UTC 2021


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

git pushed a commit to branch master
in repository privoxy.

commit 296e625ee14b5b4725d8dddec7483ce796cc488b
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Wed Mar 10 17:50:53 2021 +0100

    handle_established_connection(): Skip the poll()/select() calls
    
    ... if TLS data is pending on the server socket.
    
    The TLS library may have already consumed all the data from the server
    response in which case poll() and select() will not detect that data is
    available to be read.
    
    Fixes SF bug #926 reported by Wen Yue.
---
 jcc.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/jcc.c b/jcc.c
index 648fd455..d8840b60 100644
--- a/jcc.c
+++ b/jcc.c
@@ -3085,6 +3085,18 @@ static void handle_established_connection(struct client_state *csp)
 
    for (;;)
    {
+#ifdef FEATURE_HTTPS_INSPECTION
+      if (server_use_ssl(csp) && is_ssl_pending(&(csp->ssl_server_attr)))
+      {
+         /*
+          * It's possible that the TLS library already consumed all the
+          * data the server intends to send. If that happens poll() and
+          * select() will no longer see the data as available so we have
+          * to skip the calls.
+          */
+         goto server_wants_to_talk;
+      }
+#endif
 #ifndef HAVE_POLL
       FD_ZERO(&rfds);
 #ifdef FEATURE_CONNECTION_KEEP_ALIVE
@@ -3358,6 +3370,9 @@ static void handle_established_connection(struct client_state *csp)
       if (FD_ISSET(csp->server_connection.sfd, &rfds))
 #endif /* HAVE_POLL */
       {
+#ifdef FEATURE_HTTPS_INSPECTION
+         server_wants_to_talk:
+#endif
 #ifdef FEATURE_CONNECTION_KEEP_ALIVE
          /*
           * If we are buffering content, we don't want to eat up to

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


More information about the Privoxy-commits mailing list