Justin Erenkrantz <[EMAIL PROTECTED]> writes:
> On Wed, Jul 25, 2001 at 04:12:13PM -0400, Jeff Trawick wrote:
> > Jeff Trawick <[EMAIL PROTECTED]> writes:
> >
> > > Greg Ames <[EMAIL PROTECTED]> writes:
> > >
> > > > But what if we have rv == -1, EAGAIN, and nbytes == 0 ? I don't think
> > > > we handle that properly yet in FreeBSD, nor in Solaris. Looks to me
> > > > like the new FreeBSD code will exit apr_sendfile with APR_EAGAIN, and
> > > > sendfile_it_all will bail, and the request will die.
> > >
> > > yeah, it definitely looks busted... I'll work on that...
> >
> > Here is a patch for FreeBSD which I'll commit soon if nobody
> > complains. It fixes a few problems with when we call
> > wait_for_io_or_timeout(), and it also tries to send again when
> > wait_for_io_or_timeout() succeeds.
>
> [I'm in San Diego right now for the O'Reilly conference, so this
> will be short.]
>
> This doesn't work because you now need to adjust the sendfile params.
> On FreeBSD/Solaris, EAGAIN means that it sent something - merely
> repeating the call to sendfile with the same parameters is bogus
> (same data sent twice).
no, not a problem.
When EAGAIN sends something we promptly set rv to 0 so we avoid the
wait_for_io_or_timeout()/re-try path.
There is no need to adjust the parameters since we do
wait_for_io_or_timeout()/retry *only* if we didn't send anything the
first time. This is the same way the other send-type calls work in
APR.
--
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...