r72175 - in /branches/upstream/starman/current: ./ bin/ inc/Module/ inc/Module/Install/ inc/Test/ lib/ lib/Starman/ t/

ghedo-guest at users.alioth.debian.org ghedo-guest at users.alioth.debian.org
Sun Apr 3 16:34:44 UTC 2011


Author: ghedo-guest
Date: Sun Apr  3 16:34:31 2011
New Revision: 72175

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=72175
Log:
[svn-upgrade] new version starman (0.2010)

Added:
    branches/upstream/starman/current/t/findbin.psgi
    branches/upstream/starman/current/t/findbin.t
    branches/upstream/starman/current/t/rand.psgi
    branches/upstream/starman/current/t/rand.t
Removed:
    branches/upstream/starman/current/inc/Module/AutoInstall.pm
    branches/upstream/starman/current/inc/Module/Install/AutoInstall.pm
    branches/upstream/starman/current/inc/Module/Install/Include.pm
    branches/upstream/starman/current/inc/Test/
Modified:
    branches/upstream/starman/current/Changes
    branches/upstream/starman/current/MANIFEST
    branches/upstream/starman/current/META.yml
    branches/upstream/starman/current/Makefile.PL
    branches/upstream/starman/current/bin/starman
    branches/upstream/starman/current/lib/Starman.pm
    branches/upstream/starman/current/lib/Starman/Server.pm

Modified: branches/upstream/starman/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/Changes?rev=72175&op=diff
==============================================================================
--- branches/upstream/starman/current/Changes (original)
+++ branches/upstream/starman/current/Changes Sun Apr  3 16:34:31 2011
@@ -1,4 +1,12 @@
 Revision history for Perl extension Starman
+
+0.2010  Mon Mar 28 16:23:23 PDT 2011
+        - Fixed packaging. No changes.
+
+0.2009  Fri Mar 25 19:15:23 PDT 2011
+        - Requires Plack 0.9971 to support localizing $0 to fix the FindBin issues #7, #15, #18, #19
+        - Calls srand() automatically in the child init hook to avoid a fixed random seed #20
+        - Implemented --keepalive-timeout which defaults to 1 (acme)
 
 0.2008  Mon Feb 14 17:19:20 PST 2011
         - Documented that -E is automatically set to 'deployment' RT:61517 (timbunce)

Modified: branches/upstream/starman/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/MANIFEST?rev=72175&op=diff
==============================================================================
--- branches/upstream/starman/current/MANIFEST (original)
+++ branches/upstream/starman/current/MANIFEST Sun Apr  3 16:34:31 2011
@@ -1,14 +1,11 @@
 .gitignore
 bin/starman
 Changes
-inc/Module/AutoInstall.pm
 inc/Module/Install.pm
 inc/Module/Install/AuthorTests.pm
-inc/Module/Install/AutoInstall.pm
 inc/Module/Install/Base.pm
 inc/Module/Install/Can.pm
 inc/Module/Install/Fetch.pm
-inc/Module/Install/Include.pm
 inc/Module/Install/Makefile.pm
 inc/Module/Install/Metadata.pm
 inc/Module/Install/ReadmeFromPod.pm
@@ -16,8 +13,6 @@
 inc/Module/Install/Scripts.pm
 inc/Module/Install/Win32.pm
 inc/Module/Install/WriteAll.pm
-inc/Test/Builder/Module.pm
-inc/Test/Requires.pm
 lib/HTTP/Server/PSGI/Net/Server/PreFork.pm
 lib/Plack/Handler/Starman.pm
 lib/Starman.pm
@@ -28,6 +23,10 @@
 README
 t/00_compile.t
 t/chunked_req.t
+t/findbin.psgi
+t/findbin.t
+t/rand.psgi
+t/rand.t
 t/suite.t
 xt/perlcritic.t
 xt/pod.t

Modified: branches/upstream/starman/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/META.yml?rev=72175&op=diff
==============================================================================
--- branches/upstream/starman/current/META.yml (original)
+++ branches/upstream/starman/current/META.yml Sun Apr  3 16:34:31 2011
@@ -5,6 +5,7 @@
 build_requires:
   ExtUtils::MakeMaker: 6.42
   Test::More: 0
+  Test::Requires: 0
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
@@ -28,10 +29,11 @@
   HTTP::Parser::XS: 0
   HTTP::Status: 0
   Net::Server: 0.91
-  Plack: 0.9931
+  Plack: 0.9971
+  Test::TCP: 1.11
   parent: 0
   perl: 5.8.1
 resources:
   license: http://dev.perl.org/licenses/
   repository: git://github.com/miyagawa/Starman.git
-version: 0.2008
+version: 0.2010

Modified: branches/upstream/starman/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/Makefile.PL?rev=72175&op=diff
==============================================================================
--- branches/upstream/starman/current/Makefile.PL (original)
+++ branches/upstream/starman/current/Makefile.PL Sun Apr  3 16:34:31 2011
@@ -8,19 +8,18 @@
 all_from 'lib/Starman.pm';
 readme_from 'lib/Starman.pm';
 build_requires 'Test::More';
-requires 'Plack', 0.9931;
+requires 'Plack', 0.9971;
 requires 'Net::Server', 0.91;
 requires 'Data::Dump';
 requires 'HTTP::Parser::XS';
 requires 'HTTP::Status';
 requires 'HTTP::Date';
 requires 'parent';
+requires 'Test::TCP', 1.11;
 install_script 'bin/starman';
 recommends 'Server::Starter';
 recommends 'Net::Server::SS::PreFork';
 test_requires 'Test::Requires';
-auto_include_deps;
-auto_install;
 author_tests('xt');
 auto_set_repository;
 WriteAll;

Modified: branches/upstream/starman/current/bin/starman
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/bin/starman?rev=72175&op=diff
==============================================================================
--- branches/upstream/starman/current/bin/starman (original)
+++ branches/upstream/starman/current/bin/starman Sun Apr  3 16:34:31 2011
@@ -137,6 +137,17 @@
 connections more than a number of backend workers (i.e. Apache
 mpm_prefork + mod_proxy).
 
+=item --keepalive-timeout
+
+The number of seconds Starman will wait for a subsequent request
+before closing the connection if Keep-alive persistent connections
+are enabled. Setting this to a high value may cause performance
+problems in heavily loaded servers. The higher the timeout, the
+more backend workers will be kept occupied waiting on connections
+with idle clients.
+
+Defaults to 1.
+
 =item --user
 
 To listen on a low-numbered (E<lt>1024) port, it will be necessary to
@@ -160,7 +171,10 @@
 
 =back
 
-See C<plackup -h> for more options.
+Starman passes through other options given to L<Plack::Runner>, the
+common backend that L<plackup> uses, so the most options explained in
+C<plackup -h> such as C<--access-log> or C<--daemonize> works fine in
+starman too.
 
 C<starman> command automatically sets the environment (C<-E>) to the value of I<deployment>.
 

Modified: branches/upstream/starman/current/lib/Starman.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/lib/Starman.pm?rev=72175&op=diff
==============================================================================
--- branches/upstream/starman/current/lib/Starman.pm (original)
+++ branches/upstream/starman/current/lib/Starman.pm Sun Apr  3 16:34:31 2011
@@ -2,7 +2,7 @@
 
 use strict;
 use 5.008_001;
-our $VERSION = '0.2008';
+our $VERSION = '0.2010';
 
 1;
 __END__

Modified: branches/upstream/starman/current/lib/Starman/Server.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/lib/Starman/Server.pm?rev=72175&op=diff
==============================================================================
--- branches/upstream/starman/current/lib/Starman/Server.pm (original)
+++ branches/upstream/starman/current/lib/Starman/Server.pm Sun Apr  3 16:34:31 2011
@@ -36,6 +36,9 @@
     }
     if (! exists $options->{keepalive}) {
         $options->{keepalive} = 1;
+    }
+    if (! exists $options->{keepalive_timeout}) {
+        $options->{keepalive_timeout} = 1;
     }
 
     my($host, $port, $proto);
@@ -104,6 +107,7 @@
 
 sub child_init_hook {
     my $self = shift;
+    srand();
     if ($self->{options}->{psgi_app_builder}) {
         DEBUG && warn "[$$] Initializing the PSGI app\n";
         $self->{app} = $self->{options}->{psgi_app_builder}->();
@@ -250,7 +254,7 @@
             DEBUG && warn "[$$] Waiting on previous connection for keep-alive request...\n";
 
             my $sel = IO::Select->new($conn);
-            last unless $sel->can_read(1);
+            last unless $sel->can_read($self->{options}->{keepalive_timeout});
         }
     }
 

Added: branches/upstream/starman/current/t/findbin.psgi
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/t/findbin.psgi?rev=72175&op=file
==============================================================================
--- branches/upstream/starman/current/t/findbin.psgi (added)
+++ branches/upstream/starman/current/t/findbin.psgi Sun Apr  3 16:34:31 2011
@@ -1,0 +1,6 @@
+use strict;
+use FindBin;
+sub {
+    my $env = shift;
+    return [ 200, [ "Content-Type", "text/plain" ], [ $FindBin::Bin ] ];
+};

Added: branches/upstream/starman/current/t/findbin.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/t/findbin.t?rev=72175&op=file
==============================================================================
--- branches/upstream/starman/current/t/findbin.t (added)
+++ branches/upstream/starman/current/t/findbin.t Sun Apr  3 16:34:31 2011
@@ -1,0 +1,20 @@
+use Test::TCP;
+use LWP::UserAgent;
+use FindBin;
+use Test::More;
+
+my $s = Test::TCP->new(
+    code => sub {
+        my $port = shift;
+        exec "$^X bin/starman --port $port --max-requests=1 --workers=1 $FindBin::Bin/findbin.psgi";
+    },
+);
+
+my $ua = LWP::UserAgent->new(timeout => 3);
+
+for (1..2) {
+    my $res = $ua->get("http://localhost:" . $s->port);
+    is $res->content, $FindBin::Bin;
+}
+
+done_testing;

Added: branches/upstream/starman/current/t/rand.psgi
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/t/rand.psgi?rev=72175&op=file
==============================================================================
--- branches/upstream/starman/current/t/rand.psgi (added)
+++ branches/upstream/starman/current/t/rand.psgi Sun Apr  3 16:34:31 2011
@@ -1,0 +1,5 @@
+rand(); # this initializes the random seed
+
+sub {
+    return [ 200, ["Content-Type", "text/plain"], [ rand(100) ] ];
+};

Added: branches/upstream/starman/current/t/rand.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/starman/current/t/rand.t?rev=72175&op=file
==============================================================================
--- branches/upstream/starman/current/t/rand.t (added)
+++ branches/upstream/starman/current/t/rand.t Sun Apr  3 16:34:31 2011
@@ -1,0 +1,28 @@
+use Test::TCP;
+use LWP::UserAgent;
+use FindBin;
+use Test::More;
+
+for (1..2) { # preload, non-preload
+    my $preload = $_ == 1 ? "--preload-app" : "";
+
+    my $s = Test::TCP->new(
+        code => sub {
+            my $port = shift;
+            exec "$^X bin/starman $preload --port $port --max-requests=1 --workers=1 $FindBin::Bin/rand.psgi";
+        },
+    );
+
+    my $ua = LWP::UserAgent->new;
+
+    my @res;
+    for (1..2) {
+        push @res, $ua->get("http://localhost:" . $s->port);
+    }
+
+    isnt $res[0]->content, $res[1]->content;
+
+    undef $s;
+}
+
+done_testing;




More information about the Pkg-perl-cvs-commits mailing list