You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jim Jagielski <ji...@jaguNET.com> on 1997/01/23 23:30:34 UTC

bflush and lingering close

The code still calls bflush then lingering_close (or
bflush and bclose).

  1. Is the bflush needed before the lingering close?

     It's looking like it is because we want to make
     sure the output is flushed before we shutdown.

  2. Why close and not bclose (both in lingering_close
     and in the !if (r && !r->connection->aborted) section?

     It looks like a bflush in lingering close may not
     be wise since the output is already flushed and shutdown.
     In the later case, maybe bclose might be better??

One thing to note is that bclose both closes fd and fd_in, whereas
in the lingering_close we just close fd    Is that an issue/problem?
-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
                  "Not the Craw... the CRAW!"

Re: bflush and lingering close

Posted by Marc Slemko <ma...@znep.com>.
On Thu, 23 Jan 1997, Jim Jagielski wrote:

> The code still calls bflush then lingering_close (or
> bflush and bclose).
> 
>   1. Is the bflush needed before the lingering close?
> 
>      It's looking like it is because we want to make
>      sure the output is flushed before we shutdown.

Yes.

> 
>   2. Why close and not bclose (both in lingering_close
>      and in the !if (r && !r->connection->aborted) section?
> 
>      It looks like a bflush in lingering close may not
>      be wise since the output is already flushed and shutdown.
>      In the later case, maybe bclose might be better??

I did not use it because the existing code didn't and I do not understand
what bclose() is supposed to be doing.  I see no reason to end up calling
bflush() twice, and I have no documentation to support what the API is
supposed to do.

Should bclose() be calling bflush()?  If so, I don't think we need to call
bflush() before bclose(); bclose doesn't unconditionally bflush, but I
think it does it in all the cases we care?

Some places call bclose, some don't.  Some places put a bflush right
before bclose, some don't.

> 
> One thing to note is that bclose both closes fd and fd_in, whereas
> in the lingering_close we just close fd    Is that an issue/problem?

It could be an issue, but I don't think it is a problem right now because
AFAIK they are always the same thing except for cio.  Need to understand
exactly what buff's concept of BUFFs is and what it is trying to do before
I comment more.