You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2001/10/10 20:37:35 UTC
cvs commit: httpd-2.0/modules/generators mod_asis.c
wrowe 01/10/10 11:37:35
Modified: modules/generators mod_asis.c
Log:
Short of removing the headers filter, this is the best asis can do.
Note that all body replies were entirely broken (thanks for helping
me notice this, Greg :)
Asis still needs patching for huge files.
Revision Changes Path
1.41 +12 -1 httpd-2.0/modules/generators/mod_asis.c
Index: mod_asis.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/generators/mod_asis.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- mod_asis.c 2001/08/11 04:04:12 1.40
+++ mod_asis.c 2001/10/10 18:37:35 1.41
@@ -119,9 +119,19 @@
if (!r->header_only) {
apr_bucket_brigade *bb;
apr_bucket *b;
+ apr_off_t pos = 0;
+ rv = apr_file_seek(f, APR_CUR, &pos);
+ if (rv != APR_SUCCESS) {
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ "mod_asis: failed to find end-of-headers position "
+ "for %s", r->filename);
+ apr_file_close(f);
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
+
bb = apr_brigade_create(r->pool);
- b = apr_bucket_file_create(f, 0, (apr_size_t) r->finfo.size, r->pool);
+ b = apr_bucket_file_create(f, pos, (apr_size_t) (r->finfo.size - pos), r->pool);
APR_BRIGADE_INSERT_TAIL(bb, b);
b = apr_bucket_eos_create();
APR_BRIGADE_INSERT_TAIL(bb, b);
@@ -129,6 +139,7 @@
if (rv != APR_SUCCESS) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
"mod_asis: ap_pass_brigade failed for file %s", r->filename);
+ return HTTP_INTERNAL_SERVER_ERROR;
}
}
else {