From b6f8c9c68a2f33ef3f174ba763b717d5c7af1145 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Tue, 7 Nov 2000 18:09:47 +0000 Subject: [PATCH] Remove the original ap_send_fd code. The filters have been working for a 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 | 74 ------------------------------------ 1 file changed, 74 deletions(-) diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index f57a14d071..b18d258316 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -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 -- 2.40.0