On Fri, 27 Jul 2001, Bill Stoddard wrote:

> In the mod_asis handler, we call:
>
> apr_file_open()
> ap_send_fd()
> apr_file_close()

I noticed that.  I actually spent a little time tracking down the
apr_file_close() calls the other day because I wasn't sure why they are
in there, and it turns out that (give or take about five intervening
function renames) they've been around ever since mod_asis was using
fopen()/fclose() directly.  The apr_file_close() calls should go away
since the pool cleanup does the work for us already and does it at "the
right time."

> 1. Not call apr_file_close() if we call ap_send_fd().

Yes.

> 2. Chase the call to ap_send_fd() with a call to ap_rflush() and call
> apr_file_close as is happening now.
>
> 3. Variation on 2)... Pass an additional option to ap_send_fd to
> specify whether to flush or not. And call apr_file_close() as is
> happening now.

#3 is better for performance than #2 because it spares us the creation of
a second brigade and an extra trip down the filter stack.  +1 to that in
addition to number 1.

--Cliff


--------------------------------------------------------------
   Cliff Woolley
   [EMAIL PROTECTED]
   Charlottesville, VA


Reply via email to