]> granicus.if.org Git - apache/commitdiff
Remove the byterange code out of mod_file_cache's handler. That
authorJeff Trawick <trawick@apache.org>
Wed, 8 Nov 2000 19:07:34 +0000 (19:07 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 8 Nov 2000 19:07:34 +0000 (19:07 +0000)
is completely in the core now.

Note that file handle caching is broken (nothing to do with
byte ranges).  mmap caches seem to work o.k.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86873 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/mod_file_cache.c

index 45ddd0176d9d8908aeed136b46df05b60f97991b..f8ceed684b6a686a2b1d217d8189acd7cb9f1367 100644 (file)
@@ -388,39 +388,21 @@ static int file_cache_xlat(request_rec *r)
 }
 
 
-static int mmap_handler(request_rec *r, a_file *file, int rangestatus)
+static int mmap_handler(request_rec *r, a_file *file)
 {
 #if APR_HAS_MMAP
-    if (!rangestatus) {
-        ap_send_mmap (file->mm, r, 0, file->finfo.size);
-    }
-    else {
-        apr_size_t length;
-        apr_off_t offset;
-        while (ap_each_byterange(r, &offset, &length)) {
-            ap_send_mmap(file->mm, r, offset, length);
-        }
-    }
+    ap_send_mmap (file->mm, r, 0, file->finfo.size);
 #endif
     return OK;
 }
 
-static int sendfile_handler(request_rec *r, a_file *file, int rangestatus)
+static int sendfile_handler(request_rec *r, a_file *file)
 {
 #if APR_HAS_SENDFILE
-    apr_size_t length, nbytes;
-    apr_off_t offset = 0;
+    apr_size_t nbytes;
     apr_status_t rv = APR_EINIT;
 
-    if (!rangestatus) {
-        rv = ap_send_fd(file->file, r, 0, file->finfo.size, &nbytes);
-    }
-    else {
-        while (ap_each_byterange(r, &offset, &length)) {
-            if ((rv = ap_send_fd(file->file, r, offset, length, &nbytes)) != APR_SUCCESS)
-                break;
-        }
-    }
+    rv = ap_send_fd(file->file, r, 0, file->finfo.size, &nbytes);
     if (rv != APR_SUCCESS) {
         /* ap_send_fd will log the error */
         return HTTP_INTERNAL_SERVER_ERROR;
@@ -432,7 +414,7 @@ static int sendfile_handler(request_rec *r, a_file *file, int rangestatus)
 static int file_cache_handler(request_rec *r) 
 {
     a_file *match;
-    int rangestatus, errstatus;
+    int errstatus;
     int rc = OK;
 
     /* we don't handle anything but GET */
@@ -462,15 +444,14 @@ static int file_cache_handler(request_rec *r)
     }
     ap_set_content_length(r, match->finfo.size);
 
-    rangestatus = ap_set_byterange(r);
     ap_send_http_header(r);
 
     /* Call appropriate handler */
     if (!r->header_only) {    
         if (match->is_mmapped == TRUE)
-            rc = mmap_handler(r, match, rangestatus);
+            rc = mmap_handler(r, match);
         else
-            rc = sendfile_handler(r, match, rangestatus);
+            rc = sendfile_handler(r, match);
     }
 
     return rc;