On 02/16/2009 11:07 AM, Joe Orton wrote: > On Sat, Feb 14, 2009 at 10:25:08AM +1100, Graham Dumpleton wrote: > ... >> What the end result of the code is, is that if you have a file bucket >> getting this far where length of file is less than 8000 and an EOS >> follows it, then the actual file bucket is held over rather than data >> being read and buffered. This is as commented is to avoid doing an >> mmap+memcpy. What it means though is that the file descriptor within >> the file bucket must be maintained and cannot be closed as soon as >> ap_pass_brigade() has been called. > > The call to: > > ap_save_brigade(f, &ctx->b, &b, ctx->deferred_write_pool); > > in that code path should result in the FILE bucket and the contained fd > being dup()ed. (Though if that is failing, you wouldn't know because of > the lack of error checking)
Are you sure? apr_file_setaside does not dup the fd. Regards Rüdiger
