All pastes #434920 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-11 18:00 UTC
rendered paste body
diff -ru libwww-perl-5.62/lib/LWP/Protocol/http.pm libwww-perl-5.63/lib/LWP/Protocol/http.pm
--- libwww-perl-5.62/lib/LWP/Protocol/http.pm	2001-11-16 21:10:28.000000000 -0500
+++ libwww-perl-5.63/lib/LWP/Protocol/http.pm	2001-12-14 14:33:52.000000000 -0500
@@ -371,6 +374,11 @@
     if (my $timeout = ${*$self}{io_socket_timeout}) {
 	die "read timeout" unless $self->can_read($timeout);
     }
+    else {
+	# since we have made the socket non-blocking we
+	# use select to wait for some data to arrive
+	$self->can_read(undef) || die "Assert";
+    }
     sysread($self, $_[0], $_[1], $_[2] || 0);
 }