Return-Path: Delivered-To: apmail-httpd-apreq-dev-archive@www.apache.org Received: (qmail 93731 invoked from network); 25 Jul 2004 16:14:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Jul 2004 16:14:58 -0000 Received: (qmail 4825 invoked by uid 500); 25 Jul 2004 16:14:58 -0000 Delivered-To: apmail-httpd-apreq-dev-archive@httpd.apache.org Received: (qmail 4792 invoked by uid 500); 25 Jul 2004 16:14:57 -0000 Mailing-List: contact apreq-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list apreq-dev@httpd.apache.org Received: (qmail 4778 invoked by uid 99); 25 Jul 2004 16:14:57 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [195.154.174.52] (HELO mail.logilune.com) (195.154.174.52) by apache.org (qpsmtpd/0.27.1) with ESMTP; Sun, 25 Jul 2004 09:14:57 -0700 Received: from [127.0.0.1] (localhost.logilune.com [127.0.0.1]) by mail.logilune.com (Postfix) with ESMTP id 953C31E1980; Sun, 25 Jul 2004 18:14:54 +0200 (CEST) Message-ID: <4103DC74.6000907@stason.org> Date: Sun, 25 Jul 2004 09:14:44 -0700 From: Stas Bekman Organization: Hope, Humanized User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040708 X-Accept-Language: en-us, en, he, ru MIME-Version: 1.0 To: Joe Schaefer Cc: apreq-dev@httpd.apache.org Subject: Re: Issues with ->pool in CGI environment References: <877jst4470.fsf@gemini.sunstarsys.com> In-Reply-To: <877jst4470.fsf@gemini.sunstarsys.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Joe Schaefer wrote: > While working on Cookie.pod I came across > a problem with the ->pool methods. What happens > is that (in CGI context) because the environment > object is a pool created by APR::Pool, it is marked > for destruction via DESTROY. However methods like > $cookie->pool() and $upload->pool() generate new > objects that point to the same apr_pool_t, and when > those objects go away, that triggers the pool's > destruction. How about this solution. Have libapreq provide a pool class method, which will create a new pool, bypassing APR::Pool->new(), or sub-classing it. It should be safe in mod_cgi env, since the pool gets destroyed at the end of each run. In the mod_perl mode it should just return $r->pool instead, so the external API is identical. In fact you could completely eliminate the pool argument from all libapreq calls, and handle it internally. Instead $r should be passed if it's mod_perl, or something like that. -- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:stas@stason.org http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com