Skip to content

Commit

Permalink
Implemented --disable-keepalive. This needs Plack's git 596709 commit…
Browse files Browse the repository at this point in the history
… on plackup command line options. Fixes gh-3.
  • Loading branch information
miyagawa committed Mar 27, 2010
1 parent 1794a8d commit d151386
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Starman/Server.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ sub run {
if ( $options->{daemonize} ) {
$extra{setsid} = $extra{background} = 1;
}
if (! exists $options->{keepalive}) {
$options->{keepalive} = 1;
}

my($host, $port, $proto);
for my $listen (@{$options->{listen} || [ "$options->{host}:$options->{port}" ]}) {
Expand Down Expand Up @@ -195,6 +198,11 @@ sub process_request {
}
}

unless ($self->{options}->{keepalive}) {
DEBUG && warn "[$$] keep-alive is disabled. Closing the connection after this request\n";
$self->{client}->{keepalive} = 0;
}

$self->_prepare_env($env);

# Run PSGI apps
Expand Down

0 comments on commit d151386

Please sign in to comment.