6.04 bump
This commit is contained in:
parent
b3b3004895
commit
e65ee82516
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
/HTTP-Daemon-6.00.tar.gz
|
||||
/HTTP-Daemon-6.01.tar.gz
|
||||
/HTTP-Daemon-6.04.tar.gz
|
||||
|
@ -1,305 +0,0 @@
|
||||
From 067faffb8e596a53c9ac2ed7e571472f7a163681 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>
|
||||
---
|
||||
Makefile.PL | 1 +
|
||||
README | 24 ++++++++++++------------
|
||||
lib/HTTP/Daemon.pm | 43 ++++++++++++++++++++++++++++---------------
|
||||
t/chunked.t | 34 +++++++++++++++++++++++-----------
|
||||
4 files changed, 64 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/Makefile.PL b/Makefile.PL
|
||||
index 09c7e86..85d5712 100644
|
||||
--- a/Makefile.PL
|
||||
+++ b/Makefile.PL
|
||||
@@ -14,6 +14,7 @@ WriteMakefile(
|
||||
PREREQ_PM => {
|
||||
'Sys::Hostname' => 0,
|
||||
'IO::Socket' => 0,
|
||||
+ 'IO::Socket::IP' => 0,
|
||||
'HTTP::Request' => 6,
|
||||
'HTTP::Response' => 6,
|
||||
'HTTP::Status' => 6,
|
||||
diff --git a/README b/README
|
||||
index be5a20a..ddb3b6e 100644
|
||||
--- a/README
|
||||
+++ b/README
|
||||
@@ -24,12 +24,12 @@ SYNOPSIS
|
||||
DESCRIPTION
|
||||
Instances of the `HTTP::Daemon' class are HTTP/1.1 servers that listen
|
||||
on a socket for incoming requests. The `HTTP::Daemon' is a subclass of
|
||||
- `IO::Socket::INET', so you can perform socket operations directly on it
|
||||
+ `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 `HTTP::Daemon::ClientConn'
|
||||
- object which is another `IO::Socket::INET' subclass. Calling the
|
||||
+ object which is another `IO::Socket::IP' subclass. Calling the
|
||||
get_request() method on this object will read data from the client and
|
||||
return an `HTTP::Request' object. The ClientConn object also provide
|
||||
methods to send back various responses.
|
||||
@@ -40,13 +40,13 @@ DESCRIPTION
|
||||
responses that conform to the HTTP/1.1 protocol.
|
||||
|
||||
The following methods of `HTTP::Daemon' are new (or enhanced) relative
|
||||
- to the `IO::Socket::INET' base class:
|
||||
+ to the `IO::Socket::IP' base class:
|
||||
|
||||
$d = HTTP::Daemon->new
|
||||
$d = HTTP::Daemon->new( %opts )
|
||||
The constructor method takes the same arguments as the
|
||||
- `IO::Socket::INET' constructor, but unlike its base class it can
|
||||
- also be called without any arguments. The daemon will then set up a
|
||||
+ `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.
|
||||
|
||||
A server that wants to bind to some specific address on the standard
|
||||
@@ -57,8 +57,8 @@ DESCRIPTION
|
||||
LocalPort => 80,
|
||||
);
|
||||
|
||||
- See IO::Socket::INET for a description of other arguments that can
|
||||
- be used configure the daemon during construction.
|
||||
+ See IO::Socket::IP for a description of other arguments that can be
|
||||
+ used configure the daemon during construction.
|
||||
|
||||
$c = $d->accept
|
||||
$c = $d->accept( $pkg )
|
||||
@@ -71,7 +71,7 @@ DESCRIPTION
|
||||
|
||||
The accept method will return `undef' if timeouts have been enabled
|
||||
and no connection is made within the given time. The timeout()
|
||||
- method is described in IO::Socket.
|
||||
+ method is described in IO::Socket::IP.
|
||||
|
||||
In list context both the client object and the peer address will be
|
||||
returned; see the description of the accept method IO::Socket for
|
||||
@@ -89,9 +89,9 @@ DESCRIPTION
|
||||
The default is the string "libwww-perl-daemon/#.##" where "#.##" is
|
||||
replaced with the version number of this module.
|
||||
|
||||
- The `HTTP::Daemon::ClientConn' is a `IO::Socket::INET' subclass.
|
||||
- Instances of this class are returned by the accept() method of
|
||||
- `HTTP::Daemon'. The following methods are provided:
|
||||
+ The `HTTP::Daemon::ClientConn' is a `IO::Socket::IP' subclass. Instances
|
||||
+ of this class are returned by the accept() method of `HTTP::Daemon'. The
|
||||
+ following methods are provided:
|
||||
|
||||
$c->get_request
|
||||
$c->get_request( $headers_only )
|
||||
@@ -227,7 +227,7 @@ DESCRIPTION
|
||||
SEE ALSO
|
||||
RFC 2616
|
||||
|
||||
- IO::Socket::INET, IO::Socket
|
||||
+ IO::Socket::IP, IO::Socket
|
||||
|
||||
COPYRIGHT
|
||||
Copyright 1996-2003, Gisle Aas
|
||||
diff --git a/lib/HTTP/Daemon.pm b/lib/HTTP/Daemon.pm
|
||||
index 27a7bf4..0e22b77 100644
|
||||
--- a/lib/HTTP/Daemon.pm
|
||||
+++ b/lib/HTTP/Daemon.pm
|
||||
@@ -5,8 +5,10 @@ use vars qw($VERSION @ISA $PROTO $DEBUG);
|
||||
|
||||
$VERSION = "6.01";
|
||||
|
||||
-use IO::Socket qw(AF_INET INADDR_ANY INADDR_LOOPBACK inet_ntoa);
|
||||
-@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;
|
||||
+@ISA=qw(IO::Socket::IP);
|
||||
|
||||
$PROTO = "HTTP/1.1";
|
||||
|
||||
@@ -40,15 +42,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;
|
||||
@@ -77,8 +90,8 @@ sub product_tokens
|
||||
package HTTP::Daemon::ClientConn;
|
||||
|
||||
use vars qw(@ISA $DEBUG);
|
||||
-use IO::Socket ();
|
||||
-@ISA=qw(IO::Socket::INET);
|
||||
+use IO::Socket::IP ();
|
||||
+@ISA=qw(IO::Socket::IP);
|
||||
*DEBUG = \$HTTP::Daemon::DEBUG;
|
||||
|
||||
use HTTP::Request ();
|
||||
@@ -645,12 +658,12 @@ HTTP::Daemon - a simple http server class
|
||||
|
||||
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.
|
||||
@@ -661,7 +674,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
|
||||
|
||||
@@ -670,7 +683,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.
|
||||
|
||||
@@ -682,7 +695,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
|
||||
@@ -699,7 +712,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
|
||||
@@ -721,7 +734,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:
|
||||
|
||||
@@ -895,7 +908,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 COPYRIGHT
|
||||
|
||||
diff --git a/t/chunked.t b/t/chunked.t
|
||||
index e11799f..c274b11 100644
|
||||
--- a/t/chunked.t
|
||||
+++ b/t/chunked.t
|
||||
@@ -95,18 +95,30 @@ my $can_fork = $Config{d_fork} ||
|
||||
my $tests = @TESTS;
|
||||
my $tport = 8333;
|
||||
|
||||
-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;
|
||||
--
|
||||
2.7.4
|
||||
|
399
HTTP-Daemon-6.04-Add-IPv6-support.patch
Normal file
399
HTTP-Daemon-6.04-Add-IPv6-support.patch
Normal file
@ -0,0 +1,399 @@
|
||||
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
|
||||
|
92
HTTP-Daemon-6.04-EU-MM-is-not-deprecated.patch
Normal file
92
HTTP-Daemon-6.04-EU-MM-is-not-deprecated.patch
Normal file
@ -0,0 +1,92 @@
|
||||
From 30b91a0898e50874886343b66d27f78eaf960faf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
||||
Date: Tue, 2 Apr 2019 16:54:42 +0200
|
||||
Subject: [PATCH] EU::MM is not deprecated
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Contrary to the warning in the Makefile.PL, only ExtUtils::MakeMaker
|
||||
is a full-fledged system. Module::Build is not maintained anymore and
|
||||
Module::Build::Tiny contains design flaws regarding XS compilation.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
Makefile.PL | 61 -----------------------------------------------------
|
||||
1 file changed, 61 deletions(-)
|
||||
|
||||
diff --git a/Makefile.PL b/Makefile.PL
|
||||
index 5915c46..e98af42 100644
|
||||
--- a/Makefile.PL
|
||||
+++ b/Makefile.PL
|
||||
@@ -9,67 +9,6 @@ use warnings;
|
||||
use 5.006;
|
||||
use ExtUtils::MakeMaker;
|
||||
|
||||
-BEGIN {
|
||||
-my %configure_requires = (
|
||||
- 'ExtUtils::MakeMaker' => '0',
|
||||
- 'Module::Build::Tiny' => '0.034',
|
||||
-);
|
||||
-
|
||||
-my %errors = map {
|
||||
- eval "require $_; $_->VERSION($configure_requires{$_}); 1";
|
||||
- $_ => $@,
|
||||
-} keys %configure_requires;
|
||||
-
|
||||
-if (grep { $_ } values %errors)
|
||||
-{
|
||||
- warn "Errors from configure prereqs:\n"
|
||||
- . do {
|
||||
- require Data::Dumper; Data::Dumper->new([ \%errors ])->Indent(2)->Terse(1)->Sortkeys(1)->Dump;
|
||||
- };
|
||||
-}
|
||||
-
|
||||
-if (not $ENV{PERL_MM_FALLBACK_SILENCE_WARNING})
|
||||
-{
|
||||
- warn <<'EOW';
|
||||
-*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***
|
||||
-
|
||||
-If you're seeing this warning, your toolchain is really, really old* and
|
||||
-you'll almost certainly have problems installing CPAN modules from this
|
||||
-century. But never fear, dear user, for we have the technology to fix this!
|
||||
-
|
||||
-If you're using CPAN.pm to install things, then you can upgrade it using:
|
||||
-
|
||||
- cpan CPAN
|
||||
-
|
||||
-If you're using CPANPLUS to install things, then you can upgrade it using:
|
||||
-
|
||||
- cpanp CPANPLUS
|
||||
-
|
||||
-If you're using cpanminus, you shouldn't be seeing this message in the first
|
||||
-place, so please file an issue on github.
|
||||
-
|
||||
-If you're using a packaging tool through a unix distribution, this issue
|
||||
-should be reported to the package manager.
|
||||
-
|
||||
-If you're installing manually, please retrain your fingers to run Build.PL
|
||||
-when present instead of Makefile.PL.
|
||||
-
|
||||
-This public service announcement was brought to you by the Perl Toolchain
|
||||
-Gang, the irc.perl.org #toolchain IRC channel, and the number 42.
|
||||
-
|
||||
-----
|
||||
-
|
||||
-* Alternatively, you are doing something overly clever, in which case you
|
||||
-should consider setting the 'prefer_installer' config option in CPAN.pm, or
|
||||
-'prefer_makefile' in CPANPLUS, to 'mb" and '0' respectively.
|
||||
-
|
||||
-You can also silence this warning for future installations by setting the
|
||||
-PERL_MM_FALLBACK_SILENCE_WARNING environment variable.
|
||||
-EOW
|
||||
- sleep 10 if -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
|
||||
-}
|
||||
-} # end BEGIN
|
||||
-
|
||||
my %WriteMakefileArgs = (
|
||||
"ABSTRACT" => "A simple http server class",
|
||||
"AUTHOR" => "Gisle Aas <gisle\@activestate.com>",
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,23 +1,25 @@
|
||||
Name: perl-HTTP-Daemon
|
||||
Version: 6.01
|
||||
Release: 26%{?dist}
|
||||
Version: 6.04
|
||||
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/G/GA/GAAS/HTTP-Daemon-%{version}.tar.gz
|
||||
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.01-Add-IPv6-support.patch
|
||||
Patch0: HTTP-Daemon-6.04-Add-IPv6-support.patch
|
||||
# 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
|
||||
# Use Makefile.PL without unneeded dependencies
|
||||
Patch3: HTTP-Daemon-6.04-EU-MM-is-not-deprecated.patch
|
||||
BuildArch: noarch
|
||||
BuildRequires: make
|
||||
BuildRequires: perl-generators
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: perl(:VERSION) >= 5.8.1
|
||||
BuildRequires: perl(:VERSION) >= 5.6
|
||||
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76
|
||||
BuildRequires: perl(strict)
|
||||
# Run-time:
|
||||
@ -30,16 +32,21 @@ BuildRequires: perl(IO::Socket::IP)
|
||||
BuildRequires: perl(LWP::MediaTypes) >= 6
|
||||
BuildRequires: perl(Socket)
|
||||
BuildRequires: perl(Sys::Hostname)
|
||||
BuildRequires: perl(vars)
|
||||
BuildRequires: perl(warnings)
|
||||
# Tests only:
|
||||
BuildRequires: perl(Config)
|
||||
# IO::Socket not used
|
||||
BuildRequires: perl(File::Spec)
|
||||
# LWP::UserAgent not used
|
||||
BuildRequires: perl(Module::Metadata)
|
||||
# Test not used if LWP::UserAgent is not installed
|
||||
BuildRequires: perl(Test::More)
|
||||
BuildRequires: perl(Test::Needs)
|
||||
# URI not used
|
||||
# Optional tests:
|
||||
# CPAN::Meta not helpful
|
||||
# CPAN::Meta::Prereqs not helpful
|
||||
# LWP::RobotUA not used
|
||||
# LWP::UserAgent not used
|
||||
# Test not used
|
||||
BuildRequires: perl(Test::More)
|
||||
# URI not used
|
||||
BuildRequires: perl(warnings)
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
||||
Requires: perl(HTTP::Date) >= 6
|
||||
Requires: perl(HTTP::Request) >= 6
|
||||
@ -62,24 +69,32 @@ 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
|
||||
make %{?_smp_mflags}
|
||||
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
|
||||
%{make_build}
|
||||
|
||||
%install
|
||||
make pure_install DESTDIR=%{buildroot}
|
||||
%{make_install}
|
||||
%{_fixperms} %{buildroot}/*
|
||||
|
||||
%check
|
||||
# Some tests are skipped with "Can't talk to ourself (misconfigured system)".
|
||||
# These tests actually are never run becuse the required CAN_TALK_TO_OURSELF
|
||||
# file is never created. Those are author's tests.
|
||||
make test
|
||||
|
||||
%files
|
||||
%doc Changes README
|
||||
%license LICENCE
|
||||
%doc Changes CONTRIBUTING README
|
||||
%{perl_vendorlib}/*
|
||||
%{_mandir}/man3/*
|
||||
|
||||
%changelog
|
||||
* Tue Apr 02 2019 Petr Pisar <ppisar@redhat.com> - 6.04-1
|
||||
- 6.04 bump
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 6.01-26
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user