diff options
author | Ryan Bloom <rbb@apache.org> | 2000-01-12 19:20:43 +0100 |
---|---|---|
committer | Ryan Bloom <rbb@apache.org> | 2000-01-12 19:20:43 +0100 |
commit | 941a96936e53945173c3eb79c744bfaad133cd54 (patch) | |
tree | d9e471d3cfffe308e5482cabf8f0f463e5be978f /modules/http | |
parent | `-follow' is a GNU extension, remove it. (diff) | |
download | apache2-941a96936e53945173c3eb79c744bfaad133cd54.tar.xz apache2-941a96936e53945173c3eb79c744bfaad133cd54.zip |
Fix some remaining problems with SSI's and Windows. Basically, the
sendfile stuff doesn't work properly with chuncked data.
Submitted by: Allan Edwards
Reviewed by: Ryan Bloom
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84448 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http')
-rw-r--r-- | modules/http/http_protocol.c | 23 | ||||
-rw-r--r-- | modules/http/http_request.c | 1 |
2 files changed, 15 insertions, 9 deletions
diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 99d12d99e3..361d2510a0 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -2016,16 +2016,21 @@ API_EXPORT(long) ap_send_fd(ap_file_t *fd, request_rec *r) { long len; #ifdef HAVE_SENDFILE - ap_bflush(r->connection->client); - if (ap_get_filesize(&len, fd) != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, - "ap_send_fd: ap_get_filesize failed."); - return 0; + if (!r->chunked) { + ap_bflush(r->connection->client); + if (ap_get_filesize(&len, fd) != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, + "ap_send_fd: ap_get_filesize failed."); + return 0; + } + if (iol_sendfile(r->connection->client->iol, fd, len, + NULL, 0, 0) != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, + "ap_send_fd: iol_sendfile failed."); + } } - if (iol_sendfile(r->connection->client->iol, fd, len, - NULL, 0, 0) != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, - "ap_send_fd: iol_sendfile failed."); + else { + len = ap_send_fd_length(fd, r, -1); } #else len = ap_send_fd_length(fd, r, -1); diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 579990333b..5dc2e63d2c 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -845,6 +845,7 @@ API_EXPORT(request_rec *) ap_sub_req_lookup_file(const char *new_file, rnew->server = r->server; rnew->request_config = ap_create_request_config(rnew->pool); rnew->htaccess = r->htaccess; + rnew->chunked = r->chunked; ap_set_sub_req_protocol(rnew, r); fdir = ap_make_dirstr_parent(rnew->pool, r->filename); |