{
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);
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);