In the mod_asis handler, we call:
apr_file_open()
ap_send_fd()
apr_file_close()
The problem is that the brigade created by ap_send_fd is not be flushed to the network
before the apr_file_close (because we've not hit the min bytes to write threshold and
one
of the filters is buffering). I see a couple of solutions:
1. Not call apr_file_close() if we call ap_send_fd(). The bucket cleanup code will
handle
closing the file.
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.
I am leaning toward 3 for this specific case. This way, the handler can tell
ap_send_fd
to flush and be assured the bytes have been sent to the network before it returns.
Thoughts?
Bill