Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: sean.pieper [...] viable.net
Cc:
AdminCc:

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



Subject: fix for #27120: Socket not closing on connection drop
Date: Fri, 13 Mar 2009 17:10:47 -0400 (EDT)
To: bug-POE-Component-Server-SimpleHTTP [...] rt.cpan.org
From: sean.pieper [...] viable.net
Hi, this bug is causing me big problems (every time someone connects and disconnects from my server I get another socket floating around in CLOSE_WAIT ), so I tracked it down. In the current release, the problem is on line 1054 in the Got_Error() sub (error handler for the readwrite wheel). Original: 1053: # Only do this for non-EOF on read 1054: unless ( $operation eq 'read' and $errnum == 0 ) { Fixed: 1053: { Basic problem is that the error handler never removes the filehandle when the client closes the socket on us. So, if I tell the client, "hey, I'm done" and the client nicely closes the socket, we get EOF, and then deliberately avoid cleaning up. My patch takes out the EOF check, so we always clean up. Not sure if this fix breaks keep alive stuff or not, and it could probably be made cleaner, but I'd really appreciate it if you could push out a patch so I can use my shiny new server in a production system. . . Sean Pieper Engineer Viable, Inc. VRS: ViableVRS.tv www.viable.net sean.pieper@viable.net Office: 240-292-0222 x244 VSN: viablepieper This e-mail, including any attachments may contain information that is protected by law as PRIVILEGED AND CONFIDENTIAL and is intended solely for the use of the recipient or the employee or agent responsible for delivering the message to the recipient. Please note that if you are not the intended recipient, you are hereby notified that any dissemination, copying, distribution, retention, re-transmission, printing or any other use of this e-mail or the information contained herein is strictly prohibited. If you have received this e-mail communication in error, please immediately send an e-mail reply to notify the sender and immediately and permanently delete this e-mail from your computer system. Thank you.
it looks as though this patch has been included in SimpleHTTP 2.0 . however, now it falls to line 813 $connection = $self->_requests->{$id}->response->connection; and dies because $self->_requests->{$id}->response is undefined. I've wrapped that in some defensive code: if(defined $self->_requests->{$id}->response) { $connection = $self->_requests->{$id}->response->connection; } else { warn "response for $id is undefined" if DEBUG; } and also the $connection->dead(1) line below. I'm not sure if this leaves something in a bad state yet.. there isn't a CLOSE_WAIT socket left hanging, at least. I also tried sending a "/\n\n" into the SOAP port and the request fell into the "malformed request" code in SimpleHTTP . this time , the module dies at line 585: $response->connection( $connection ); because connection is defined as "ro" . --USAGIJER