r47462 - in /branches/upstream/libanyevent-perl/current: Changes META.json META.yml README lib/AnyEvent.pm lib/AnyEvent/DNS.pm lib/AnyEvent/Util.pm
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Thu Nov 19 15:59:29 UTC 2009
Author: jawnsy-guest
Date: Thu Nov 19 15:59:20 2009
New Revision: 47462
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47462
Log:
[svn-upgrade] Integrating new upstream version, libanyevent-perl (5.210)
Modified:
branches/upstream/libanyevent-perl/current/Changes
branches/upstream/libanyevent-perl/current/META.json
branches/upstream/libanyevent-perl/current/META.yml
branches/upstream/libanyevent-perl/current/README
branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm
branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm
branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm
Modified: branches/upstream/libanyevent-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/Changes?rev=47462&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/Changes (original)
+++ branches/upstream/libanyevent-perl/current/Changes Thu Nov 19 15:59:20 2009
@@ -1,4 +1,13 @@
Revision history for Perl extension AnyEvent.
+
+5.21 Thu Nov 19 02:48:47 CET 2009
+ - fix a problem where socket constants were called with parameters
+ (spotted by David Friedland).
+ - fork_call never use'd POSIX (reported by Daisuke Maki).
+ - improve perl 5.6 compatibility further (but it still won't work
+ unless you rip out everything but the core).
+ - prefer Net::DNS::Resolver over ipconfig, if installed, on win32.
+ uses 10MB of RAM, but doesn't open a console window. *sigh*.
5.202 Wed Oct 14 22:35:44 CEST 2009
- AnyEvent::DNS would unexpectedly clobber $_ under windows
Modified: branches/upstream/libanyevent-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/META.json?rev=47462&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/META.json (original)
+++ branches/upstream/libanyevent-perl/current/META.json Thu Nov 19 15:59:20 2009
@@ -1,1 +1,1 @@
-{"no_index":{"directory":["t","inc"]},"meta-spec":{"version":1.4,"url":"http://module-build.sourceforge.net/META-spec-v1.4.html"},"generated_by":"ExtUtils::MakeMaker version 6.54","distribution_type":"module","version":"5.202","name":"AnyEvent","author":[],"license":"unknown","build_requires":{"ExtUtils::MakeMaker":0},"requires":{},"recommends":{"Net::SSLeay":1.33,"Guard":1.02,"EV":3.05,"Async::Interrupt":1,"JSON::XS":2.2,"JSON":2.09},"abstract":null,"configure_requires":{"ExtUtils::MakeMaker":0}}
+{"no_index":{"directory":["t","inc"]},"meta-spec":{"version":1.4,"url":"http://module-build.sourceforge.net/META-spec-v1.4.html"},"generated_by":"ExtUtils::MakeMaker version 6.54","distribution_type":"module","version":"5.21","name":"AnyEvent","author":[],"license":"unknown","build_requires":{"ExtUtils::MakeMaker":0},"requires":{},"recommends":{"Net::SSLeay":1.33,"Guard":1.02,"EV":3.05,"Async::Interrupt":1,"JSON::XS":2.2,"JSON":2.09},"abstract":null,"configure_requires":{"ExtUtils::MakeMaker":0}}
Modified: branches/upstream/libanyevent-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/META.yml?rev=47462&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/META.yml (original)
+++ branches/upstream/libanyevent-perl/current/META.yml Thu Nov 19 15:59:20 2009
@@ -11,7 +11,7 @@
},
"generated_by" : "ExtUtils::MakeMaker version 6.54",
"distribution_type" : "module",
- "version" : "5.202",
+ "version" : "5.21",
"name" : "AnyEvent",
"author" : [],
"license" : "unknown",
Modified: branches/upstream/libanyevent-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/README?rev=47462&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/README (original)
+++ branches/upstream/libanyevent-perl/current/README Thu Nov 19 15:59:20 2009
@@ -355,6 +355,14 @@
When this is the case, you can call this method, which will update
the event loop's idea of "current time".
+
+ A typical example would be a script in a web server (e.g.
+ "mod_perl") - when mod_perl executes the script, then the event loop
+ will have the wrong idea about the "current time" (being potentially
+ far in the past, when the script ran the last time). In that case
+ you should arrange a call to "AnyEvent->now_update" each time the
+ web server process wakes up again (e.g. at the start of your script,
+ or in a handler).
Note that updating the time *might* cause some events to be handled.
Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm?rev=47462&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm Thu Nov 19 15:59:20 2009
@@ -364,6 +364,13 @@
When this is the case, you can call this method, which will update the
event loop's idea of "current time".
+
+A typical example would be a script in a web server (e.g. C<mod_perl>) -
+when mod_perl executes the script, then the event loop will have the wrong
+idea about the "current time" (being potentially far in the past, when the
+script ran the last time). In that case you should arrange a call to C<<
+AnyEvent->now_update >> each time the web server process wakes up again
+(e.g. at the start of your script, or in a handler).
Note that updating the time I<might> cause some events to be handled.
@@ -1118,15 +1125,13 @@
use Carp ();
-our $VERSION = '5.202';
+our $VERSION = '5.21';
our $MODEL;
our $AUTOLOAD;
our @ISA;
our @REGISTRY;
-
-our $WIN32;
our $VERBOSE;
@@ -1388,7 +1393,7 @@
sub _signal_exec {
$HAVE_ASYNC_INTERRUPT
? $SIGPIPE_R->drain
- : sysread $SIGPIPE_R, my $dummy, 9;
+ : sysread $SIGPIPE_R, (my $dummy), 9;
while (%SIG_EV) {
for (keys %SIG_EV) {
Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm?rev=47462&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm Thu Nov 19 15:59:20 2009
@@ -118,7 +118,7 @@
sub DOMAIN_PORT() { 53 } # if this changes drop me a note
-sub resolver;
+sub resolver ();
sub a($$) {
my ($domain, $cb) = @_;
@@ -763,7 +763,7 @@
Scalar::Util::weaken (my $wself = $self);
- if (socket my $fh4, AF_INET , &Socket::SOCK_DGRAM, 0) {
+ if (socket my $fh4, AF_INET , Socket::SOCK_DGRAM(), 0) {
++$got_socket;
AnyEvent::Util::fh_nonblocking $fh4, 1;
@@ -775,7 +775,7 @@
};
}
- if (AF_INET6 && socket my $fh6, AF_INET6, &Socket::SOCK_DGRAM, 0) {
+ if (AF_INET6 && socket my $fh6, AF_INET6, Socket::SOCK_DGRAM(), 0) {
++$got_socket;
$self->{fh6} = $fh6;
@@ -886,40 +886,62 @@
# - calling windows api functions doesn't work on cygwin
# - ipconfig uses locale-specific messages
- # we use ipconfig parsing because, despite all its brokenness,
- # it seems most stable in practise.
- # for good measure, we append a fallback nameserver to our list.
-
- if (open my $fh, "ipconfig /all |") {
- # parsing strategy: we go through the output and look for
- # :-lines with DNS in them. everything in those is regarded as
- # either a nameserver (if it parses as an ip address), or a suffix
- # (all else).
-
- my $dns;
- local $_;
- while (<$fh>) {
- if (s/^\s.*\bdns\b.*://i) {
- $dns = 1;
- } elsif (/^\S/ || /^\s[^:]{16,}: /) {
- $dns = 0;
+ # we use Net::DNS::Resolver first, and if it fails, will fall back to
+ # ipconfig parsing.
+ unless (eval {
+ # Net::DNS::Resolver uses a LOT of ram (~10mb), but what can we do :/
+ # (this seems mostly to be due to Win32::API).
+ require Net::DNS::Resolver;
+ my $r = Net::DNS::Resolver->new;
+
+ $r->nameservers
+ or die;
+
+ for my $s ($r->nameservers) {
+ if (my $ipn = AnyEvent::Socket::parse_address ($s)) {
+ push @{ $self->{server} }, $ipn;
}
- if ($dns && /^\s*(\S+)\s*$/) {
- my $s = $1;
- $s =~ s/%\d+(?!\S)//; # get rid of ipv6 scope id
- if (my $ipn = AnyEvent::Socket::parse_address ($s)) {
- push @{ $self->{server} }, $ipn;
- } else {
- push @{ $self->{search} }, $s;
+ }
+ $self->{search} = [$r->searchlist];
+
+ 1
+ }) {
+ # we use ipconfig parsing because, despite all its brokenness,
+ # it seems most stable in practise.
+ # unfortunately it wants a console window.
+ # for good measure, we append a fallback nameserver to our list.
+
+ if (open my $fh, "ipconfig /all |") {
+ # parsing strategy: we go through the output and look for
+ # :-lines with DNS in them. everything in those is regarded as
+ # either a nameserver (if it parses as an ip address), or a suffix
+ # (all else).
+
+ my $dns;
+ local $_;
+ while (<$fh>) {
+ if (s/^\s.*\bdns\b.*://i) {
+ $dns = 1;
+ } elsif (/^\S/ || /^\s[^:]{16,}: /) {
+ $dns = 0;
+ }
+ if ($dns && /^\s*(\S+)\s*$/) {
+ my $s = $1;
+ $s =~ s/%\d+(?!\S)//; # get rid of ipv6 scope id
+ if (my $ipn = AnyEvent::Socket::parse_address ($s)) {
+ push @{ $self->{server} }, $ipn;
+ } else {
+ push @{ $self->{search} }, $s;
+ }
}
}
}
-
- # always add one fallback server
- push @{ $self->{server} }, $DNS_FALLBACK[rand @DNS_FALLBACK];
-
- $self->_compile;
}
+
+ # always add one fallback server
+ push @{ $self->{server} }, $DNS_FALLBACK[rand @DNS_FALLBACK];
+
+ $self->_compile;
} else {
# try resolv.conf everywhere else
Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm?rev=47462&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm Thu Nov 19 15:59:20 2009
@@ -236,6 +236,7 @@
sub _fork_schedule;
sub _fork_schedule {
require Storable;
+ require POSIX;
while ($forks < $MAX_FORKS) {
my $job = shift @fork_queue
@@ -313,7 +314,7 @@
if (AnyEvent::WIN32) {
shutdown $w, 1; # signal parent to please kill us
sleep 10; # give parent a chance to clean up
- sysread $w, my $buf, 1; # this *might* detect the parent exiting in some cases.
+ sysread $w, (my $buf), 1; # this *might* detect the parent exiting in some cases.
}
POSIX::_exit (0);
exit 1;
More information about the Pkg-perl-cvs-commits
mailing list