[Catalyst-commits] r6205 - in trunk/Catalyst-Runtime: . lib/Catalyst/Engine

andyg at dev.catalyst.perl.org andyg at dev.catalyst.perl.org
Mon Mar 26 20:06:49 GMT 2007


Author: andyg
Date: 2007-03-26 20:06:13 +0100 (Mon, 26 Mar 2007)
New Revision: 6205

Modified:
   trunk/Catalyst-Runtime/Changes
   trunk/Catalyst-Runtime/lib/Catalyst/Engine/HTTP.pm
Log:
Support SIGHUP in the HTTP engine

Modified: trunk/Catalyst-Runtime/Changes
===================================================================
--- trunk/Catalyst-Runtime/Changes	2007-03-26 17:18:19 UTC (rev 6204)
+++ trunk/Catalyst-Runtime/Changes	2007-03-26 19:06:13 UTC (rev 6205)
@@ -1,6 +1,7 @@
 This file documents the revision history for Perl extension Catalyst.
 
 5.7008  XXXX-XX-XX
+        - Sending SIGHUP to the dev server will now cause it to restart.
         - Allow "0" for a path in uri_for.
         - Performance improvements to uri_for by inlining encoding.
         - Updated HTTP::Body dependency to 0.8 to handle the case where IE sometimes

Modified: trunk/Catalyst-Runtime/lib/Catalyst/Engine/HTTP.pm
===================================================================
--- trunk/Catalyst-Runtime/lib/Catalyst/Engine/HTTP.pm	2007-03-26 17:18:19 UTC (rev 6204)
+++ trunk/Catalyst-Runtime/lib/Catalyst/Engine/HTTP.pm	2007-03-26 19:06:13 UTC (rev 6205)
@@ -244,6 +244,12 @@
     # Ignore broken pipes as an HTTP server should
     local $SIG{PIPE} = 'IGNORE';
     
+    # Restart on HUP
+    local $SIG{HUP} = sub { 
+        $restart = 1;
+        warn "Restarting server on SIGHUP...\n";
+    };
+    
     LISTEN:
     while ( !$restart ) {
         while ( accept( Remote, $daemon ) ) {        




More information about the Catalyst-commits mailing list