Skip to content

Commit

Permalink
Move the Net::Server arg parsing into Plack::Handler::Starman, for sc…
Browse files Browse the repository at this point in the history
…riptability purposes. References GH Issue #109.
  • Loading branch information
holophrastic committed Feb 18, 2015
1 parent b7be0da commit 357e6c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 7 additions & 0 deletions lib/Plack/Handler/Starman.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ sub run {
@Starman::Server::ISA = qw(Net::Server::SS::PreFork); # Yikes.
}

# parse Net::Server args that we want to go down the chain
foreach my $opt ( keys %$self ) {
next unless $opt =~ /^net_server_(\w++)/;
my $nsopt = $1;
$self->{net_server_args}->{$nsopt} = $self->{$opt};
}

Starman::Server->new->run($app, {%$self});
}

Expand Down
8 changes: 2 additions & 6 deletions lib/Starman/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ sub run {
$self->{options} = $options;

my %extra = ();

# grab any parameters intended for Net::Server
foreach my $opt ( keys %$options ) {
next unless $opt =~ /^net_server_(\w++)/;
my $nsopt = $1;
$extra{$nsopt} = $options->{$opt};
if(defined($options->{net_server_args})) {
%extra = %{ $options->{net_server_args} };
}

if ( $options->{pid} ) {
Expand Down

0 comments on commit 357e6c4

Please sign in to comment.