Return-Path: Delivered-To: apmail-httpd-test-cvs-archive@www.apache.org Received: (qmail 93622 invoked from network); 23 Mar 2004 20:36:00 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 23 Mar 2004 20:36:00 -0000 Received: (qmail 74355 invoked by uid 500); 23 Mar 2004 20:35:49 -0000 Delivered-To: apmail-httpd-test-cvs-archive@httpd.apache.org Received: (qmail 74319 invoked by uid 500); 23 Mar 2004 20:35:49 -0000 Mailing-List: contact test-cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: test-dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list test-cvs@httpd.apache.org Received: (qmail 74289 invoked from network); 23 Mar 2004 20:35:48 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 23 Mar 2004 20:35:48 -0000 Received: (qmail 93567 invoked by uid 1088); 23 Mar 2004 20:35:58 -0000 Date: 23 Mar 2004 20:35:58 -0000 Message-ID: <20040323203558.93566.qmail@minotaur.apache.org> From: stoddard@apache.org To: httpd-test-cvs@apache.org Subject: cvs commit: httpd-test/perl-framework/c-modules/echo_post_chunk mod_echo_post_chunk.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N stoddard 2004/03/23 12:35:58 Modified: perl-framework/c-modules/echo_post_chunk mod_echo_post_chunk.c Log: Don't send headers until after we'v tried an ap_get_client_block(). Revision Changes Path 1.4 +10 -4 httpd-test/perl-framework/c-modules/echo_post_chunk/mod_echo_post_chunk.c Index: mod_echo_post_chunk.c =================================================================== RCS file: /home/cvs/httpd-test/perl-framework/c-modules/echo_post_chunk/mod_echo_post_chunk.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- mod_echo_post_chunk.c 16 Oct 2003 00:30:38 -0000 1.3 +++ mod_echo_post_chunk.c 23 Mar 2004 20:35:58 -0000 1.4 @@ -38,10 +38,6 @@ return OK; } -#ifdef APACHE1 - ap_send_http_header(r); -#endif - if (r->args) { ap_rprintf(r, "%ld:", r->remaining); } @@ -55,6 +51,16 @@ nrd, sizeof(buff), r->remaining); total += nrd; } + + /* nrd < 0 is an error condition. Either the chunk size overflowed or the buffer + * size was insufficient. We can only deduce that the request is in error. + */ + if (nrd < 0) { + return HTTP_BAD_REQUEST; + } +#ifdef APACHE1 + ap_send_http_header(r); +#endif #ifdef APACHE1 trailer_header = ap_table_get(r->headers_in, "X-Chunk-Trailer");