[Privoxy-commits] [privoxy] 03/07: Rename connection_header_contains_keep_alive_keyword()

User Git git at git.privoxy.org
Tue Jun 24 14:10:22 CEST 2025


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

git pushed a commit to branch master
in repository privoxy.

commit 521398d3903cc0478087d0183157e9f70f533381
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Fri Jun 20 13:40:47 2025 +0200

    Rename connection_header_contains_keep_alive_keyword()
    
    ... to keep_alive_keyword_detected() as the function may
    return FALSE if there are "too many" keywords.
    
    Document this behaviour explicitly.
---
 parsers.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/parsers.c b/parsers.c
index 04e7ee00..3be2addf 100644
--- a/parsers.c
+++ b/parsers.c
@@ -1793,7 +1793,7 @@ static jb_err filter_header(struct client_state *csp, char **header)
 
 /*********************************************************************
  *
- * Function    :  connection_header_contains_keep_alive_keyword
+ * Function    :  keep_alive_keyword_detected
  *
  * Description :  Checks wether or not a Connection header contains
  *                the keep-alive keyword.
@@ -1801,10 +1801,11 @@ static jb_err filter_header(struct client_state *csp, char **header)
  * Parameters  :
  *          1  :  header = The Connection header to check.
  *
- * Returns     :  TRUE or FALSE.
+ * Returns     :  TRUE or FALSE. FALSE is also returned if "too many"
+ *                keywords are present.
  *
  *********************************************************************/
-static int connection_header_contains_keep_alive_keyword(const char *header)
+static int keep_alive_keyword_detected(const char *header)
 {
    char *header_content;
    char *keywords[4];
@@ -1856,7 +1857,7 @@ static int connection_header_contains_keep_alive_keyword(const char *header)
  *********************************************************************/
 static jb_err server_connection(struct client_state *csp, char **header)
 {
-   if (connection_header_contains_keep_alive_keyword(*header)
+   if (keep_alive_keyword_detected(*header)
 #ifdef FEATURE_CONNECTION_KEEP_ALIVE
     && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED)
 #endif

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


More information about the Privoxy-commits mailing list