Skip Menu |

This queue is for tickets about the HTTP-Proxy CPAN distribution.

Report information
The Basics
Id: 61530
Status: new
Priority: 0/
Queue: HTTP-Proxy

People
Owner: Nobody in particular
Requestors: jon [...] hogue.org
Cc:
AdminCc:

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



Subject: CONNECT: Read undef from client (Connection reset by peer)
When connecting to the proxy from Internet Explorer 8, if Internet Explorer closes quickly (like when a script crashes), the proxy goes into death loop. (Keeps spitting out the same error, and uses up all available processor.) [Tue Sep 21 15:13:05 2010] (3544) ERROR: Getting request failed: Client closed [Tue Sep 21 15:13:05 2010] (4520) ERROR: Getting request failed: Client closed [Tue Sep 21 15:13:05 2010] (4340) ERROR: Getting request failed: Client closed [Tue Sep 21 15:13:08 2010] (4284) ERROR: Getting request failed: [Tue Sep 21 15:13:08 2010] (4984) CONNECT: Read undef from client (Connection reset by peer) [Tue Sep 21 15:13:08 2010] (4984) CONNECT: Read undef from client (Connection reset by peer) [Tue Sep 21 15:13:08 2010] (4984) CONNECT: Read undef from client (Connection reset by peer) [Tue Sep 21 15:13:08 2010] (4984) CONNECT: Read undef from client (Connection reset by peer) .... This goes on until the process is killed. Proxy Environment: I'm running the proxy under cygwin, on Windows 2008 SP2 (although, I experience the same error on Windows XP.) cygwin1.dll version 1.7.7 Perl v5.10.1 (*) built for i686-cygwin-thread-multi-64int
From: jon [...] hogue.org
So, I didn't provide a tone of detail, but I think I found the problem, and pointing it out may make it easy to reproduce. while ( my @ready = $select->can_read ) { for (@ready) { ... if(not defined $read ) { $self->log( ERROR, "CONNECT", "Read undef from $from ($!)" ); next; } ... So, notice that this 'thing' isn't cleared out after experiencing an error, like it is in the next case here: # end of connection if ( $read == 0 ) { $_->close for ( $sock, $peer ); $select->remove( $sock, $peer ); $self->log( SOCKET, "CONNECT", "Connection closed by the $from" ); $self->log( PROCESS, "PROCESS", "Served $served requests" ); next; } So, it's just going into an infinite loop. Should we do $_->close for ( $sock, $peer ); $select->remove( $sock, $peer ); in the case where $read is undef? I added this, and it seemed to work, but I don't really understand that code that well.