httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: apache-2.0/src/modules/standard mod_file_cache.c
Date Thu, 09 Nov 2000 00:48:24 GMT
Euh... that would indicate a problem with ap_send_fd(). We pass in an
offset, so it should use it. We shouldn't have to see beforehand.

Am I missing something about ap_send_fd's API?

Cheers,
-g

On Wed, Nov 08, 2000 at 11:07:46PM -0000, trawick@locus.apache.org wrote:
> trawick     00/11/08 15:07:38
> 
>   Modified:    src/modules/standard mod_file_cache.c
>   Log:
>   When caching file handles (vs. mmaps) reset the file pointer
>   before serving, since a filter may have caused the file pointer
>   to advance.
>   
>   Revision  Changes    Path
>   1.32      +8 -0      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.31
>   retrieving revision 1.32
>   diff -u -r1.31 -r1.32
>   --- mod_file_cache.c	2000/11/08 19:07:34	1.31
>   +++ mod_file_cache.c	2000/11/08 23:07:32	1.32
>   @@ -401,6 +401,14 @@
>    #if APR_HAS_SENDFILE
>        apr_size_t nbytes;
>        apr_status_t rv = APR_EINIT;
>   +    apr_off_t offset = 0;
>   +
>   +    rv = apr_seek(file->file, APR_SET, &offset);
>   +    if (rv != APR_SUCCESS) {
>   +        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
>   +                      "seek failed");
>   +        return HTTP_INTERNAL_SERVER_ERROR;
>   +    }
>    
>        rv = ap_send_fd(file->file, r, 0, file->finfo.size, &nbytes);
>        if (rv != APR_SUCCESS) {
>   
>   
>   

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message