Minor patch to AnyEvent::DNS to ensure that DOMAIN_PORT is used consistently throughout
Andrew O'Brien
andrewo at oriel.com.au
Wed Mar 28 03:18:21 CEST 2012
Please reply to me directly if there are any questions - I am not subscribed to the list.
Essentially, _recv() uses a hard coded port number of 53 rather than using the constant sub defined for this purpose.
As a complete aside, I hit this when attempting to rewrite DOMAIN_PORT during require() in order to test against a non-standard port in a test suite.
--- /usr/share/perl5/AnyEvent/DNS.pm 2012-03-27 18:06:08.000000000 +1100
+++ /tmp/AnyEventDNS2.pm 2012-03-28 12:02:04.000000000 +1100
@@ -1038,7 +1038,7 @@
my ($port, $host) = AnyEvent::Socket::unpack_sockaddr ($peer);
- return unless $port == 53 && grep $_ eq $host, @{ $self->{server} };
+ return unless $port == DOMAIN_PORT && grep $_ eq $host, @{ $self->{server} };
$self->_feed ($pkt);
}
Cheers,
Andrew
More information about the anyevent
mailing list