httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@covalent.net>
Subject Re: mod_include vs file descriptors
Date Sun, 11 Nov 2001 17:58:05 GMT
On Saturday 10 November 2001 10:03 pm, Brian Pane wrote:
> Ryan Bloom wrote:

> >apr_pool_join is a no-op unless APR_POOL_DEBUG is enabled.  If it isn't
> >enabled, which it shouldn't be on production servers, there will be no
> >performance penalty for that function.
>
> Sorry, I blamed the wrong part of the code, but the core
> problem still remains: we don't clean up the subrequest
> (and thus don't close file descriptors for included .shtml
> files) until top-level .shtml request goes out of scope.
> The logic in handle_include() appears to do this on purpose:
>
>                 /* destroy the sub request if it's not a nested include
>                  * (crumb) */
>                 if (rr != NULL
>                     && ap_get_module_config(rr->request_config,
>                        &include_module) != NESTED_INCLUDE_MAGIC) {
>                     ap_destroy_sub_req(rr);
>                 }
>
> What else would break if we destroyed the subreq here,
> even in the case of a nested include?

Nothing _should_ break, but there are few potential problems.  The biggest one
that I see is that you can't be sure that the data that has been allocated has 
actually been sent to the client yet. This means that it would be possible to 
free the sub-request, and have MMAP'ed data that gets destroyed before
the client sees it.  If that is the case, then it is a bug that should be fixed,
this leakage is not the solution however.

Ryan
______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Mime
View raw message