[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mason
Subject:    [Mason] mason 0.6 - $INTERP->{stack} is never anything but
From:       Jonathan Swartz swartz () transbay ! net
Date:       1999-07-18 2:49:22
[Download RAW message or body]

Yep, $interp->exec definitely is not reentrant. However I plan to make it so
when I do the overhaul of Mason's component & execution implementation. 
(Basically a particular execution state must be a separate object from the 
interpreter itself.) It's the next thing on my list.

In the meantime you can fix this by creating a new set of Mason objects 
every time inside the handler() subroutine of handler.pl. Or, with a little
more
work, create new objects only when you know it is a subrequest.

Jon

At 12:21 PM 7/17/99 -0700, Randal L. Schwartz wrote:
>>>>>> "Randal" == Randal L Schwartz <merlyn@stonehenge.com> writes:
>
>Randal> and this breaks relative componenents (because $INTERP->locals
doesn't
>Randal> return a hashref).  Good thing all of mine were absolute before I
>Randal> upgraded. :(
>
>Nevermind... I've narrowed it down to a particular component:
>
>Calling this:
>
>    <& /.INCLUDE, file => 'HEADER.html' &>
>
>which invokes this:
>
>    <%perl_args>
>    $file => undef
>    $virtual => undef
>    </%perl_args>
>    <%perl>
>    use Apache::Constants qw(OK HTTP_OK);
>    my $subr;
>    if (defined $file) {
>      $subr = $r->lookup_file($file);
>    } elsif (defined $virtual) {
>      $subr = $r->lookup_uri($virtual);
>    }
>    my $status;
>    defined $subr and
>      do {
>	$subr->subprocess_env;
>	$subr->subprocess_env (DOCUMENT_URI => $r->uri);
>	($status = $subr->run) == OK;
>      }
>      or $r->print("[an error ($status) occurred while processing this 
directive]");
>    return;
>    </%perl>
>
>Resets $INTERP->{stack} to [].
>
>Ugh.  OK, I can fix it by *knowing* that the subrequest is a mason
>thing, but that means I can't run general subrequests without possibly
>hosing myself.
>
>It appears the Mason interpreter is not re-entrant?  Maybe you need a
>per-request interpreter pointer, stuffed into $r.
>
>:(
>
>-- 
>Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
>Keywords: Perl training, UNIX[tm] consulting, video production, skiing,
flying
>Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger 
merlyn@teleport.com)
>Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
>Quote: "I'm telling you, if I could have five lines in my .sig, I would!" 
-- me
>======================================================================
>To unsubscribe: echo unsubscribe | mail mason-request@netizen.com.au
>Charter/FAQ/Archive: http://www.netizen.com.au/resources/lists/mason/
> 



======================================================================
To unsubscribe: echo unsubscribe | mail mason-request@netizen.com.au
Charter/FAQ/Archive: http://www.netizen.com.au/resources/lists/mason/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic