From: Fabian Keil Date: Sun, 2 Nov 2008 18:40:34 +0000 (+0000) Subject: If we received a different amount of data than we expected, X-Git-Tag: v_3_0_11~182 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=735b418b180f02974e7bab27d45078d44abf7866 If we received a different amount of data than we expected, log a warning and make sure the server socket isn't reused. --- diff --git a/jcc.c b/jcc.c index 4b71bccb..6cee5d4b 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.200 2008/10/26 16:53:18 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.201 2008/11/02 16:48:20 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,9 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.200 2008/10/26 16:53:18 fabiankeil Exp $" * * Revisions : * $Log: jcc.c,v $ + * Revision 1.201 2008/11/02 16:48:20 fabiankeil + * Revert revision 1.195 and try again. + * * Revision 1.200 2008/10/26 16:53:18 fabiankeil * Fix gcc44 warning. * @@ -3039,6 +3042,15 @@ static void chat(struct client_state *csp) csp->content_length = byte_count; } + if ((csp->flags & CSP_FLAG_CONTENT_LENGTH_SET) + && (csp->expected_content_length != byte_count)) + { + log_error(LOG_LEVEL_ERROR, + "Received %d bytes while expecting %d.", + byte_count, csp->expected_content_length); + mark_server_socket_tainted(csp); + } + log_error(LOG_LEVEL_CLF, "%s - - [%T] \"%s\" 200 %d", csp->ip_addr_str, http->ocmd, csp->content_length); }