6.05 bump
This commit is contained in:
parent
e2955d6f6a
commit
5cb85f71e6
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
/HTTP-Daemon-6.00.tar.gz
|
||||
/HTTP-Daemon-6.01.tar.gz
|
||||
/HTTP-Daemon-6.04.tar.gz
|
||||
/HTTP-Daemon-6.05.tar.gz
|
||||
|
@ -1,55 +0,0 @@
|
||||
From e49f553aa8be21e5df72452e50af2e9f0b82ecad Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Wed, 23 May 2018 17:31:42 +0200
|
||||
Subject: [PATCH] Resolve specific socket addresses correctly
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Previous code did not formatted specific (not 0.0.0.0 or ::)
|
||||
correctly:
|
||||
|
||||
$ perl -MHTTP::Daemon -e '$d=HTTP::Daemon->new(LocalAddr=>q{127.0.0.2}) or die; print $d->url, qq{\n}'
|
||||
Can't call method "sockhostname" without a package or object reference at /usr/share/perl5/vendor_perl/HTTP/Daemon.pm line 64.
|
||||
|
||||
This patch also fixes formatting numerical IPv6 addresses. It seems
|
||||
that IO::Socket::IP::sockhostname() formats unresolvable addresses too.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
lib/HTTP/Daemon.pm | 15 +++++++++++++--
|
||||
1 file changed, 13 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/HTTP/Daemon.pm b/lib/HTTP/Daemon.pm
|
||||
index 1e9d48e..216c73f 100644
|
||||
--- a/lib/HTTP/Daemon.pm
|
||||
+++ b/lib/HTTP/Daemon.pm
|
||||
@@ -61,12 +61,23 @@ sub url
|
||||
$url .= '[' . inet_ntop(AF_INET6, $addr) . ']';
|
||||
}
|
||||
else {
|
||||
- my $host = $addr->sockhostname;
|
||||
+ my $host = $self->sockhostname;
|
||||
+ # sockhostname() seems to return a stringified IP address if not
|
||||
+ # resolvable, then quote it for a port separator and an IPv6 zone separator.
|
||||
+ # But be paranoid for a case when it already contains a bracket.
|
||||
+ if (defined $host and $host =~ /:/) {
|
||||
+ if ($host =~ /[\[\]]/) {
|
||||
+ $host = undef;
|
||||
+ } else {
|
||||
+ $host =~ s/%/%25/g;
|
||||
+ $host = '[' . $host . ']';
|
||||
+ }
|
||||
+ }
|
||||
if (!defined $host) {
|
||||
if (sockaddr_family($addr) eq AF_INET6) {
|
||||
$host = '[' . inet_ntop(AF_INET6, $addr) . ']';
|
||||
} else {
|
||||
- $host = inet_ntop(AF_INET6, $addr);
|
||||
+ $host = inet_ntop(AF_INET, $addr);
|
||||
}
|
||||
}
|
||||
$url .= $host;
|
||||
--
|
||||
2.14.3
|
||||
|
@ -1,399 +0,0 @@
|
||||
From 3443626f53d8283935e41f39ee6cf93096019cd1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Mon, 16 Jan 2017 16:13:08 +0100
|
||||
Subject: [PATCH] Add IPv6 support
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This patch ports the code from IO::Socket::INET to IO::Socket::IP in
|
||||
order to support IPv6.
|
||||
|
||||
CPAN RT #91699, #71395.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
Build.PL | 7 ++++---
|
||||
META.json | 5 +++--
|
||||
META.yml | 3 ++-
|
||||
Makefile.PL | 8 ++++----
|
||||
lib/HTTP/Daemon.pm | 43 +++++++++++++++++++++++++++---------------
|
||||
t/00-report-prereqs.dd | 5 +++--
|
||||
t/chunked.t | 34 ++++++++++++++++++++++-----------
|
||||
t/local/http.t | 2 +-
|
||||
t/robot/ua-get.t | 2 +-
|
||||
t/robot/ua.t | 2 +-
|
||||
10 files changed, 70 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/Build.PL b/Build.PL
|
||||
index b44b1c5..9a040b1 100644
|
||||
--- a/Build.PL
|
||||
+++ b/Build.PL
|
||||
@@ -97,8 +97,9 @@ EOW
|
||||
"HTTP::Request" => 6,
|
||||
"HTTP::Response" => 6,
|
||||
"HTTP::Status" => 6,
|
||||
- "IO::Socket" => 0,
|
||||
+ "IO::Socket::IP" => 0,
|
||||
"LWP::MediaTypes" => 6,
|
||||
+ "Socket" => 0,
|
||||
"Sys::Hostname" => 0,
|
||||
"perl" => "5.006",
|
||||
"strict" => 0,
|
||||
@@ -106,7 +107,7 @@ EOW
|
||||
},
|
||||
"test_requires" => {
|
||||
"File::Spec" => 0,
|
||||
- "IO::Socket::INET" => 0,
|
||||
+ "IO::Socket::IP" => 0,
|
||||
"Module::Metadata" => 0,
|
||||
"Socket" => 0,
|
||||
"Test" => 0,
|
||||
@@ -120,7 +121,7 @@ EOW
|
||||
|
||||
my %fallback_build_requires = (
|
||||
"File::Spec" => 0,
|
||||
- "IO::Socket::INET" => 0,
|
||||
+ "IO::Socket::IP" => 0,
|
||||
"Module::Metadata" => 0,
|
||||
"Socket" => 0,
|
||||
"Test" => 0,
|
||||
diff --git a/META.json b/META.json
|
||||
index 67d7de5..badff90 100644
|
||||
--- a/META.json
|
||||
+++ b/META.json
|
||||
@@ -61,8 +61,9 @@
|
||||
"HTTP::Request" : "6",
|
||||
"HTTP::Response" : "6",
|
||||
"HTTP::Status" : "6",
|
||||
- "IO::Socket" : "0",
|
||||
+ "IO::Socket::IP" : "0",
|
||||
"LWP::MediaTypes" : "6",
|
||||
+ "Socket" : "0",
|
||||
"Sys::Hostname" : "0",
|
||||
"perl" : "5.006",
|
||||
"strict" : "0",
|
||||
@@ -75,7 +76,7 @@
|
||||
},
|
||||
"requires" : {
|
||||
"File::Spec" : "0",
|
||||
- "IO::Socket::INET" : "0",
|
||||
+ "IO::Socket::IP" : "0",
|
||||
"Module::Metadata" : "0",
|
||||
"Socket" : "0",
|
||||
"Test" : "0",
|
||||
diff --git a/META.yml b/META.yml
|
||||
index 4f76ff2..2d8a4e2 100644
|
||||
--- a/META.yml
|
||||
+++ b/META.yml
|
||||
@@ -4,7 +4,7 @@ author:
|
||||
- 'Gisle Aas <gisle@activestate.com>'
|
||||
build_requires:
|
||||
File::Spec: '0'
|
||||
- IO::Socket::INET: '0'
|
||||
+ IO::Socket::IP: '0'
|
||||
Module::Metadata: '0'
|
||||
Socket: '0'
|
||||
Test: '0'
|
||||
@@ -38,6 +38,7 @@ requires:
|
||||
HTTP::Response: '6'
|
||||
HTTP::Status: '6'
|
||||
IO::Socket: '0'
|
||||
+ IO::Socket::IP: '0'
|
||||
LWP::MediaTypes: '6'
|
||||
Sys::Hostname: '0'
|
||||
perl: '5.006'
|
||||
diff --git a/Makefile.PL b/Makefile.PL
|
||||
index aa76f2b..5915c46 100644
|
||||
--- a/Makefile.PL
|
||||
+++ b/Makefile.PL
|
||||
@@ -88,15 +88,16 @@ my %WriteMakefileArgs = (
|
||||
"HTTP::Request" => 6,
|
||||
"HTTP::Response" => 6,
|
||||
"HTTP::Status" => 6,
|
||||
- "IO::Socket" => 0,
|
||||
+ "IO::Socket::IP" => 0,
|
||||
"LWP::MediaTypes" => 6,
|
||||
+ "Socket" => 0,
|
||||
"Sys::Hostname" => 0,
|
||||
"strict" => 0,
|
||||
"warnings" => 0
|
||||
},
|
||||
"TEST_REQUIRES" => {
|
||||
"File::Spec" => 0,
|
||||
- "IO::Socket::INET" => 0,
|
||||
+ "IO::Socket::IP" => 0,
|
||||
"Module::Metadata" => 0,
|
||||
"Socket" => 0,
|
||||
"Test" => 0,
|
||||
@@ -117,8 +118,7 @@ my %FallbackPrereqs = (
|
||||
"HTTP::Request" => 6,
|
||||
"HTTP::Response" => 6,
|
||||
"HTTP::Status" => 6,
|
||||
- "IO::Socket" => 0,
|
||||
- "IO::Socket::INET" => 0,
|
||||
+ "IO::Socket::IP" => 0,
|
||||
"LWP::MediaTypes" => 6,
|
||||
"Module::Metadata" => 0,
|
||||
"Socket" => 0,
|
||||
diff --git a/lib/HTTP/Daemon.pm b/lib/HTTP/Daemon.pm
|
||||
index d711916..58c292a 100644
|
||||
--- a/lib/HTTP/Daemon.pm
|
||||
+++ b/lib/HTTP/Daemon.pm
|
||||
@@ -6,8 +6,10 @@ use warnings;
|
||||
|
||||
our $VERSION = '6.04';
|
||||
|
||||
-use IO::Socket qw(AF_INET INADDR_ANY INADDR_LOOPBACK inet_ntoa);
|
||||
-our @ISA = qw(IO::Socket::INET);
|
||||
+use Socket qw(AF_INET AF_INET6 INADDR_ANY IN6ADDR_ANY
|
||||
+ INADDR_LOOPBACK IN6ADDR_LOOPBACK inet_ntop sockaddr_family);
|
||||
+use IO::Socket::IP;
|
||||
+our @ISA = qw(IO::Socket::IP);
|
||||
|
||||
our $PROTO = "HTTP/1.1";
|
||||
|
||||
@@ -42,15 +44,26 @@ sub url
|
||||
my $self = shift;
|
||||
my $url = $self->_default_scheme . "://";
|
||||
my $addr = $self->sockaddr;
|
||||
- if (!$addr || $addr eq INADDR_ANY) {
|
||||
+ if (!$addr || $addr eq INADDR_ANY || $addr eq IN6ADDR_ANY) {
|
||||
require Sys::Hostname;
|
||||
$url .= lc Sys::Hostname::hostname();
|
||||
}
|
||||
elsif ($addr eq INADDR_LOOPBACK) {
|
||||
- $url .= inet_ntoa($addr);
|
||||
+ $url .= inet_ntop(AF_INET, $addr);
|
||||
+ }
|
||||
+ elsif ($addr eq IN6ADDR_LOOPBACK) {
|
||||
+ $url .= '[' . inet_ntop(AF_INET6, $addr) . ']';
|
||||
}
|
||||
else {
|
||||
- $url .= gethostbyaddr($addr, AF_INET) || inet_ntoa($addr);
|
||||
+ my $host = $addr->sockhostname;
|
||||
+ if (!defined $host) {
|
||||
+ if (sockaddr_family($addr) eq AF_INET6) {
|
||||
+ $host = '[' . inet_ntop(AF_INET6, $addr) . ']';
|
||||
+ } else {
|
||||
+ $host = inet_ntop(AF_INET6, $addr);
|
||||
+ }
|
||||
+ }
|
||||
+ $url .= $host;
|
||||
}
|
||||
my $port = $self->sockport;
|
||||
$url .= ":$port" if $port != $self->_default_port;
|
||||
@@ -81,8 +94,8 @@ package # hide from PAUSE
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
-use IO::Socket ();
|
||||
-our @ISA = qw(IO::Socket::INET);
|
||||
+use IO::Socket::IP ();
|
||||
+our @ISA=qw(IO::Socket::IP);
|
||||
our $DEBUG;
|
||||
*DEBUG = \$HTTP::Daemon::DEBUG;
|
||||
|
||||
@@ -658,12 +671,12 @@ version 6.04
|
||||
|
||||
Instances of the C<HTTP::Daemon> class are HTTP/1.1 servers that
|
||||
listen on a socket for incoming requests. The C<HTTP::Daemon> is a
|
||||
-subclass of C<IO::Socket::INET>, so you can perform socket operations
|
||||
+subclass of C<IO::Socket::IP>, so you can perform socket operations
|
||||
directly on it too.
|
||||
|
||||
The accept() method will return when a connection from a client is
|
||||
available. The returned value will be an C<HTTP::Daemon::ClientConn>
|
||||
-object which is another C<IO::Socket::INET> subclass. Calling the
|
||||
+object which is another C<IO::Socket::IP> subclass. Calling the
|
||||
get_request() method on this object will read data from the client and
|
||||
return an C<HTTP::Request> object. The ClientConn object also provide
|
||||
methods to send back various responses.
|
||||
@@ -674,7 +687,7 @@ desirable. Also note that the user is responsible for generating
|
||||
responses that conform to the HTTP/1.1 protocol.
|
||||
|
||||
The following methods of C<HTTP::Daemon> are new (or enhanced) relative
|
||||
-to the C<IO::Socket::INET> base class:
|
||||
+to the C<IO::Socket::IP> base class:
|
||||
|
||||
=over 4
|
||||
|
||||
@@ -683,7 +696,7 @@ to the C<IO::Socket::INET> base class:
|
||||
=item $d = HTTP::Daemon->new( %opts )
|
||||
|
||||
The constructor method takes the same arguments as the
|
||||
-C<IO::Socket::INET> constructor, but unlike its base class it can also
|
||||
+C<IO::Socket::IP> constructor, but unlike its base class it can also
|
||||
be called without any arguments. The daemon will then set up a listen
|
||||
queue of 5 connections and allocate some random port number.
|
||||
|
||||
@@ -695,7 +708,7 @@ HTTP port will be constructed like this:
|
||||
LocalPort => 80,
|
||||
);
|
||||
|
||||
-See L<IO::Socket::INET> for a description of other arguments that can
|
||||
+See L<IO::Socket::IP> for a description of other arguments that can
|
||||
be used configure the daemon during construction.
|
||||
|
||||
=item $c = $d->accept
|
||||
@@ -712,7 +725,7 @@ class a subclass of C<HTTP::Daemon::ClientConn>.
|
||||
|
||||
The accept method will return C<undef> if timeouts have been enabled
|
||||
and no connection is made within the given time. The timeout() method
|
||||
-is described in L<IO::Socket>.
|
||||
+is described in L<IO::Socket::IP>.
|
||||
|
||||
In list context both the client object and the peer address will be
|
||||
returned; see the description of the accept method L<IO::Socket> for
|
||||
@@ -734,7 +747,7 @@ replaced with the version number of this module.
|
||||
|
||||
=back
|
||||
|
||||
-The C<HTTP::Daemon::ClientConn> is a C<IO::Socket::INET>
|
||||
+The C<HTTP::Daemon::ClientConn> is a C<IO::Socket::IP>
|
||||
subclass. Instances of this class are returned by the accept() method
|
||||
of C<HTTP::Daemon>. The following methods are provided:
|
||||
|
||||
@@ -908,7 +921,7 @@ Return a reference to the corresponding C<HTTP::Daemon> object.
|
||||
|
||||
RFC 2616
|
||||
|
||||
-L<IO::Socket::INET>, L<IO::Socket>
|
||||
+L<IO::Socket::IP>, L<IO::Socket>
|
||||
|
||||
=head1 SUPPORT
|
||||
|
||||
diff --git a/t/00-report-prereqs.dd b/t/00-report-prereqs.dd
|
||||
index 36929ec..1ec1f8a 100644
|
||||
--- a/t/00-report-prereqs.dd
|
||||
+++ b/t/00-report-prereqs.dd
|
||||
@@ -41,6 +41,7 @@ do { my $x = {
|
||||
'HTTP::Response' => '6',
|
||||
'HTTP::Status' => '6',
|
||||
'IO::Socket' => '0',
|
||||
+ 'IO::Socket::IP' => '0',
|
||||
'LWP::MediaTypes' => '6',
|
||||
'Sys::Hostname' => '0',
|
||||
'perl' => '5.006',
|
||||
@@ -54,7 +55,7 @@ do { my $x = {
|
||||
},
|
||||
'requires' => {
|
||||
'File::Spec' => '0',
|
||||
- 'IO::Socket::INET' => '0',
|
||||
+ 'IO::Socket::IP' => '0',
|
||||
'Module::Metadata' => '0',
|
||||
'Socket' => '0',
|
||||
'Test' => '0',
|
||||
@@ -140,4 +141,4 @@ do { my $x = {
|
||||
}
|
||||
};
|
||||
$x;
|
||||
- }
|
||||
\ No newline at end of file
|
||||
+ }
|
||||
diff --git a/t/chunked.t b/t/chunked.t
|
||||
index 14cab77..32594ec 100644
|
||||
--- a/t/chunked.t
|
||||
+++ b/t/chunked.t
|
||||
@@ -95,18 +95,30 @@ my $can_fork = $Config{d_fork} ||
|
||||
my $tests = @TESTS;
|
||||
my $tport = 8334;
|
||||
|
||||
-my $tsock = IO::Socket::INET->new(LocalAddr => '0.0.0.0',
|
||||
- LocalPort => $tport,
|
||||
- Listen => 1,
|
||||
- ReuseAddr => 1);
|
||||
+my @addresses = (
|
||||
+ { server => '::', client => '::1' },
|
||||
+ { server => '0.0.0.0', client => '127.0.0.1' }
|
||||
+);
|
||||
+my $family;
|
||||
+for my $id (0..$#addresses) {
|
||||
+ my $tsock = IO::Socket::IP->new(LocalAddr => $addresses[$id]->{server},
|
||||
+ LocalPort => $tport,
|
||||
+ Listen => 1,
|
||||
+ ReuseAddr => 1);
|
||||
+ if ($tsock) {
|
||||
+ close $tsock;
|
||||
+ $family = $id;
|
||||
+ last;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
if (!$can_fork) {
|
||||
plan skip_all => "This system cannot fork";
|
||||
}
|
||||
-elsif (!$tsock) {
|
||||
- plan skip_all => "Cannot listen on 0.0.0.0:$tport";
|
||||
+elsif (!defined $family) {
|
||||
+ plan skip_all => "Cannot listen on unspecifed address and port $tport";
|
||||
}
|
||||
else {
|
||||
- close $tsock;
|
||||
plan tests => $tests;
|
||||
}
|
||||
|
||||
@@ -132,9 +144,9 @@ if ($pid = fork) {
|
||||
open my $fh, "| socket localhost $tport" or die;
|
||||
print $fh $test;
|
||||
}
|
||||
- use IO::Socket::INET;
|
||||
- my $sock = IO::Socket::INET->new(
|
||||
- PeerAddr => "127.0.0.1",
|
||||
+ use IO::Socket::IP;
|
||||
+ my $sock = IO::Socket::IP->new(
|
||||
+ PeerAddr => $addresses[$family]->{client},
|
||||
PeerPort => $tport,
|
||||
) or die;
|
||||
if (0) {
|
||||
@@ -158,7 +170,7 @@ if ($pid = fork) {
|
||||
} else {
|
||||
die "cannot fork: $!" unless defined $pid;
|
||||
my $d = HTTP::Daemon->new(
|
||||
- LocalAddr => '0.0.0.0',
|
||||
+ LocalAddr => $addresses[$family]->{server},
|
||||
LocalPort => $tport,
|
||||
ReuseAddr => 1,
|
||||
) or die;
|
||||
diff --git a/t/local/http.t b/t/local/http.t
|
||||
index 02006b0..91c03e8 100644
|
||||
--- a/t/local/http.t
|
||||
+++ b/t/local/http.t
|
||||
@@ -14,7 +14,7 @@ unless (-f "CAN_TALK_TO_OURSELF") {
|
||||
|
||||
$| = 1; # autoflush
|
||||
|
||||
-require IO::Socket; # make sure this work before we try to make a HTTP::Daemon
|
||||
+require Socket; # make sure this work before we try to make a HTTP::Daemon
|
||||
|
||||
# First we make ourself a daemon in another process
|
||||
my $D = shift || '';
|
||||
diff --git a/t/robot/ua-get.t b/t/robot/ua-get.t
|
||||
index 87d8840..91b414a 100644
|
||||
--- a/t/robot/ua-get.t
|
||||
+++ b/t/robot/ua-get.t
|
||||
@@ -11,7 +11,7 @@ unless (-f "CAN_TALK_TO_OURSELF") {
|
||||
}
|
||||
|
||||
$| = 1; # autoflush
|
||||
-require IO::Socket; # make sure this work before we try to make a HTTP::Daemon
|
||||
+require Socket; # make sure this work before we try to make a HTTP::Daemon
|
||||
|
||||
# First we make ourself a daemon in another process
|
||||
my $D = shift || '';
|
||||
diff --git a/t/robot/ua.t b/t/robot/ua.t
|
||||
index eff7e37..1e87598 100644
|
||||
--- a/t/robot/ua.t
|
||||
+++ b/t/robot/ua.t
|
||||
@@ -11,7 +11,7 @@ unless (-f "CAN_TALK_TO_OURSELF") {
|
||||
}
|
||||
|
||||
$| = 1; # autoflush
|
||||
-require IO::Socket; # make sure this work before we try to make a HTTP::Daemon
|
||||
+require Socket; # make sure this work before we try to make a HTTP::Daemon
|
||||
|
||||
# First we make ourself a daemon in another process
|
||||
my $D = shift || '';
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,53 @@
|
||||
From 5c552f1ec2fa91bff64679d7252c6c154771de6c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Wed, 23 May 2018 17:31:42 +0200
|
||||
Subject: [PATCH] Format unresolvable specific socket addresses correctly
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It seems that IO::Socket::IP::sockhostname() formats unresolvable
|
||||
addresses. However, IPv6 numerical addresses must be properly
|
||||
delimited by brackets:
|
||||
|
||||
$ perl -Ilib -MHTTP::Daemon -e '$d=HTTP::Daemon->new(LocalAddr=>q{::2}) or die; print $d->url, qq{\n}'
|
||||
http://::2:52153/
|
||||
|
||||
And a zone seperator must be URI-quoted:
|
||||
|
||||
$ perl -Ilib -MHTTP::Daemon -e '$d=HTTP::Daemon->new(LocalAddr=>q{fe80::250:54ff:fe00:f15%ens3}) or die; print $d->url, qq{\n}'
|
||||
http://fe80::250:54ff:fe00:f15%ens3:57797/
|
||||
|
||||
This patch fixes these two formatting issues.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
lib/HTTP/Daemon.pm | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/lib/HTTP/Daemon.pm b/lib/HTTP/Daemon.pm
|
||||
index 8620ffa..13d677f 100644
|
||||
--- a/lib/HTTP/Daemon.pm
|
||||
+++ b/lib/HTTP/Daemon.pm
|
||||
@@ -62,6 +62,18 @@ sub url {
|
||||
}
|
||||
else {
|
||||
my $host = $self->sockhostname;
|
||||
+ # sockhostname() seems to return a stringified IP address if not
|
||||
+ # resolvable. Then quote it for a port separator and an IPv6 zone
|
||||
+ # separator. But be paranoid for a case when it already contains
|
||||
+ # a bracket.
|
||||
+ if (defined $host and $host =~ /:/) {
|
||||
+ if ($host =~ /[\[\]]/) {
|
||||
+ $host = undef;
|
||||
+ } else {
|
||||
+ $host =~ s/%/%25/g;
|
||||
+ $host = '[' . $host . ']';
|
||||
+ }
|
||||
+ }
|
||||
if (!defined $host) {
|
||||
my $family = sockaddr_family($self->sockname);
|
||||
if ($family && $family == AF_INET6) {
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,4 +1,4 @@
|
||||
From b54702ab21edbf1ea0dbc00d978aecc89e5764d6 Mon Sep 17 00:00:00 2001
|
||||
From 3c6d374c2deb04e4304c298db06c1cda9d4c1d7a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Mon, 18 Sep 2017 15:21:16 +0200
|
||||
Subject: [PATCH] Handle undef and empty LocalAddr
|
||||
@ -10,7 +10,12 @@ IO::Socket::INET interprets undefined and empty string LocalAddr
|
||||
arguments as an unspecified address while IO::Socket::IP returns an
|
||||
error. This seems to be one of the differences between the two
|
||||
Socket implementations. Recent IO::Socket::IP (0.39) accepts undefined
|
||||
value, but still bail outs on an empty string.
|
||||
value, but still bail outs on an empty string:
|
||||
|
||||
$ perl -Ilib -MHTTP::Daemon -e '$d=HTTP::Daemon->new(LocalAddr=>undef) or die; print $d->url, qq{\n}'
|
||||
http://fedora-31:42587/
|
||||
$ perl -Ilib -MHTTP::Daemon -e '$d=HTTP::Daemon->new(LocalAddr=>q{}) or die; print $d->url, qq{\n}'
|
||||
Name or service not known ...propagated at -e line 1.
|
||||
|
||||
To improve compatibility, this patch adds a special handling for these
|
||||
two values to be accepted as an unspecified value. Though this should
|
||||
@ -25,11 +30,11 @@ Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/lib/HTTP/Daemon.pm b/lib/HTTP/Daemon.pm
|
||||
index 0e22b77..1e9d48e 100644
|
||||
index fd8020f..8620ffa 100644
|
||||
--- a/lib/HTTP/Daemon.pm
|
||||
+++ b/lib/HTTP/Daemon.pm
|
||||
@@ -18,6 +18,14 @@ sub new
|
||||
my($class, %args) = @_;
|
||||
@@ -22,6 +22,14 @@ sub new {
|
||||
my ($class, %args) = @_;
|
||||
$args{Listen} ||= 5;
|
||||
$args{Proto} ||= 'tcp';
|
||||
+ # Handle undefined or empty local address the same way as
|
||||
@ -44,5 +49,5 @@ index 0e22b77..1e9d48e 100644
|
||||
}
|
||||
|
||||
--
|
||||
2.13.5
|
||||
2.20.1
|
||||
|
@ -1,20 +1,19 @@
|
||||
Name: perl-HTTP-Daemon
|
||||
Version: 6.04
|
||||
Release: 3%{?dist}
|
||||
Version: 6.05
|
||||
Release: 1%{?dist}
|
||||
Summary: Simple HTTP server class
|
||||
License: GPL+ or Artistic
|
||||
URL: https://metacpan.org/release/HTTP-Daemon
|
||||
Source0: https://cpan.metacpan.org/authors/id/O/OA/OALDERS/HTTP-Daemon-%{version}.tar.gz
|
||||
# Support IPv6, bug #1413065, CPAN RT#91699, CPAN RT#71395,
|
||||
# proposed to upstream
|
||||
Patch0: HTTP-Daemon-6.04-Add-IPv6-support.patch
|
||||
Source0: https://cpan.metacpan.org/authors/id/E/ET/ETHER/HTTP-Daemon-%{version}.tar.gz
|
||||
# Accept undefined and empty-string LocalAddr as IO::Socket::INET does,
|
||||
# CPAN RT#91699, CPAN RT#123069
|
||||
Patch1: HTTP-Daemon-6.01-Handle-undef-and-empty-LocalAddr.patch
|
||||
# Fix formatting specific non-local addresses, bug #1578026, CPAN RT#125242
|
||||
Patch2: HTTP-Daemon-6.01-Resolve-specific-socket-addresses-correctly.patch
|
||||
# CPAN RT#91699, CPAN RT#123069,
|
||||
# <https://github.com/libwww-perl/HTTP-Daemon/pull/32>
|
||||
Patch0: HTTP-Daemon-6.05-Handle-undef-and-empty-LocalAddr.patch
|
||||
# Fix formatting specific non-local addresses, bug #1578026, CPAN RT#125242,
|
||||
# <https://github.com/libwww-perl/HTTP-Daemon/pull/32>
|
||||
Patch1: HTTP-Daemon-6.05-Format-unresolvable-specific-socket-addresses-correc.patch
|
||||
# Use Makefile.PL without unneeded dependencies
|
||||
Patch3: HTTP-Daemon-6.04-EU-MM-is-not-deprecated.patch
|
||||
Patch2: HTTP-Daemon-6.04-EU-MM-is-not-deprecated.patch
|
||||
BuildArch: noarch
|
||||
BuildRequires: make
|
||||
BuildRequires: perl-generators
|
||||
@ -69,7 +68,6 @@ IO::Socket::IP, so you can perform socket operations directly on it too.
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
|
||||
%build
|
||||
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
|
||||
@ -92,6 +90,9 @@ make test
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%changelog
|
||||
* Mon Jul 29 2019 Petr Pisar <ppisar@redhat.com> - 6.05-1
|
||||
- 6.05 bump
|
||||
|
||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.04-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (HTTP-Daemon-6.04.tar.gz) = 4fe21e92367c481e611cf0051134856811bc5e7d99ba2f54e0e8fb8c9c442198769ecc50d108219087c9052a8f51eab19843bc1f83cfb09ca6f1b9272414775c
|
||||
SHA512 (HTTP-Daemon-6.05.tar.gz) = 26a5dd4f215b7d3c488c414101e975db0b8f38f11c983312d3c1d89f22e9c80895d6ae3f60fd4b00b6cbea5814992ad705237848cf2c9eab40eb82cd0109b32d
|
||||
|
Loading…
Reference in New Issue
Block a user