Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Don't confess on the use of AF_INET6 or PF_INET6 in SocketFactory.

SocketFactory uses those constants unconditionally during
initialization, so things that don't even need them fail.

http://www.cpantesters.org/cpan/report/9c1ad42e-12dc-11e2-81a5-a3382b22a531
is a Perl 5.6.2 test failure, but as far as I can tell all the errors
are due to missing IPv6 support on that platform.
  • Loading branch information...
commit ec43fcdf40ff511de6cd08785298670181a6b7e6 1 parent d8eec52
Rocco Caputo authored

Showing 1 changed file with 9 additions and 5 deletions. Show diff stats Hide diff stats

  1. +9 5 lib/POE/Wheel/SocketFactory.pm
14 lib/POE/Wheel/SocketFactory.pm
@@ -62,8 +62,8 @@ BEGIN {
62 62 # :newapi is legacy, but we include it to be sure in case the user has an old version of GAI
63 63 eval { require Socket::GetAddrInfo; Socket::GetAddrInfo->import( qw(:newapi getaddrinfo getnameinfo) ) };
64 64 if ($@) {
65   - *getaddrinfo = sub { Carp::confess("Unable to use IPv6: Socket::GetAddrInfo not available") };
66   - *getnameinfo = sub { Carp::confess("Unable to use IPv6: Socket::GetAddrInfo not available") };
  65 + *getaddrinfo = sub { Carp::confess("Unable to use IPv6: Neither Socket nor Socket::GetAddrInfo provides getaddrinfo()") };
  66 + *getnameinfo = sub { Carp::confess("Unable to use IPv6: Neither Socket nor Socket::GetAddrInfo provides getnameinfo()") };
67 67 }
68 68 }
69 69
@@ -72,8 +72,8 @@ BEGIN {
72 72 if ($@) {
73 73 eval { require Socket6; Socket6->import( qw(AF_INET6 PF_INET6) ) };
74 74 if ($@) {
75   - *AF_INET6 = sub { Carp::confess("Unable to use IPv6: Socket6 not available") };
76   - *PF_INET6 = sub { Carp::confess("Unable to use IPv6: Socket6 not available") };
  75 + *AF_INET6 = sub { -1 };
  76 + *PF_INET6 = sub { -1 };
77 77 }
78 78 }
79 79 }
@@ -509,7 +509,11 @@ sub new {
509 509 my $abstract_domain = $map_family_to_domain{$self->[MY_SOCKET_DOMAIN]};
510 510 unless (defined $abstract_domain) {
511 511 $poe_kernel->yield(
512   - $event_failure, 'domain', 0, '', $self->[MY_UNIQUE_ID]
  512 + $event_failure,
  513 + 'domain',
  514 + 0,
  515 + "SocketDomain $domain is currently unsupported on this platform",
  516 + $self->[MY_UNIQUE_ID]
513 517 );
514 518 return $self;
515 519 }

0 comments on commit ec43fcd

Please sign in to comment.
Something went wrong with that request. Please try again.