Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented --disable-keepalive. This needs Plack's git 596709 commit…

… on plackup command line options. Fixes gh-3.
  • Loading branch information...
commit d15138699e50979013db9d0e5daeb42b6d486b1f 1 parent 1794a8d
Tatsuhiko Miyagawa authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/Starman/Server.pm
8 lib/Starman/Server.pm
View
@@ -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}" ]}) {
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.