]> granicus.if.org Git - apache/commitdiff
Remove the original ap_send_fd code. The filters have been working for a
authorRyan Bloom <rbb@apache.org>
Tue, 7 Nov 2000 18:09:47 +0000 (18:09 +0000)
committerRyan Bloom <rbb@apache.org>
Tue, 7 Nov 2000 18:09:47 +0000 (18:09 +0000)
while, and this is cluttering up the code.  If it is really needed, it
can be found in CVS

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

modules/http/http_protocol.c

index f57a14d0714fc4c852b0f2e9e06ffef9242ebd82..b18d2583164abb9118690a32019f163c4f8b4ebc 100644 (file)
@@ -2751,80 +2751,6 @@ AP_DECLARE(apr_status_t) ap_send_fd(apr_file_t *fd, request_rec *r, apr_off_t of
 
     return rv;
 }
-#if 0
-/* Leave the old implementation around temporarily for reference purposes */
-AP_DECLARE(apr_status_t) ap_send_fd(apr_file_t *fd, request_rec *r, apr_off_t offset, 
-                                   apr_size_t length, apr_size_t *nbytes) 
-{
-    apr_status_t rv = APR_SUCCESS;
-    apr_size_t total_bytes_sent = 0;
-    register int o;
-    apr_ssize_t n;
-    char buf[IOBUFSIZE];
-
-    if ((length == 0) || r->connection->aborted) {
-        *nbytes = 0;
-        return APR_SUCCESS;
-    }
-
-#if APR_HAS_SENDFILE
-    /* Chunked encoding must be handled in the BUFF */
-    if (!r->chunked) {
-        rv = static_send_file(fd, r, offset, length, &total_bytes_sent);
-        if (rv == APR_SUCCESS) {
-            r->bytes_sent += total_bytes_sent;
-            *nbytes = total_bytes_sent;
-            return rv;
-        }
-        /* Don't consider APR_ENOTIMPL a failure */
-        if (rv != APR_ENOTIMPL) {
-            check_first_conn_error(r, "send_fd", rv);
-            r->bytes_sent += total_bytes_sent;
-            *nbytes = total_bytes_sent;
-            return rv;
-        }
-    }
-#endif
-
-    /* Either sendfile is not defined or it failed with APR_ENOTIMPL */
-    if (offset) {
-        /* Seek the file to the offset */
-        rv = apr_seek(fd, APR_SET, &offset);
-        if (rv != APR_SUCCESS) {
-            *nbytes = total_bytes_sent;
-            /* apr_close(fd); close the file or let the caller handle it? */
-            return rv;
-        }
-    }
-
-    while (!r->connection->aborted) {
-        if ((length > 0) && (total_bytes_sent + IOBUFSIZE) > length) {
-            n = length - total_bytes_sent;
-       }
-        else {
-            n = IOBUFSIZE;
-       }
-        
-        do {
-            rv = apr_read(fd, buf, &n);
-        } while (APR_STATUS_IS_EINTR(rv) && !r->connection->aborted);
-
-        /* Is this still the right check? maybe check for n==0 or rv == APR_EOF? */
-        if (n < 1) {
-            break;
-        }
-
-        o = ap_rwrite(buf, n, r);
-        if (o < 0) {
-            break;
-       }
-        total_bytes_sent += o;
-    }
-
-    *nbytes = total_bytes_sent;
-    return rv;
-} 
-#endif
 
 #ifdef AP_USE_MMAP_FILES