From: William A. Rowe Jr Date: Wed, 10 Oct 2001 18:37:35 +0000 (+0000) Subject: Short of removing the headers filter, this is the best asis can do. X-Git-Tag: 2.0.26~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d41d182fe62944d5bbf541e6d746d449ff90e488;p=thirdparty%2Fapache%2Fhttpd.git 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91401 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_asis.c b/modules/generators/mod_asis.c index 346b4351133..5f6ebbdd3d4 100644 --- a/modules/generators/mod_asis.c +++ b/modules/generators/mod_asis.c @@ -119,9 +119,19 @@ static int asis_handler(request_rec *r) 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 @@ static int asis_handler(request_rec *r) 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 {