You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/07/20 02:55:37 UTC

BUFF and pool cleanups

If a pool is cleaned up before a BUFF from it is bclose()d then it's
possible for buffered written data to be lost.  But it's not easy to write
a cleanup for BUFFs because buff.c isn't responsible for cleaning up the
fds ... and I can't remember the exact reason why we did it this way (I
know it was for the proxy though).

I'm just having a great day.

Oh yeah and I hate having to test if an fd is a socket and call
closesocket() on it.

I can't wait for sfio. 

Dean


Re: BUFF and pool cleanups

Posted by Dean Gaudet <dg...@arctic.org>.

On Sun, 20 Jul 1997, Ben Laurie wrote:

> OTOH if a pool is cleaned up before its finished with, who cares if data
> is lost?

Well I was noticing these changes in my cgi patch:

-    pfclose(r->main ? r->main->pool : r->pool, script_in);
-    pfclose(r->main ? r->main->pool : r->pool, script_err);
+    bclose(script_in);
+    bclose(script_err);

and I realised the semantic difference between an fclose and a bclose. 
Note that when a FILE * is cleaned up out of a pool its write buffer is
flushed by a fclose.  I was just worried there might exist a subtle case
where we need this behaviour. 

Dean


Re: BUFF and pool cleanups

Posted by Ben Laurie <be...@algroup.co.uk>.
Dean Gaudet wrote:

> If a pool is cleaned up before a BUFF from it is bclose()d then it's
> possible for buffered written data to be lost.  But it's not easy to
> write
> a cleanup for BUFFs because buff.c isn't responsible for cleaning up
> the
> fds ... and I can't remember the exact reason why we did it this way
> (I
> know it was for the proxy though).

The reason was that things were being cleaned up twice. It should be
possible to go through the proxy and carefully arrange stuff so that
buff.c can clean up (when it should).

OTOH if a pool is cleaned up before its finished with, who cares if data
is lost?

Cheers,

Ben.

--
Ben Laurie                Phone: +44 (181) 994 6435  Email:
ben@algroup.co.uk
Freelance Consultant and  Fax:   +44 (181) 994 6472
Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
London, England.          Apache-SSL author