]> granicus.if.org Git - apache/commitdiff
Remove the sendfile_handler (was #if 0'ed out) that does the buffer hi-jack
authorBill Stoddard <stoddard@apache.org>
Tue, 15 Aug 2000 12:47:46 +0000 (12:47 +0000)
committerBill Stoddard <stoddard@apache.org>
Tue, 15 Aug 2000 12:47:46 +0000 (12:47 +0000)
trick in order to send the headers out on the sendfile call. Besides, BUFF is
going away with brigades and filters...

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

modules/cache/mod_file_cache.c

index 8794f978154ccf21f9b369abdb80fedc3bf5ca2a..9793dd9e35830fe811b5906ee20f89216dacbc0e 100644 (file)
@@ -425,76 +425,6 @@ static int sendfile_handler(request_rec *r, a_file *file, int rangestatus)
 #endif
     return OK;
 }
-#if 0
-static int sendfile_handler(request_rec *r, a_file *file, int rangestatus)
-{
-#if APR_HAS_SENDFILE
-    long length;
-    apr_off_t offset = 0;
-    struct iovec iov;
-    apr_hdtr_t hdtr;
-    apr_hdtr_t *phdtr = &hdtr;
-    apr_status_t rv; 
-    apr_int32_t flags = 0;
-
-    /* 
-     * We want to send any data held in the client buffer on the
-     * call to iol_sendfile. So hijack it then set outcnt to 0
-     * to prevent the data from being sent to the client again
-     * when the buffer is flushed to the client at the end of the 
-     * request.
-     */
-    iov.iov_base = r->connection->client->outbase;
-    iov.iov_len =  r->connection->client->outcnt;
-    r->connection->client->outcnt = 0;
-
-    /* initialize the apr_hdtr_t struct */
-    phdtr->headers = &iov;
-    phdtr->numheaders = 1;
-    phdtr->trailers = NULL;
-    phdtr->numtrailers = 0;
-
-    if (!rangestatus) {
-        length = file->finfo.size;
-
-        if (!r->connection->keepalive) {
-            /* Disconnect the socket after the send completes. This
-             * should leave the accept socket in a state ready to be
-             * reused for the next connection.
-             */
-            flags |= APR_SENDFILE_DISCONNECT_SOCKET;
-        }
-
-        rv = iol_sendfile(r->connection->client->iol, 
-                     file->file,
-                     phdtr,
-                     &offset,
-                     &length,
-                     flags);
-        if (rv != APR_SUCCESS) { 
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, 
-                          "mod_file_cache: iol_sendfile failed."); 
-        }
-    } 
-    else {
-        while (ap_each_byterange(r, &offset, &length)) {
-            rv =iol_sendfile(r->connection->client->iol, 
-                         file->file,
-                         phdtr,
-                         &offset,
-                         &length,
-                             0); 
-            if (rv != APR_SUCCESS) { 
-                ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, 
-                              "mod_file_cache: iol_sendfile failed."); 
-            } 
-            phdtr = NULL;
-        }
-    }
-#endif
-    return OK;
-}
-#endif
 
 static int file_cache_handler(request_rec *r) 
 {