ports/175658: www/p5-libwww: read timeout does not work with 6.04
Slaven Rezic
eserte at cvrsnica.herceg.de
Mon Jan 28 22:00:02 UTC 2013
>Number: 175658
>Category: ports
>Synopsis: www/p5-libwww: read timeout does not work with 6.04
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Jan 28 22:00:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator: Slaven Rezic
>Release: FreeBSD 9.0-RELEASE amd64
>Organization:
www.rezic.de
>Environment:
System: FreeBSD cvrsnica.herceg.de 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
See https://rt.cpan.org/Ticket/Display.html?id=81799 for a
detailed report.
>How-To-Repeat:
lwp-request -t 5 $SOME_HANGING_URL
>Fix:
Here's the proposed patch incorporated into the freebsd port:
diff --git c/Makefile w/Makefile
index 5de5865..e50870d 100644
--- c/Makefile
+++ w/Makefile
@@ -3,6 +3,7 @@
PORTNAME= libwww
PORTVERSION= 6.04
+PORTREVISION= 1
CATEGORIES= www devel perl5
MASTER_SITES= CPAN/LWP
PKGNAMEPREFIX= p5-
@@ -28,6 +29,8 @@ RUN_DEPENDS:= ${BUILD_DEPENDS}
OPTIONS_DEFINE= HTTPS
+PATCH_STRIP= -p1
+
CONFIGURE_ARGS= --aliases
PERL_CONFIGURE= yes
diff --git c/files/patch-read-timeout w/files/patch-read-timeout
new file mode 100644
index 0000000..d35c5b9
--- /dev/null
+++ w/files/patch-read-timeout
@@ -0,0 +1,67 @@
+commit 6794fa73e92d63e973b38f97299b4181bdd7ee8b
+Author: Gisle Aas <gisle at aas.no>
+Date: Thu Nov 8 21:07:33 2012 +0100
+
+ With Net::HTTP 6.04 we don't need our own can_read() and sysread override
+
+diff --git a/Makefile.PL b/Makefile.PL
+index a6f808e..87075b4 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -61,7 +61,7 @@ WriteMakefile(
+ 'LWP::MediaTypes' => 6,
+ 'MIME::Base64' => "2.1",
+ 'Net::FTP' => "2.58",
+- 'Net::HTTP' => 6,
++ 'Net::HTTP' => "6.04",
+ 'URI' => "1.10",
+ 'URI::Escape' => 0,
+ 'WWW::RobotRules' => 6,
+diff --git a/lib/LWP/Protocol/http.pm b/lib/LWP/Protocol/http.pm
+index 8d7c6d9..d0583d4 100644
+--- a/lib/LWP/Protocol/http.pm
++++ b/lib/LWP/Protocol/http.pm
+@@ -446,43 +446,6 @@ sub request
+ #-----------------------------------------------------------
+ package LWP::Protocol::http::SocketMethods;
+
+-sub sysread {
+- my $self = shift;
+- 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);
+-}
+-
+-sub can_read {
+- my($self, $timeout) = @_;
+- my $fbits = '';
+- vec($fbits, fileno($self), 1) = 1;
+- SELECT:
+- {
+- my $before;
+- $before = time if $timeout;
+- my $nfound = select($fbits, undef, undef, $timeout);
+- if ($nfound < 0) {
+- if ($!{EINTR} || $!{EAGAIN}) {
+- # don't really think EAGAIN can happen here
+- if ($timeout) {
+- $timeout -= time - $before;
+- $timeout = 0 if $timeout < 0;
+- }
+- redo SELECT;
+- }
+- die "select failed: $!";
+- }
+- return $nfound > 0;
+- }
+-}
+-
+ sub ping {
+ my $self = shift;
+ !$self->can_read(0);
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list