From: Tomas Doran Date: Sat, 9 Jan 2010 16:43:25 +0000 (+0000) Subject: Correctly pass argv option into Catalyst::Engine::HTTP X-Git-Tag: 5.80017~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=30b7090311be68aa1d366c2314af426d24a8f0a3 Correctly pass argv option into Catalyst::Engine::HTTP --- diff --git a/Changes b/Changes index 82fc119..5ea6cc9 100644 --- a/Changes +++ b/Changes @@ -12,6 +12,11 @@ - Fix regression in the case where mod_rewrite is being used to rewrite requests into a path below your application base introduced with the %2F related fixes in 5.80014_02. + - Do not crash on SIGHUP if Catalyst::Engine::HTTP->run is not passed the + argv key in the options hash. + - Correctly pass the arguments to Catalyst::Script::Server through to + Catalyst::Engine::HTTP->run so that the server can restart itself + with the correct options on SIGHUP. Cleanups: - Stop suppressing warnings from Class::C3::Adopt::NEXT now that most plugins diff --git a/lib/Catalyst/Engine/HTTP.pm b/lib/Catalyst/Engine/HTTP.pm index 62c5d0b..7f01795 100644 --- a/lib/Catalyst/Engine/HTTP.pm +++ b/lib/Catalyst/Engine/HTTP.pm @@ -339,7 +339,7 @@ sub run { use Config; $ENV{PERL5LIB} .= join $Config{path_sep}, @INC; - exec $^X, $0, @{ $options->{argv} }; + exec $^X, $0, @{ $options->{argv} || [] }; } exit; diff --git a/lib/Catalyst/Script/Server.pm b/lib/Catalyst/Script/Server.pm index 4fc199b..e1f1049 100644 --- a/lib/Catalyst/Script/Server.pm +++ b/lib/Catalyst/Script/Server.pm @@ -190,6 +190,7 @@ sub _application_args { $self->port, $self->host, { + argv => $self->ARGV, map { $_ => $self->$_ } qw/ fork keepalive diff --git a/t/aggregate/unit_core_script_server.t b/t/aggregate/unit_core_script_server.t index c75cec6..b9ad60b 100644 --- a/t/aggregate/unit_core_script_server.t +++ b/t/aggregate/unit_core_script_server.t @@ -89,6 +89,8 @@ sub testOption { }; # First element of RUN_ARGS will be the script name, which we don't care about shift @TestAppToTestScripts::RUN_ARGS; + # Mangle argv into the options.. + $resultarray->[-1]->{argv} = $argstring; is_deeply \@TestAppToTestScripts::RUN_ARGS, $resultarray, "is_deeply comparison " . join(' ', @$argstring); }