Support SIGHUP in the HTTP engine
Andy Grundman [Mon, 26 Mar 2007 19:06:13 +0000 (19:06 +0000)]
Changes
lib/Catalyst/Engine/HTTP.pm

diff --git a/Changes b/Changes
index ef32e71..bad9b4f 100644 (file)
--- a/Changes
+++ b/Changes
@@ -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
index b320a3d..1bc26b1 100644 (file)
@@ -244,6 +244,12 @@ sub run {
     # 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 ) ) {