diff --git a/Changes b/Changes index a855a2e..bac19b2 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,14 @@ +_______________________________________________________________________________ +2012-02-18 HTTP-Daemon 6.01 + +If you bind localhost, don't trust gethostbyaddr() to resolve the +address. [RT#67247] + +Restore perl-5.8.1 compatiblity. + + + + _______________________________________________________________________________ 2011-02-25 HTTP-Daemon 6.00 diff --git a/META.yml b/META.yml index 9dd817b..8f2eaf1 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: HTTP-Daemon -version: 6.00 +version: 6.01 abstract: a simple http server class author: - Gisle Aas @@ -17,16 +17,16 @@ requires: HTTP::Status: 6 IO::Socket: 0 LWP::MediaTypes: 6 - perl: 5.008008 + perl: 5.008001 Sys::Hostname: 0 resources: MailingList: mailto:libwww@perl.org - repository: http://github.com/gisle/libwww-perl + repository: http://github.com/gisle/http-daemon no_index: directory: - t - inc -generated_by: ExtUtils::MakeMaker version 6.56 +generated_by: ExtUtils::MakeMaker version 6.57_05 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 diff --git a/Makefile.PL b/Makefile.PL index fe981cc..09c7e86 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,6 +1,6 @@ #!perl -w -require 5.008008; +require 5.008001; use strict; use ExtUtils::MakeMaker; @@ -10,7 +10,7 @@ WriteMakefile( ABSTRACT_FROM => 'lib/HTTP/Daemon.pm', AUTHOR => 'Gisle Aas ', LICENSE => "perl", - MIN_PERL_VERSION => 5.008008, + MIN_PERL_VERSION => 5.008001, PREREQ_PM => { 'Sys::Hostname' => 0, 'IO::Socket' => 0, @@ -22,7 +22,7 @@ WriteMakefile( }, META_MERGE => { resources => { - repository => 'http://github.com/gisle/libwww-perl', + repository => 'http://github.com/gisle/http-daemon', MailingList => 'mailto:libwww@perl.org', } }, diff --git a/lib/HTTP/Daemon.pm b/lib/HTTP/Daemon.pm index 6988bd4..27a7bf4 100644 --- a/lib/HTTP/Daemon.pm +++ b/lib/HTTP/Daemon.pm @@ -3,9 +3,9 @@ package HTTP::Daemon; use strict; use vars qw($VERSION @ISA $PROTO $DEBUG); -$VERSION = "6.00"; +$VERSION = "6.01"; -use IO::Socket qw(AF_INET INADDR_ANY inet_ntoa); +use IO::Socket qw(AF_INET INADDR_ANY INADDR_LOOPBACK inet_ntoa); @ISA=qw(IO::Socket::INET); $PROTO = "HTTP/1.1"; @@ -44,6 +44,9 @@ sub url require Sys::Hostname; $url .= lc Sys::Hostname::hostname(); } + elsif ($addr eq INADDR_LOOPBACK) { + $url .= inet_ntoa($addr); + } else { $url .= gethostbyaddr($addr, AF_INET) || inet_ntoa($addr); }