r47464 - in /trunk/libanyevent-perl: Changes META.json META.yml README debian/changelog 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 16:04:04 UTC 2009


Author: jawnsy-guest
Date: Thu Nov 19 16:02:47 2009
New Revision: 47464

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=47464
Log:
New upstream release

Modified:
    trunk/libanyevent-perl/Changes
    trunk/libanyevent-perl/META.json
    trunk/libanyevent-perl/META.yml
    trunk/libanyevent-perl/README
    trunk/libanyevent-perl/debian/changelog
    trunk/libanyevent-perl/lib/AnyEvent.pm
    trunk/libanyevent-perl/lib/AnyEvent/DNS.pm
    trunk/libanyevent-perl/lib/AnyEvent/Util.pm

Modified: trunk/libanyevent-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libanyevent-perl/Changes?rev=47464&op=diff
==============================================================================
--- trunk/libanyevent-perl/Changes (original)
+++ trunk/libanyevent-perl/Changes Thu Nov 19 16:02:47 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: trunk/libanyevent-perl/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libanyevent-perl/META.json?rev=47464&op=diff
==============================================================================
--- trunk/libanyevent-perl/META.json (original)
+++ trunk/libanyevent-perl/META.json Thu Nov 19 16:02:47 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: trunk/libanyevent-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libanyevent-perl/META.yml?rev=47464&op=diff
==============================================================================
--- trunk/libanyevent-perl/META.yml (original)
+++ trunk/libanyevent-perl/META.yml Thu Nov 19 16:02:47 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: trunk/libanyevent-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libanyevent-perl/README?rev=47464&op=diff
==============================================================================
--- trunk/libanyevent-perl/README (original)
+++ trunk/libanyevent-perl/README Thu Nov 19 16:02:47 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: trunk/libanyevent-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libanyevent-perl/debian/changelog?rev=47464&op=diff
==============================================================================
--- trunk/libanyevent-perl/debian/changelog (original)
+++ trunk/libanyevent-perl/debian/changelog Thu Nov 19 16:02:47 2009
@@ -1,3 +1,9 @@
+libanyevent-perl (5.210-1) UNRELEASED; urgency=low
+
+  * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Thu, 19 Nov 2009 07:39:40 -0500
+
 libanyevent-perl (5.202-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/libanyevent-perl/lib/AnyEvent.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libanyevent-perl/lib/AnyEvent.pm?rev=47464&op=diff
==============================================================================
--- trunk/libanyevent-perl/lib/AnyEvent.pm (original)
+++ trunk/libanyevent-perl/lib/AnyEvent.pm Thu Nov 19 16:02:47 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: trunk/libanyevent-perl/lib/AnyEvent/DNS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libanyevent-perl/lib/AnyEvent/DNS.pm?rev=47464&op=diff
==============================================================================
--- trunk/libanyevent-perl/lib/AnyEvent/DNS.pm (original)
+++ trunk/libanyevent-perl/lib/AnyEvent/DNS.pm Thu Nov 19 16:02:47 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: trunk/libanyevent-perl/lib/AnyEvent/Util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libanyevent-perl/lib/AnyEvent/Util.pm?rev=47464&op=diff
==============================================================================
--- trunk/libanyevent-perl/lib/AnyEvent/Util.pm (original)
+++ trunk/libanyevent-perl/lib/AnyEvent/Util.pm Thu Nov 19 16:02:47 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