require Catalyst::Engine::HTTP::Restarter;
require Catalyst::Engine::HTTP::Restarter::Watcher;
-sub CHUNKSIZE () { 64 * 1024 }
-
-sub DEBUG () { $ENV{CATALYST_HTTP_DEBUG} || 0 }
+use constant CHUNKSIZE => 64 * 1024;
+use constant DEBUG => $ENV{CATALYST_HTTP_DEBUG} || 0;
=head1 NAME
# 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 ) ) {