httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/standard mod_file_cache.c
Date Tue, 15 Aug 2000 12:47:47 GMT
stoddard    00/08/15 05:47:47

  Modified:    src/modules/standard mod_file_cache.c
  Log:
  Remove the sendfile_handler (was #if 0'ed out) that does the buffer hi-jack
  trick in order to send the headers out on the sendfile call. Besides, BUFF is
  going away with brigades and filters...
  
  Revision  Changes    Path
  1.23      +0 -70     apache-2.0/src/modules/standard/mod_file_cache.c
  
  Index: mod_file_cache.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_file_cache.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- mod_file_cache.c	2000/08/06 06:07:47	1.22
  +++ mod_file_cache.c	2000/08/15 12:47:46	1.23
  @@ -425,76 +425,6 @@
   #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) 
   {
  
  
  

Mime
View raw message