r53826 - in /branches/upstream/libhttp-server-simple-psgi-perl: ./ current/ current/lib/ current/lib/HTTP/ current/lib/HTTP/Server/ current/lib/HTTP/Server/Simple/ current/t/ current/xt/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Sun Mar 7 03:25:22 UTC 2010
Author: jawnsy-guest
Date: Sun Mar 7 03:25:14 2010
New Revision: 53826
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=53826
Log:
[svn-inject] Installing original source of libhttp-server-simple-psgi-perl
Added:
branches/upstream/libhttp-server-simple-psgi-perl/
branches/upstream/libhttp-server-simple-psgi-perl/current/
branches/upstream/libhttp-server-simple-psgi-perl/current/.gitignore
branches/upstream/libhttp-server-simple-psgi-perl/current/Changes
branches/upstream/libhttp-server-simple-psgi-perl/current/MANIFEST
branches/upstream/libhttp-server-simple-psgi-perl/current/META.yml
branches/upstream/libhttp-server-simple-psgi-perl/current/Makefile.PL
branches/upstream/libhttp-server-simple-psgi-perl/current/README
branches/upstream/libhttp-server-simple-psgi-perl/current/lib/
branches/upstream/libhttp-server-simple-psgi-perl/current/lib/HTTP/
branches/upstream/libhttp-server-simple-psgi-perl/current/lib/HTTP/Server/
branches/upstream/libhttp-server-simple-psgi-perl/current/lib/HTTP/Server/Simple/
branches/upstream/libhttp-server-simple-psgi-perl/current/lib/HTTP/Server/Simple/PSGI.pm
branches/upstream/libhttp-server-simple-psgi-perl/current/t/
branches/upstream/libhttp-server-simple-psgi-perl/current/t/00_compile.t
branches/upstream/libhttp-server-simple-psgi-perl/current/xt/
branches/upstream/libhttp-server-simple-psgi-perl/current/xt/perlcritic.t
branches/upstream/libhttp-server-simple-psgi-perl/current/xt/pod.t
branches/upstream/libhttp-server-simple-psgi-perl/current/xt/podspell.t
branches/upstream/libhttp-server-simple-psgi-perl/current/xt/synopsis.t
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/.gitignore
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/.gitignore?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/.gitignore (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/.gitignore Sun Mar 7 03:25:14 2010
@@ -1,0 +1,5 @@
+META.yml
+Makefile
+inc/
+pm_to_blib
+*~
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/Changes?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/Changes (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/Changes Sun Mar 7 03:25:14 2010
@@ -1,0 +1,28 @@
+Revision history for Perl extension HTTP::Server::Simple::PSGI
+
+0.14 Thu Feb 18 10:26:16 PST 2010
+ - Upped HTTP::Server::Simple dependency
+
+0.13 Thu Feb 18 03:32:49 PST 2010
+ - Support perl 5.005 and 5.6!
+
+0.12 Mon Feb 15 23:57:59 PST 2010
+ - Removed unused modules
+ - Added experimental psgix.io support
+
+0.11 Thu Feb 4 12:16:58 PST 2010
+ - Changed the API to work just like HTTP::Server::Simple::PSGI
+ - Moved the code to adapt to Plack::Handler interface to Plack core
+
+0.10 Thu Feb 4 10:38:06 PST 2010
+ - Renamed the distribution to HTTP::Server::Simple::PSGI
+ - Dropped Plack and LWP dependencies
+
+0.03 Tue Jan 5 05:22:04 PST 2010
+ - Added psgi.streaming support (rafl)
+
+0.02 Mon Oct 19 19:31:35 PDT 2009
+ - Bump up HTTP::Server::Simple req to fix the multi header bug
+
+0.01 Mon Oct 12 23:57:08 2009
+ - original version
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/MANIFEST?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/MANIFEST (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/MANIFEST Sun Mar 7 03:25:14 2010
@@ -1,0 +1,12 @@
+.gitignore
+Changes
+lib/HTTP/Server/Simple/PSGI.pm
+Makefile.PL
+MANIFEST This list of files
+META.yml
+README
+t/00_compile.t
+xt/perlcritic.t
+xt/pod.t
+xt/podspell.t
+xt/synopsis.t
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/META.yml?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/META.yml (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/META.yml Sun Mar 7 03:25:14 2010
@@ -1,0 +1,21 @@
+--- #YAML:1.0
+name: HTTP-Server-Simple-PSGI
+version: 0.14
+abstract: ~
+author: []
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires:
+ HTTP::Server::Simple: 0.42
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.54
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/Makefile.PL?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/Makefile.PL (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/Makefile.PL Sun Mar 7 03:25:14 2010
@@ -1,0 +1,9 @@
+use ExtUtils::MakeMaker;
+WriteMakefile(
+ NAME => 'HTTP::Server::Simple::PSGI',
+ VERSION_FROM => "lib/HTTP/Server/Simple/PSGI.pm",
+ PREREQ_PM => {
+ 'HTTP::Server::Simple' => 0.42,
+ $] < 5.006 ? ('warnings::compat' => 0) : (),
+ },
+);
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/README?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/README (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/README Sun Mar 7 03:25:14 2010
@@ -1,0 +1,30 @@
+NAME
+ HTTP::Server::Simple::PSGI - PSGI handler for HTTP::Server::Simple
+
+SYNOPSIS
+ use HTTP::Server::Simple::PSGI;
+
+ my $server = HTTP::Server::Simple::PSGI->new($port);
+ $server->host($host);
+ $server->app($app);
+ $server->run;
+
+DESCRIPTION
+ HTTP::Server::Simple::PSGI is a HTTP::Server::Simple based HTTP server
+ that can run PSGI applications. This module only depends on
+ HTTP::Server::Simple, which itself doesn't depend on any non-core
+ modules so it's best to be used as an embedded web server.
+
+AUTHOR
+ Tokuhiro Matsuno
+
+ Kazuhiro Osawa
+
+ Tatsuhiko Miyagawa
+
+LICENSE
+ This module is licensed under the same terms as Perl itself.
+
+SEE ALSO
+ HTTP::Server::Simple, Plack, HTTP::Server::PSGI
+
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/lib/HTTP/Server/Simple/PSGI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/lib/HTTP/Server/Simple/PSGI.pm?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/lib/HTTP/Server/Simple/PSGI.pm (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/lib/HTTP/Server/Simple/PSGI.pm Sun Mar 7 03:25:14 2010
@@ -1,0 +1,199 @@
+package HTTP::Server::Simple::PSGI;
+use strict;
+use 5.005_03;
+use vars qw($VERSION);
+$VERSION = '0.14';
+
+use base qw/HTTP::Server::Simple::CGI/;
+
+# copied from HTTP::Status
+my %StatusCode = (
+ 100 => 'Continue',
+ 101 => 'Switching Protocols',
+ 102 => 'Processing', # RFC 2518 (WebDAV)
+ 200 => 'OK',
+ 201 => 'Created',
+ 202 => 'Accepted',
+ 203 => 'Non-Authoritative Information',
+ 204 => 'No Content',
+ 205 => 'Reset Content',
+ 206 => 'Partial Content',
+ 207 => 'Multi-Status', # RFC 2518 (WebDAV)
+ 300 => 'Multiple Choices',
+ 301 => 'Moved Permanently',
+ 302 => 'Found',
+ 303 => 'See Other',
+ 304 => 'Not Modified',
+ 305 => 'Use Proxy',
+ 307 => 'Temporary Redirect',
+ 400 => 'Bad Request',
+ 401 => 'Unauthorized',
+ 402 => 'Payment Required',
+ 403 => 'Forbidden',
+ 404 => 'Not Found',
+ 405 => 'Method Not Allowed',
+ 406 => 'Not Acceptable',
+ 407 => 'Proxy Authentication Required',
+ 408 => 'Request Timeout',
+ 409 => 'Conflict',
+ 410 => 'Gone',
+ 411 => 'Length Required',
+ 412 => 'Precondition Failed',
+ 413 => 'Request Entity Too Large',
+ 414 => 'Request-URI Too Large',
+ 415 => 'Unsupported Media Type',
+ 416 => 'Request Range Not Satisfiable',
+ 417 => 'Expectation Failed',
+ 422 => 'Unprocessable Entity', # RFC 2518 (WebDAV)
+ 423 => 'Locked', # RFC 2518 (WebDAV)
+ 424 => 'Failed Dependency', # RFC 2518 (WebDAV)
+ 425 => 'No code', # WebDAV Advanced Collections
+ 426 => 'Upgrade Required', # RFC 2817
+ 449 => 'Retry with', # unofficial Microsoft
+ 500 => 'Internal Server Error',
+ 501 => 'Not Implemented',
+ 502 => 'Bad Gateway',
+ 503 => 'Service Unavailable',
+ 504 => 'Gateway Timeout',
+ 505 => 'HTTP Version Not Supported',
+ 506 => 'Variant Also Negotiates', # RFC 2295
+ 507 => 'Insufficient Storage', # RFC 2518 (WebDAV)
+ 509 => 'Bandwidth Limit Exceeded', # unofficial
+ 510 => 'Not Extended', # RFC 2774
+);
+
+sub app {
+ my $self = shift;
+ $self->{psgi_app} = shift if @_;
+ $self->{psgi_app};
+}
+
+sub handler {
+ my $self = shift;
+
+ my $env = {
+ CONTENT_LENGTH => $ENV{CONTENT_LENGTH},
+ CONTENT_TYPE => $ENV{CONTENT_TYPE},
+ SCRIPT_NAME => '',
+ REQUEST_METHOD => $ENV{REQUEST_METHOD},
+ PATH_INFO => $ENV{PATH_INFO},
+ QUERY_STRING => $ENV{QUERY_STRING},
+ REQUEST_URI => $ENV{REQUEST_URI},
+ SERVER_NAME => $ENV{SERVER_NAME},
+ SERVER_PORT => $ENV{SERVER_PORT},
+ SERVER_PROTOCOL => $ENV{SERVER_PROTOCOL},
+ REMOTE_ADDR => $ENV{REMOTE_ADDR},
+ HTTP_COOKIE => $ENV{COOKIE}, # HTTP::Server::Simple bug
+ 'psgi.version' => [1,1],
+ 'psgi.url_scheme' => 'http',
+ 'psgi.input' => $self->stdin_handle,
+ 'psgi.errors' => *STDERR,
+ 'psgi.multithread' => 0,
+ 'psgi.multiprocess' => 0,
+ 'psgi.run_once' => 0,
+ 'psgi.streaming' => 1,
+ 'psgi.nonblocking' => 0,
+ 'psgix.io' => $self->stdio_handle,
+ };
+
+ while (my ($k, $v) = each %ENV) {
+ $env->{$k} = $v if $k =~ /^HTTP_/;
+ }
+
+ my $res = eval { $self->{psgi_app}->($env) }
+ || [ 500, [ 'Content-Type', 'text/plain' ], [ "Internal Server Error" ] ];
+
+ if (ref $res eq 'ARRAY') {
+ $self->_handle_response($res);
+ } elsif (ref $res eq 'CODE') {
+ $res->(sub {
+ $self->_handle_response($_[0]);
+ });
+ } else {
+ die "Bad response $res";
+ }
+}
+
+sub _handle_response {
+ my ($self, $res) = @_;
+
+ my $message = $StatusCode{$res->[0]};
+
+ my $response = "HTTP/1.0 $res->[0] $message\015\012";
+ my $headers = $res->[1];
+ while (my ($k, $v) = splice(@$headers, 0, 2)) {
+ $response .= "$k: $v\015\012";
+ }
+ $response .= "\015\012";
+
+ print STDOUT $response;
+
+ my $body = $res->[2];
+ my $cb = sub { print STDOUT $_[0] };
+
+ if (defined $body) {
+ if (ref $body eq 'ARRAY') {
+ for my $line (@$body) {
+ $cb->($line) if length $line;
+ }
+ } else {
+ local $/ = \65536 unless ref $/;
+ while (defined(my $line = $body->getline)) {
+ $cb->($line) if length $line;
+ }
+ $body->close;
+ }
+ } else {
+ return HTTP::Server::Simple::PSGI::Writer->new($cb);
+ }
+}
+
+package HTTP::Server::Simple::PSGI::Writer;
+
+sub new { bless $_[1], $_[0] }
+sub write { $_[0]->($_[1]) }
+sub close { }
+
+package HTTP::Server::Simple::PSGI;
+
+1;
+
+__END__
+
+=head1 NAME
+
+HTTP::Server::Simple::PSGI - PSGI handler for HTTP::Server::Simple
+
+=head1 SYNOPSIS
+
+ use HTTP::Server::Simple::PSGI;
+
+ my $server = HTTP::Server::Simple::PSGI->new($port);
+ $server->host($host);
+ $server->app($app);
+ $server->run;
+
+=head1 DESCRIPTION
+
+HTTP::Server::Simple::PSGI is a HTTP::Server::Simple based HTTP server
+that can run PSGI applications. This module only depends on
+L<HTTP::Server::Simple>, which itself doesn't depend on any non-core
+modules so it's best to be used as an embedded web server.
+
+=head1 AUTHOR
+
+Tokuhiro Matsuno
+
+Kazuhiro Osawa
+
+Tatsuhiko Miyagawa
+
+=head1 LICENSE
+
+This module is licensed under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+L<HTTP::Server::Simple>, L<Plack>, L<HTTP::Server::PSGI>
+
+=cut
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/t/00_compile.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/t/00_compile.t?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/t/00_compile.t (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/t/00_compile.t Sun Mar 7 03:25:14 2010
@@ -1,0 +1,4 @@
+use strict;
+use Test::More tests => 1;
+
+BEGIN { use_ok 'HTTP::Server::Simple::PSGI' }
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/xt/perlcritic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/xt/perlcritic.t?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/xt/perlcritic.t (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/xt/perlcritic.t Sun Mar 7 03:25:14 2010
@@ -1,0 +1,5 @@
+use strict;
+use Test::More;
+eval q{ use Test::Perl::Critic };
+plan skip_all => "Test::Perl::Critic is not installed." if $@;
+all_critic_ok("lib");
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/xt/pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/xt/pod.t?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/xt/pod.t (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/xt/pod.t Sun Mar 7 03:25:14 2010
@@ -1,0 +1,4 @@
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/xt/podspell.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/xt/podspell.t?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/xt/podspell.t (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/xt/podspell.t Sun Mar 7 03:25:14 2010
@@ -1,0 +1,9 @@
+use Test::More;
+eval q{ use Test::Spelling };
+plan skip_all => "Test::Spelling is not installed." if $@;
+add_stopwords(<DATA>);
+set_spell_cmd("aspell -l en list");
+all_pod_files_spelling_ok('lib');
+__DATA__
+Tatsuhiko
+Miyagawa
Added: branches/upstream/libhttp-server-simple-psgi-perl/current/xt/synopsis.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-server-simple-psgi-perl/current/xt/synopsis.t?rev=53826&op=file
==============================================================================
--- branches/upstream/libhttp-server-simple-psgi-perl/current/xt/synopsis.t (added)
+++ branches/upstream/libhttp-server-simple-psgi-perl/current/xt/synopsis.t Sun Mar 7 03:25:14 2010
@@ -1,0 +1,4 @@
+use Test::More;
+eval "use Test::Synopsis";
+plan skip_all => "Test::Synopsis required" if $@;
+all_synopsis_ok();
More information about the Pkg-perl-cvs-commits
mailing list