apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: file_setaside()
Date Tue, 19 Jun 2001 10:46:14 GMT
<rbb@covalent.net> writes:

> > (2) Why should file_setaside mmap the file?  I'd think that we'd want to
> > keep it as a file as long as possible to make it easier to use
> > sendfile()... what am I missing?
> We are going to be copying something.  I figured mmap'ing the file would
> be a bit better, because we could write the file out.  

Why would we need to write the file out?

>                                                        Either way, it
> doesn't really matter.

I thought it mattered because we prefer having a file descriptor in
core_output to having an mmap in core_output.  I guess I'm missing
your point.

> > (3) You don't really need to dup() the file, do you?  You can palloc a new
> > apr_file_t in the requested pool and use apr_os_file_get() and
> > apr_os_file_put() to move the os file handle into it.  mod_file_cache in
> > Apache does something like this.  It should be cheaper to do this than to
> > do a full dup(), I think.
> The file was opened with the request->pool.  If we just
> apr_os_file_get/put, we will still close the file when the request_pool is
> cleared.  We have to dup, or the file won't be available to us, and the
> original bug will be back.

Isn't it just a matter of killing the cleanup associated with one pool
and registering the cleanup with the new pool?

Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
             Born in Roswell... married an alien...

View raw message