[Rt-commit] r3671 - HTTP-Server-Simple-Mason/lib/HTTP/Server/Simple

glasser at bestpractical.com glasser at bestpractical.com
Thu Aug 18 13:47:38 EDT 2005


Author: glasser
Date: Thu Aug 18 13:47:38 2005
New Revision: 3671

Modified:
   HTTP-Server-Simple-Mason/lib/HTTP/Server/Simple/Mason.pm
Log:
Keep our header-sent flag on $r, not $m, since the latter was not actually around all the time.

Modified: HTTP-Server-Simple-Mason/lib/HTTP/Server/Simple/Mason.pm
==============================================================================
--- HTTP-Server-Simple-Mason/lib/HTTP/Server/Simple/Mason.pm	(original)
+++ HTTP-Server-Simple-Mason/lib/HTTP/Server/Simple/Mason.pm	Thu Aug 18 13:47:38 2005
@@ -39,13 +39,13 @@
 use Hook::LexWrap;
 
 wrap 'HTML::Mason::FakeApache::send_http_header', pre => sub {
-    # If we've already sent the HTTP header, don't try to again.
-    if (HTML::Mason::Request->instance->{'http_header_sent'}) {$_[-1] = "1"; return;};
-
     my $r = shift;
+
+    # If we've already sent the HTTP header, don't try to again.
+    if ($r->{'_hssm_http_header_sent'}) {$_[-1] = "1"; return;};
     my $status = $r->header_out('Status') || '200 H::S::Mason OK';
     print STDOUT "HTTP/1.0 $status\n";
-    HTML::Mason::Request->instance->{'http_header_sent'} = 1;
+    $r->{'_hssm_http_header_sent'} = 1;
 };
 
 =head2 mason_handler 
@@ -134,7 +134,7 @@
             # Send headers if they have not been sent by us or by user.
             # We use instance here because if we store $request we get a
             # circular reference and a big memory leak.
-                unless ($m->{'http_header_sent'}) {
+                unless ($r->{'_hssm_http_header_sent'}) {
                        $r->send_http_header();
                 }
             {


More information about the Rt-commit mailing list