From: Fabian Keil Date: Tue, 4 Sep 2012 08:37:51 +0000 (+0000) Subject: Figure out the request length before running sed() X-Git-Tag: v_3_0_20~282 X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/static/gitweb.js?a=commitdiff_plain;h=aca2af6432cf55f4dd48f393919f8e5be5801f68;p=privoxy.git Figure out the request length before running sed() We may want to adjust the Connection header based on the information. --- diff --git a/jcc.c b/jcc.c index 7a706ef6..c1ed36a6 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.385 2012/07/27 17:39:57 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.386 2012/07/27 17:41:42 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -1454,6 +1454,12 @@ static jb_err parse_client_request(struct client_state *csp) /* Assume persistence until further notice */ csp->flags |= CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE; } + + if (csp->http->ssl == 0) + { + csp->expected_client_content_length = get_expected_content_length(csp->headers); + verify_request_length(csp); + } #endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ err = sed(csp, FILTER_CLIENT_HEADERS); @@ -1484,13 +1490,6 @@ static jb_err parse_client_request(struct client_state *csp) return JB_ERR_PARSE; } -#ifdef FEATURE_CONNECTION_KEEP_ALIVE - if (csp->http->ssl == 0) - { - verify_request_length(csp); - } -#endif /* def FEATURE_CONNECTION_KEEP_ALIVE */ - return JB_ERR_OK; }