Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: DMITRI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.23
Fixed in: (no value)



Subject: Bad HTTP input crashes the server.
Bad HTTP input causes the server to crash. The following error is printed: Did not get DONE/CLOSE event for Wheel ID 3 from IP 127.0.0.1 at /usr/local/lib/perl5/site_perl/5.8.7/POE/Component/Server/SimpleHTTP.pm line 275. Tried to send a response to the same connection twice! at /usr/local/lib/perl5/site_perl/5.8.7/POE/Component/Server/SimpleHTTP.pm line 857. The test case server code is attached. To reproduce, send the following (note how "GET" is spelled): [dmitri@workstation ~]$ telnet localhost 8099 Trying 127.0.0.1... Connected to localhost.localdomain (127.0.0.1). Escape character is '^]'. GEt /hello.html HTTP/1.0 Connection closed by foreign host.
Subject: simple-http-test.txt
use POE qw(Component::Server::SimpleHTTP); POE::Component::Server::SimpleHTTP->new( 'ALIAS' => 'SimpleHTTP', 'ADDRESS' => '0.0.0.0', 'PORT' => 8099, 'HANDLERS' => [ { 'DIR' => qr/^\/hello\.html$/, 'SESSION' => 'HTTPD', 'EVENT' => 'hello', }, ], ) or die 'Unable to create the HTTP Server'; POE::Session->create( inline_states => { '_start' => sub { $_[KERNEL]->alias_set('HTTPD') }, 'hello' => \&handle_hello, 'not_found' => \&handle_not_found, }, ); sub handle_hello { my ( $request, $response, $dirmatch ) = @_[ ARG0 .. ARG2 ]; $response->code(200); $response->content("Hello\n"); $_[KERNEL]->post('SimpleHTTP', 'DONE', $response ); } $poe_kernel->run;
From: mbailey [...] cpan.org
Looking into this now, thank you for your report. _Marlon_ aka. avinash240 On Fri Apr 27 11:31:03 2007, DMITRI wrote: Show quoted text
> Bad HTTP input causes the server to crash. The following error is
printed: Show quoted text
> > Did not get DONE/CLOSE event for Wheel ID 3 from IP 127.0.0.1 at > /usr/local/lib/perl5/site_perl/5.8.7/POE/Component/Server/SimpleHTTP.pm > line 275. > Tried to send a response to the same connection twice! at > /usr/local/lib/perl5/site_perl/5.8.7/POE/Component/Server/SimpleHTTP.pm > line 857. > > The test case server code is attached. To reproduce, send the following > (note how "GET" is spelled): > > [dmitri@workstation ~]$ telnet localhost 8099 > Trying 127.0.0.1... > Connected to localhost.localdomain (127.0.0.1). > Escape character is '^]'. > GEt /hello.html HTTP/1.0 > > Connection closed by foreign host.
From: mbailey [...] cpan.org
This is an issue with POE::Wheel::ReadWrite and POE::Filter::HTTPD. SimpleHTTP listens for an event generated for each request over the socket with the above pair, and assumes it will get one event for one request. However in the case of the failing bad request, it receives two events(inputs) both attached to the same request, this is causing the error. A failing test case has been submitted to trunk and the maintainer of POE::Filter::HTTPD and POE::Wheel::ReadWrite have been notified. If a fix is not produced within reasonable limits..we may modify SimpleHTTP to work around this error, but that is not the preferred solution, so we'll work on submitting a failing test case for the POE::Wheel::ReadWrite/POE::Filter::HTTPD/Bad Request combo. -avinash240
From: mbailey [...] cpan.org
This has been fixed in the new version of POE. It is available in POE's svn trunk https://poe.svn.sourceforge.net/svnroot/poe/trunk/poe Remember that the request will just be passed through, 'bad' method name and all, it will be up to your app logic to decide whether or not it wants to handle that method. Thank you for your bug report.. = ) _Marlon_ On Mon Apr 30 12:28:46 2007, MBAILEY wrote: Show quoted text
> This is an issue with POE::Wheel::ReadWrite and POE::Filter::HTTPD. > SimpleHTTP listens for an event generated for each request over the > socket with the above pair, and assumes it will get one event for one > request. However in the case of the failing bad request, it receives > two events(inputs) both attached to the same request, this is causing > the error. A failing test case has been submitted to trunk and the > maintainer of POE::Filter::HTTPD and POE::Wheel::ReadWrite have been > notified. If a fix is not produced within reasonable limits..we may > modify SimpleHTTP to work around this error, but that is not the > preferred solution, so we'll work on submitting a failing test case for > the POE::Wheel::ReadWrite/POE::Filter::HTTPD/Bad Request combo. > > -avinash240