You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by gr...@apache.org on 2002/12/09 23:19:26 UTC
cvs commit: httpd-2.0/server core.c
gregames 2002/12/09 14:19:26
Modified: . CHANGES
server core.c
Log:
core_output_filter: re-instate the deferred_write pool patch so we don't
leak fd's until the end of a keepalive connection.
Thanks to:
Jeff Trawick for the original concept
Sander Striker for the mmap ring idea
Cliff Woolley for implementing the above change
Revision Changes Path
1.1007 +8 -7 httpd-2.0/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/httpd-2.0/CHANGES,v
retrieving revision 1.1006
retrieving revision 1.1007
diff -u -r1.1006 -r1.1007
--- CHANGES 9 Dec 2002 15:00:58 -0000 1.1006
+++ CHANGES 9 Dec 2002 22:19:25 -0000 1.1007
@@ -1,11 +1,17 @@
Changes with Apache 2.1.0-dev
+
+ [Remove entries to the current 2.0 section below, when backported]
+
+ *) Fix a bug where we leak fd's until the end of a keepalive
+ connection, which may result in:
+ (24)Too many open files: file permissions deny server access
+ especially on threaded servers. [Greg Ames]
+
*) If an httpd.conf has commented out AddModule directives,
apxs -i -a will add an un-commented AddModule directive for
the new module, which breaks the config.
PR: 11212 [Joe Orton]
- [Remove entries to the current 2.0 section below, when backported]
-
*) Fix mod_proxy handling of filtered input bodies. [Justin Erenkrantz]
*) Don't remove the Content-Length from responses in mod_proxy
@@ -142,11 +148,6 @@
terminates during post-config processing. An error is logged
once per worker, indicating that the CacheRoot needs to be set.
[Paul J. Reder]
-
- *) Fix a bug where we keep files open until the end of a
- keepalive connection, which can result in:
- (24)Too many open files: file permissions deny server access
- especially on threaded servers. [Greg Ames, Jeff Trawick]
*) Fix a bug in which mod_proxy sent an invalid Content-Length
when a proxied URL was invoked as a server-side include within
1.226 +29 -1 httpd-2.0/server/core.c
Index: core.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/core.c,v
retrieving revision 1.225
retrieving revision 1.226
diff -u -r1.225 -r1.226
--- core.c 16 Nov 2002 02:27:33 -0000 1.225
+++ core.c 9 Dec 2002 22:19:26 -0000 1.226
@@ -3670,6 +3670,7 @@
core_net_rec *net = f->ctx;
core_output_filter_ctx_t *ctx = net->out_ctx;
apr_read_type_e eblock = APR_NONBLOCK_READ;
+ apr_pool_t *input_pool = b->p;
if (ctx == NULL) {
ctx = apr_pcalloc(c->pool, sizeof(*ctx));
@@ -3924,7 +3925,10 @@
}
}
}
- ap_save_brigade(f, &ctx->b, &b, c->pool);
+ if (!ctx->deferred_write_pool) {
+ apr_pool_create(&ctx->deferred_write_pool, c->pool);
+ }
+ ap_save_brigade(f, &ctx->b, &b, ctx->deferred_write_pool);
return APR_SUCCESS;
}
@@ -3995,6 +3999,30 @@
}
apr_brigade_destroy(b);
+
+ /* drive cleanups for resources which were set aside
+ * this may occur before or after termination of the request which
+ * created the resource
+ */
+ if (ctx->deferred_write_pool) {
+ if (more && more->p == ctx->deferred_write_pool) {
+ /* "more" belongs to the deferred_write_pool,
+ * which is about to be cleared.
+ */
+ if (APR_BRIGADE_EMPTY(more)) {
+ more = NULL;
+ }
+ else {
+ /* uh oh... change more's lifetime
+ * to the input brigade's lifetime
+ */
+ apr_bucket_brigade *tmp_more = more;
+ more = NULL;
+ ap_save_brigade(f, &more, &tmp_more, input_pool);
+ }
+ }
+ apr_pool_clear(ctx->deferred_write_pool);
+ }
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server,
RE: cvs commit: httpd-2.0/server core.c
Posted by Sander Striker <st...@apache.org>.
> From: Cliff Woolley [mailto:jwoolley@virginia.edu]
> Sent: Wednesday, January 08, 2003 5:29 PM
> On Wed, 8 Jan 2003, Greg Ames wrote:
>
> > Can I get some +1's for moving this into stable (or -1's and reasons not
> > to do so)?
> >
> > - Its one month birthday is tomorrow,
> > - it is certainly in mainline code, and
> > - AFAIK it hasn't caused any problems since the apr_mmap ownership redesign.
>
> +1 from here
+1.
Sander
Re: cvs commit: httpd-2.0/server core.c
Posted by Cliff Woolley <jw...@virginia.edu>.
On Wed, 8 Jan 2003, Greg Ames wrote:
> Can I get some +1's for moving this into stable (or -1's and reasons not
> to do so)?
>
> - Its one month birthday is tomorrow,
> - it is certainly in mainline code, and
> - AFAIK it hasn't caused any problems since the apr_mmap ownership redesign.
+1 from here
--Cliff
Re: cvs commit: httpd-2.0/server core.c
Posted by Greg Ames <gr...@apache.org>.
gregames@apache.org wrote:
> gregames 2002/12/09 14:19:26
>
> Modified: . CHANGES
> server core.c
> Log:
> core_output_filter: re-instate the deferred_write pool patch so we don't
> leak fd's until the end of a keepalive connection.
>
> Thanks to:
> Jeff Trawick for the original concept
> Sander Striker for the mmap ring idea
> Cliff Woolley for implementing the above change
Can I get some +1's for moving this into stable (or -1's and reasons not to do
so)?
- Its one month birthday is tomorrow,
- it is certainly in mainline code, and
- AFAIK it hasn't caused any problems since the apr_mmap ownership redesign.
Greg