You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by st...@apache.org on 2004/03/23 21:35:58 UTC
cvs commit: httpd-test/perl-framework/c-modules/echo_post_chunk mod_echo_post_chunk.c
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");