Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 6338 invoked from network); 26 Sep 2004 15:53:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 26 Sep 2004 15:53:11 -0000 Received: (qmail 25519 invoked by uid 500); 26 Sep 2004 15:52:55 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 25310 invoked by uid 500); 26 Sep 2004 15:52:54 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 25265 invoked by uid 500); 26 Sep 2004 15:52:53 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 25242 invoked by uid 99); 26 Sep 2004 15:52:53 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 26 Sep 2004 08:52:53 -0700 Received: (qmail 6256 invoked by uid 1582); 26 Sep 2004 15:52:52 -0000 Date: 26 Sep 2004 15:52:52 -0000 Message-ID: <20040926155252.6255.qmail@minotaur.apache.org> From: jorton@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server util_filter.c X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N jorton 2004/09/26 08:52:52 Modified: modules/generators mod_cgi.c server util_filter.c Log: * server/util_filter.c (ap_save_brigade): Handle an ENOTIMPL setaside function correctly. * modules/generators/mod_cgi.c (cgi_handler): Revert r1.169, unnecessary CGI bucket lifetime kludge. PR: 31247 Revision Changes Path 1.171 +1 -4 httpd-2.0/modules/generators/mod_cgi.c Index: mod_cgi.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgi.c,v retrieving revision 1.170 retrieving revision 1.171 diff -d -w -u -r1.170 -r1.171 --- mod_cgi.c 22 Sep 2004 15:38:02 -0000 1.170 +++ mod_cgi.c 26 Sep 2004 15:52:51 -0000 1.171 @@ -905,10 +905,7 @@ apr_file_pipe_timeout_set(script_in, 0); apr_file_pipe_timeout_set(script_err, 0); - /* if r is a subrequest, ensure that the bucket only references - * r->main, since it may last longer than the subreq. */ - b = cgi_bucket_create(r->main ? r->main : r, script_in, script_err, - c->bucket_alloc); + b = cgi_bucket_create(r, script_in, script_err, c->bucket_alloc); #else b = apr_bucket_pipe_create(script_in, c->bucket_alloc); #endif 1.101 +15 -4 httpd-2.0/server/util_filter.c Index: util_filter.c =================================================================== RCS file: /home/cvs/httpd-2.0/server/util_filter.c,v retrieving revision 1.100 retrieving revision 1.101 diff -d -w -u -r1.100 -r1.101 --- util_filter.c 21 Sep 2004 10:14:40 -0000 1.100 +++ util_filter.c 26 Sep 2004 15:52:51 -0000 1.101 @@ -546,10 +546,21 @@ e = APR_BUCKET_NEXT(e)) { rv = apr_bucket_setaside(e, p); - if (rv != APR_SUCCESS - /* ### this ENOTIMPL will go away once we implement setaside - ### for all bucket types. */ - && rv != APR_ENOTIMPL) { + + /* If the bucket type does not implement setaside, then + * (hopefully) morph it into a bucket type which does, and set + * *that* aside... */ + if (rv == APR_ENOTIMPL) { + const char *s; + apr_size_t n; + + rv = apr_bucket_read(e, &s, &n, APR_BLOCK_READ); + if (rv == APR_SUCCESS) { + rv = apr_bucket_setaside(e, p); + } + } + + if (rv != APR_SUCCESS) { return rv; } }