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.