You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/10/18 19:00:00 UTC
cvs commit: apache-2.0/src/lib/apr/file_io/win32 pipe.c
trawick 00/10/18 09:59:58
Modified: src CHANGES
src/lib/apr/file_io/unix pipe.c
src/lib/apr/file_io/win32 pipe.c
Log:
APR pipes on Unix and Win32 are now cleaned up automatically when the
associated pool goes away. (APR pipes on OS/2 were already had this
logic.) This resolvs a fatal file descriptor leak with CGIs.
(I'm also thinking at closing a pipe sooner in pipe_read() once we've
reached the end of the pipe. Speak up if you think that is stupid.
socket_read() has the same issue.)
Revision Changes Path
1.284 +5 -0 apache-2.0/src/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apache-2.0/src/CHANGES,v
retrieving revision 1.283
retrieving revision 1.284
diff -u -r1.283 -r1.284
--- CHANGES 2000/10/18 15:58:26 1.283
+++ CHANGES 2000/10/18 16:59:49 1.284
@@ -1,4 +1,9 @@
Changes with Apache 2.0a8
+ *) APR pipes on Unix and Win32 are now cleaned up automatically when the
+ associated pool goes away. (APR pipes on OS/2 were already had this
+ logic.) This resolvs a fatal file descriptor leak with CGIs.
+ [Jeff Trawick]
+
*) The final line of the config file was not being read if there was
no \n at the end of it. This was caused by apr_fgets returning
APR_EOF even though we had read valid data. This is solved by
1.39 +4 -0 apache-2.0/src/lib/apr/file_io/unix/pipe.c
Index: pipe.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/pipe.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- pipe.c 2000/08/02 05:25:51 1.38
+++ pipe.c 2000/10/18 16:59:52 1.39
@@ -178,6 +178,10 @@
(*in)->thlock = NULL;
#endif
+ apr_register_cleanup((*in)->cntxt, (void *)(*in), apr_unix_file_cleanup,
+ apr_null_cleanup);
+ apr_register_cleanup((*out)->cntxt, (void *)(*out), apr_unix_file_cleanup,
+ apr_null_cleanup);
return APR_SUCCESS;
}
1.29 +4 -0 apache-2.0/src/lib/apr/file_io/win32/pipe.c
Index: pipe.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/win32/pipe.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- pipe.c 2000/10/06 17:24:38 1.28
+++ pipe.c 2000/10/18 16:59:57 1.29
@@ -105,6 +105,10 @@
return apr_get_os_error();
}
+ apr_register_cleanup((*in)->cntxt, (void *)(*in), file_cleanup,
+ apr_null_cleanup);
+ apr_register_cleanup((*out)->cntxt, (void *)(*out), file_cleanup,
+ apr_null_cleanup);
return APR_SUCCESS;
}
RE: cvs commit: apache-2.0/src/lib/apr/file_io/win32 pipe.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
> From: Jeff Trawick [mailto:trawickj@bellsouth.net]
> Sent: Wednesday, October 18, 2000 12:23 PM
>
> trawick@locus.apache.org writes:
>
> > trawick 00/10/18 09:59:58
> >
> > Modified: src CHANGES
> > src/lib/apr/file_io/unix pipe.c
> > src/lib/apr/file_io/win32 pipe.c
> > Log:
> > APR pipes on Unix and Win32 are now cleaned up automatically when the
> > associated pool goes away. (APR pipes on OS/2 were already had this
> > logic.) This resolvs a fatal file descriptor leak with CGIs.
>
> Beware [Other]Bill: I didn't so much as see if this would
> compile on Win32.
>
> (duck)
It's been broken daily :-) OTOH - Ryan's committed at least three fixes in
the last week or so to get Unix building again...
Re: cvs commit: apache-2.0/src/lib/apr/file_io/win32 pipe.c
Posted by Jeff Trawick <tr...@bellsouth.net>.
trawick@locus.apache.org writes:
> trawick 00/10/18 09:59:58
>
> Modified: src CHANGES
> src/lib/apr/file_io/unix pipe.c
> src/lib/apr/file_io/win32 pipe.c
> Log:
> APR pipes on Unix and Win32 are now cleaned up automatically when the
> associated pool goes away. (APR pipes on OS/2 were already had this
> logic.) This resolvs a fatal file descriptor leak with CGIs.
Beware [Other]Bill: I didn't so much as see if this would compile on Win32.
(duck)
--
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...