File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,11 +55,15 @@ sub url {
5555 else {
5656 my $host = $self -> sockhostname;
5757 if (!defined $host ) {
58- if (sockaddr_family($addr ) eq AF_INET6) {
58+ my $family = sockaddr_family($self -> sockname);
59+ if ($family && $family == AF_INET6) {
5960 $host = ' [' . inet_ntop(AF_INET6, $addr ) . ' ]' ;
6061 }
62+ elsif ($family && $family == AF_INET) {
63+ $host = inet_ntop(AF_INET, $addr );
64+ }
6165 else {
62- $host = inet_ntop(AF_INET6, $addr ) ;
66+ die " Unknown family " ;
6367 }
6468 }
6569 $url .= $host ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ unless (-f "CAN_TALK_TO_OURSELF") {
1212
1313$| = 1; # autoflush
1414
15- require IO::Socket; # make sure this work before we try to make a HTTP::Daemon
15+ require IO::Socket::IP ; # make sure this work before we try to make a HTTP::Daemon
1616
1717# First we make ourself a daemon in another process
1818my $D = shift || ' ' ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ unless (-f "CAN_TALK_TO_OURSELF") {
1111}
1212
1313$| = 1; # autoflush
14- require IO::Socket; # make sure this work before we try to make a HTTP::Daemon
14+ require IO::Socket::IP ; # make sure this work before we try to make a HTTP::Daemon
1515
1616# First we make ourself a daemon in another process
1717my $D = shift || ' ' ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ unless (-f "CAN_TALK_TO_OURSELF") {
1111}
1212
1313$| = 1; # autoflush
14- require IO::Socket; # make sure this work before we try to make a HTTP::Daemon
14+ require IO::Socket::IP ; # make sure this work before we try to make a HTTP::Daemon
1515
1616# First we make ourself a daemon in another process
1717my $D = shift || ' ' ;
You can’t perform that action at this time.
0 commit comments