diff -rub POE-Component-Server-HTTP-0.04/HTTP.pm POE-Component-Server-HTTP-PG/HTTP.pm --- POE-Component-Server-HTTP-0.04/HTTP.pm 2003-10-09 08:43:36.000000000 -0400 +++ POE-Component-Server-HTTP-PG/HTTP.pm 2004-10-20 19:11:46.000000000 -0400 @@ -19,7 +19,7 @@ use Sys::Hostname qw(hostname); -$VERSION = 0.04; +$VERSION = 0.05; use POE::Component::Server::HTTP::Response; use POE::Component::Server::HTTP::Request; @@ -64,6 +64,7 @@ execute => \&execute, shutdown => sub { my ($kernel, $session, $heap) = @_[KERNEL, SESSION, HEAP]; + # warn "$$: http shutdown\n"; $kernel->call($alias . "TCP::" . $session->ID, "shutdown"); $kernel->alias_remove($alias . $session->ID); }, @@ -72,9 +73,13 @@ ); - POE::Component::Server::TCP->new( Port => $self->{Port}, Acceptor => sub { + POE::Component::Server::TCP->new( Port => $self->{Port}, + Alias=>$alias . "TCP::" . $session->ID, + Acceptor => sub { $poe_kernel->post($session,'accept',@_[ARG0,ARG1,ARG2]); }); + return {httpd=>$alias . $session->ID, + tcp=>$alias . "TCP::" . $session->ID}; } @@ -251,7 +256,7 @@ use POE::Component::Server::HTTP; use HTTP::Status; - $httpd = POE::Component::Server::HTTP->new( + $aliases = POE::Component::Server::HTTP->new( Port => 8000, ContentHandler => { '/' => \&handler }, Headers => { Server => 'My Server' }, @@ -264,7 +269,17 @@ return RC_OK; } - POE::Kernel->call($httpd, "shutdown"); + # get at the SocketFactory + my $tcp=POE::Kernel->alias_resolve($aliases->{tcp}); + die "Can't find session $alias" unless $tcp; + my $heap=$tcp->get_heap; + die "Can't get the heap from $tcp $alias" unless $heap; + die "$alias\'s heap doesn't have a listener!" + unless ref $heap->{listener}; + my $tcp_wheel=$heap->{listener}; + + # time to exit + POE::Kernel->call($aliases->{httpd}, "shutdown"); =head1 DESCRIPTION @@ -386,6 +401,8 @@ Arthur Bergman, arthur@contiller.se +Patched by Philip Gwyn, gwyn@cpan.org + Released under the same terms as POE. =cut diff -rub POE-Component-Server-HTTP-0.04/Makefile.PL POE-Component-Server-HTTP-PG/Makefile.PL --- POE-Component-Server-HTTP-0.04/Makefile.PL 2003-10-09 08:45:16.000000000 -0400 +++ POE-Component-Server-HTTP-PG/Makefile.PL 2004-10-20 18:35:18.000000000 -0400 @@ -10,6 +10,7 @@ 'lib/Response.pm' => '${INST_LIBDIR}/HTTP/Response.pm', 'HTTP.pm' => '${INST_LIBDIR}/HTTP.pm', }, + dist=>{COMPRESS=>'gzip -9f', EXT=>'gz'}, 'PREREQ_PM' => { POE => '0.27', File::Spec => 0,