Skip Menu |

This queue is for tickets about the POE-Component-Server-HTTP CPAN distribution.

Report information
The Basics
Id: 18775
Status: resolved
Priority: 0/
Queue: POE-Component-Server-HTTP

People
Owner: Nobody in particular
Requestors: la [...] fch.de
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: Server dies after sending first HTTP-Response
After updating POE to the latest Version (0.3401) the HTTP-Server dies after serving the first Request with Can't coerce array into hash at [...]/POE/Component/Server/HTTP.pm line 362. Could be reproduced with the attached test.pl (from pod)
Subject: test.pl
#!/usr/bin/env perl use POE::Component::Server::HTTP; use HTTP::Status; my $aliases = POE::Component::Server::HTTP->new( Port => 8000, ContentHandler => { '/' => \&handler, }, Headers => { Server => 'My Server' }, ); sub handler { my ($request, $response) = @_; $response->code(RC_OK); $response->content("Hi, you fetched ". $request->uri); return RC_OK; } POE::Kernel->run();
module works with poe versions < 0.3301
with poe >= 0.3301 it is broken :-(
From: Kirill Miazine <km [...] krot.org>
On Tue Apr 18 11:50:18 2006, guest wrote: Show quoted text
> After updating POE to the latest Version (0.3401) the HTTP-Server dies > after serving the first Request with > > Can't coerce array into hash at [...]/POE/Component/Server/HTTP.pm
line 362. Show quoted text
> > Could be reproduced with the attached test.pl (from pod)
Oh well, this is what happens when people break encapsulation... The attached patch should solve the problem. It's still a hack, though. And it still breaks encapsulation. Greetz, Kirill
--- HTTP.pm Thu May 18 08:50:47 2006 +++ /local/perl/lib/site_perl/5.8.8/POE/Component/Server/HTTP.pm Thu May 18 08:44:13 2006 @@ -359,9 +359,12 @@ # I'm probably going to burn for this violation # of encapsulation --richardc my $httpd_filter = $_[HEAP]{wheels}{$id}[2]; - %{ $httpd_filter } = ( type => 0, - buffer => '', - finish => 0 ); + @{ $httpd_filter } = ( '', # BUFFER + 0, # TYPE + 0, # FINISH + undef, # HEADER + undef, # CLIENT_PROTO + ); # IMHO, Queue should be set in 'input' --PG $handlers->{Queue} = $self->handler_queue; }