]> granicus.if.org Git - apache/commitdiff
Fix some remaining problems with SSI's and Windows. Basically, the
authorRyan Bloom <rbb@apache.org>
Wed, 12 Jan 2000 18:20:43 +0000 (18:20 +0000)
committerRyan Bloom <rbb@apache.org>
Wed, 12 Jan 2000 18:20:43 +0000 (18:20 +0000)
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

modules/http/http_protocol.c
modules/http/http_request.c

index 99d12d99e3ce10e380915cf6a75050c1500eafba..361d2510a01eeb1c1559d4f1ccaf1691516c020a 100644 (file)
@@ -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);
index 579990333b290403ad8d4db5fd1561972a196aa5..5dc2e63d2c7fab1dedd55f854013c7687ece3baf 100644 (file)
@@ -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);