Skip Menu |

This queue is for tickets about the POE CPAN distribution.

Report information
The Basics
Id: 19366
Status: resolved
Priority: 0/
Queue: POE

People
Owner: RCAPUTO [...] cpan.org
Requestors: pravus [...] carbon.cc
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.3202
Fixed in: (no value)



Subject: Prototype mismatch error due to AF_INET6 redefinition
POE::Wheel::SocketFactory defines AF_INET6 which appears to cause a "Prototype mismatch" error if the Socket6 module is later require'd or use'd. This occurs on my system when using POE::Component::Client::DNS with IPv6 nameservers. DNS resolution fails unless I add a 'use Socket6;' before including modules that use POE::Wheel::SocketFactory. Perhaps using an eval() with require() could be used as in Net::DNS::Nameserver?
On Fri May 19 21:01:55 2006, guest wrote: Show quoted text
> POE::Wheel::SocketFactory defines AF_INET6 which appears to cause a > "Prototype mismatch" error if the Socket6 module is later require'd or > use'd. This occurs on my system when using POE::Component::Client::DNS > with IPv6 nameservers. DNS resolution fails unless I add a 'use > Socket6;' before including modules that use POE::Wheel::SocketFactory. > > Perhaps using an eval() with require() could be used as in > Net::DNS::Nameserver?
Can you provide a short test case that illustrates the problem? I don't see it here: 1) poerbook:~/projects/poe/poe% perl -wle 'use strict; use Socket6; use POE; use POE::Wheel::SocketFactory; print "ok?"' ok? 1) poerbook:~/projects/poe/poe% perl -wle 'use strict; use POE; use POE::Wheel::SocketFactory; use Socket6; print "ok?"' ok? 1) poerbook:~/projects/poe/poe% Thanks.
From: pravus [...] carbon.cc
Show quoted text
> Can you provide a short test case that illustrates the problem? I don't > see it here:
Sorry, probably should have included one to begin with. Here you go: pravus@behemoth:~$ perl -wle 'use strict; use POE; use POE::Wheel::SocketFactory; use Net::DNS; print "ok?"' Prototype mismatch: sub IO::Socket::INET6::AF_INET6: none vs () at /usr/lib/perl5/5.8.8/Exporter.pm line 65. at /usr/lib/perl5/vendor_perl/5.8.8/IO/Socket/INET6.pm line 16 Prototype mismatch: sub IO::Socket::INET6::PF_INET6: none vs () at /usr/lib/perl5/5.8.8/Exporter.pm line 65. at /usr/lib/perl5/vendor_perl/5.8.8/IO/Socket/INET6.pm line 16 ok?
From: pravus [...] carbon.cc
i've attached a patch that appears to correct the problem on my system.
--- SocketFactory.pm_20060615 2006-06-15 21:57:14.000000000 -0500 +++ SocketFactory.pm 2006-06-15 22:00:59.000000000 -0500 @@ -45,7 +45,9 @@ # Provide dummy constants for systems that don't have them. BEGIN { - unless (exists $INC{"Socket6.pm"}) { + if (eval {require Socket6;}) { + Socket6->import(); + } else { eval "*Socket6::AF_INET6 = sub () { ~0 }"; eval "*Socket6::PF_INET6 = sub () { ~0 }"; }
Thanks for the test case. I wasn't able to reproduce the problem, but the patch seemed reasonable so I applied it as revision 2008.