[Rt-commit] r3664 - in HTTP-Server-Simple-Mason: . ex lib/HTTP/Server/Simple

jesse at bestpractical.com jesse at bestpractical.com
Wed Aug 17 13:34:13 EDT 2005


Author: jesse
Date: Wed Aug 17 13:34:12 2005
New Revision: 3664

Modified:
   HTTP-Server-Simple-Mason/Changes
   HTTP-Server-Simple-Mason/ex/sample_server.pl
   HTTP-Server-Simple-Mason/lib/HTTP/Server/Simple/Mason.pm
Log:
* Updates to work with Mason 1.30

Modified: HTTP-Server-Simple-Mason/Changes
==============================================================================
--- HTTP-Server-Simple-Mason/Changes	(original)
+++ HTTP-Server-Simple-Mason/Changes	Wed Aug 17 13:34:12 2005
@@ -1,3 +1,7 @@
+0.07 Wed Aug 17 13:28:35 EDT 2005
+
+* Updates to work correctly with Mason 1.30
+
 0.06 Mon Jul 25 18:49:23 EDT 2005
 
 * Doc fixes

Modified: HTTP-Server-Simple-Mason/ex/sample_server.pl
==============================================================================
--- HTTP-Server-Simple-Mason/ex/sample_server.pl	(original)
+++ HTTP-Server-Simple-Mason/ex/sample_server.pl	Wed Aug 17 13:34:12 2005
@@ -2,7 +2,7 @@
 use warnings;
 use strict;
 
-my $server = MyApp::Server->new();
+my $server = MyApp::Server->new( 8081);
 
 $server->run;
 

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	Wed Aug 17 13:34:12 2005
@@ -1,7 +1,7 @@
 package HTTP::Server::Simple::Mason;
 use base qw/HTTP::Server::Simple::CGI/;
 use strict;
-our $VERSION = '0.06';
+our $VERSION = '0.07';
 
 =head1 NAME
 
@@ -39,9 +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;
     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;
 };
 
 =head2 mason_handler 
@@ -130,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 ($r->http_header_sent) {
+                unless ($m->{'http_header_sent'}) {
                        $r->send_http_header();
                 }
             {


More information about the Rt-commit mailing list