Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 17144 invoked from network); 10 May 2005 19:29:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 May 2005 19:29:27 -0000 Received: (qmail 53619 invoked by uid 500); 10 May 2005 19:32:44 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 53595 invoked by uid 500); 10 May 2005 19:32:43 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 53581 invoked by uid 99); 10 May 2005 19:32:43 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of mark@immermail.com designates 207.8.226.5 as permitted sender) Received: from orb.pobox.com (HELO orb.pobox.com) (207.8.226.5) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 10 May 2005 12:32:43 -0700 Received: from orb (localhost [127.0.0.1]) by orb.pobox.com (Postfix) with ESMTP id 08F7892C; Tue, 10 May 2005 15:29:04 -0400 (EDT) Received: from [192.168.1.2] (adsl-63-195-70-242.dsl.snfc21.pacbell.net [63.195.70.242]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by orb.sasl.smtp.pobox.com (Postfix) with ESMTP id E38908E; Tue, 10 May 2005 15:29:00 -0400 (EDT) Message-ID: <42810B07.2050809@immermail.com> Date: Tue, 10 May 2005 12:27:03 -0700 From: Mark User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stas Bekman Cc: Mark , modperl@perl.apache.org Subject: Re: [MP2] : REDIRECT_ERROR_NOTES not set on errordocument redirect References: <42711D0E.9060501@immermail.com> <427720B2.5020802@stason.org> In-Reply-To: <427720B2.5020802@stason.org> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Stas Bekman wrote: > Mark wrote: > >> -------------8<---------- Start Bug Report ------------8<---------- >> 1. Problem Description: >> >> $ENV{REDIRECT_ERROR_NOTES} not working with MP2 >> >> Using latest everything (modperl 2 RC5). >> >> >> To illustrate, I simply configure Apache with an errordocument: >> >> ErrorDocument 500 /cgi/printenv >> >> I have a perl-scripts configured like this: >> >> >> Options ExecCGI >> SetHandler perl-script >> PerlResponseHandler ModPerl::Registry >> PerlOptions +ParseHeaders >> >> >> And a script the generates an error: >> >> #/usr/bin/perl >> barf(); >> >> >> The errordocument 'printenv' output shows REDIRECT_ERROR_NOTES empty. >> >> When the identical barf script is run under CGI (script-alias), >> REDIRECT_ERROR_NOTES >> has an error message. >> >> >> I fooled around with more complex examples, accessing ARP table >> 'error-notes' and >> that is also empty. > > > because you are in the sub request. the value is set in $r->main > 'error-notes' table. I wonder why the sub-request doesn't see it. Sorry, I wasn't clear about that. In my tests using APR table, I did look at the previous request, which is where I expected to find the error-notes. Here's my handler: sub handler { my $r = shift; my $pr = $r->prev; $r->content_type('text/plain'); # dump out the previous request's notes table my $table = $pr->notes; foreach my $key (keys %{$table}) { printf "$key = '%s'\n", $table->{$key}; } ... > Also I wonder if we should adjust in ModPerl::RegistryCooker: > > sub log_error { > my($self, $msg) = @_; > my $class = ref $self; > > - $self->{REQ}->log_error($msg); > - $self->{REQ}->notes->set('error-notes' => $msg); > + $self->{REQ}->log_rerror($msg); > $@{$self->{URI}} = $msg; > } > > which is supposed to do that same in one call. Any difference with the > above change? With this in place (which I admit I don't understand) error-notes is now populated, but maybe the wrong stack frame or something, since the error text is not the actual error from the original request. I will study this further, maybe this is somehow my problem? > what Apache is that? Server version: Apache/2.0.53 Thanks, Mark