r56195 - in /branches/upstream/libanyevent-perl/current: Changes META.json META.yml README constants.pl.PL lib/AE.pm lib/AnyEvent.pm lib/AnyEvent/Handle.pm lib/AnyEvent/Impl/EV.pm lib/AnyEvent/Impl/Perl.pm

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Fri Apr 16 19:15:30 UTC 2010


Author: gregoa
Date: Fri Apr 16 19:15:18 2010
New Revision: 56195

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=56195
Log:
[svn-upgrade] Integrating new upstream version, libanyevent-perl (5.260)

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/constants.pl.PL
    branches/upstream/libanyevent-perl/current/lib/AE.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EV.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm

Modified: branches/upstream/libanyevent-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/Changes?rev=56195&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/Changes (original)
+++ branches/upstream/libanyevent-perl/current/Changes Fri Apr 16 19:15:18 2010
@@ -1,9 +1,23 @@
 Revision history for Perl extension AnyEvent.
 
+5.26  Mon Apr 12 04:49:35 CEST 2010
+	- don't generate spurious readyness notifications when select
+          returns EINTR in the pure perl backend (analysed and testcase
+          by Bas Denissen).
+        - give same examples in SYNOPSIS sections of AnyEvent and AE.
+        - provider faster implementations for AE::time/now/now_update for
+          EV and Perl backends.
+        - provide faster AE::cv and AE::time implementations for all
+          backends.
+        - no longer support lower/mixed-case signal names (this was
+          never documented nor universally supported).
+        - some more memory µ-optimisations, and somewhat less messy
+          code to cope with both AnyEvent and AE APIs.
+
 5.251 Sat Mar 13 00:58:21 CET 2010
-	- make test failed if it was run before make install, and
-          older versions of perl make our live very difficult, so
-          write constants.pl during Makefile.PL time.
+        - make test failed if it was run before make install on perl <=
+          5.8.8, and older versions of perl make our live very difficult,
+          so write constants.pl during Makefile.PL time.
 
 5.25  Sat Mar 13 00:23:14 CET 2010
 	- fix a race condition in AnyEvent::Handle that would cause
@@ -21,7 +35,7 @@
           detection and eval.
         - free detection code after detection and similar memory optimisations.
         - Perl backend timer interval best effort drift has been improved
-          (ame algorithm as EV).
+          (same algorithm as EV).
         - update unicode idna mapping table.
 
 5.24  Tue Jan  5 11:39:43 CET 2010
@@ -408,7 +422,7 @@
           unless one has been installed already.
         - warn about not loaidng AnyEvent::Impl::POE early enough
           (patch by Adam Rosenstein).
-	- fixed a great number of bugs and corner cases in AnyEvent::Handle:
+	- fixed a great number of bugs and corner cases in AnyEvent::Handle.
         - fix a bug in where in SSL connect mode, the
           client would first wait for some data by the server and
           otherwise hang. (reported and analysed in an absolutely

Modified: branches/upstream/libanyevent-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/META.json?rev=56195&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/META.json (original)
+++ branches/upstream/libanyevent-perl/current/META.json Fri Apr 16 19:15:18 2010
@@ -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.251","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.26","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=56195&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/META.yml (original)
+++ branches/upstream/libanyevent-perl/current/META.yml Fri Apr 16 19:15:18 2010
@@ -11,7 +11,7 @@
    },
    "generated_by" : "ExtUtils::MakeMaker version 6.54",
    "distribution_type" : "module",
-   "version" : "5.251",
+   "version" : "5.26",
    "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=56195&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/README (original)
+++ branches/upstream/libanyevent-perl/current/README Fri Apr 16 19:15:18 2010
@@ -7,7 +7,10 @@
 SYNOPSIS
        use AnyEvent;
 
-       # file descriptor readable
+       # if you prefer function calls, look at the L<AE> manpage for
+       # an alternative API.
+
+       # file handle or descriptor readable
        my $w = AnyEvent->io (fh => $fh, poll => "r", cb => sub { ...  });
 
        # one-shot or repeating timers
@@ -591,21 +594,21 @@
 
     Example: wait for a timer.
 
-       # wait till the result is ready
-       my $result_ready = AnyEvent->condvar;
-
-       # do something such as adding a timer
-       # or socket watcher the calls $result_ready->send
-       # when the "result" is ready.
+       # condition: "wait till the timer is fired"
+       my $timer_fired = AnyEvent->condvar;
+
+       # create the timer - we could wait for, say
+       # a handle becomign ready, or even an
+       # AnyEvent::HTTP request to finish, but
        # in this case, we simply use a timer:
        my $w = AnyEvent->timer (
           after => 1,
-          cb    => sub { $result_ready->send },
+          cb    => sub { $timer_fired->send },
        );
 
        # this "blocks" (while handling events) till the callback
        # calls ->send
-       $result_ready->recv;
+       $timer_fired->recv;
 
     Example: wait for a timer, but take advantage of the fact that condition
     variables are also callable directly.
@@ -1078,7 +1081,7 @@
 SIMPLIFIED AE API
     Starting with version 5.0, AnyEvent officially supports a second, much
     simpler, API that is designed to reduce the calling, typing and memory
-    overhead.
+    overhead by using function call syntax and a fixed number of parameters.
 
     See the AE manpage for details.
 
@@ -1353,7 +1356,7 @@
     exceptions) that occurred during request processing. The "result" method
     detects whether an exception as thrown (it is stored inside the $txn
     object) and just throws the exception, which means connection errors and
-    other problems get reported tot he code that tries to use the result,
+    other problems get reported to the code that tries to use the result,
     not in a random callback.
 
     All of this enables the following usage styles:
@@ -1776,6 +1779,9 @@
         You can even embed Glib/Gtk2 in it (or vice versa, see EV::Glib and
         Glib::EV).
 
+        If you only use backends that rely on another event loop (e.g.
+        "Tk"), then this module will do nothing for you.
+
     Guard
         The guard module, when used, will be used to implement
         "AnyEvent::Util::guard". This speeds up guards considerably (and
@@ -1784,12 +1790,9 @@
 
     JSON and JSON::XS
         One of these modules is required when you want to read or write JSON
-        data via AnyEvent::Handle. It is also written in pure-perl, but can
-        take advantage of the ultra-high-speed JSON::XS module when it is
-        installed.
-
-        In fact, AnyEvent::Handle will use JSON::XS by default if it is
-        installed.
+        data via AnyEvent::Handle. JSON is also written in pure-perl, but
+        can take advantage of the ultra-high-speed JSON::XS module when it
+        is installed.
 
     Net::SSLeay
         Implementing TLS/SSL in Perl is certainly interesting, but not very

Modified: branches/upstream/libanyevent-perl/current/constants.pl.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/constants.pl.PL?rev=56195&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/constants.pl.PL (original)
+++ branches/upstream/libanyevent-perl/current/constants.pl.PL Fri Apr 16 19:15:18 2010
@@ -1,4 +1,6 @@
 #! perl
+
+# this file is unfortunately only executed at Makefile.PL time
 
 open my $fh, ">lib/AnyEvent/constants.pl"
    or die "lib/AnyEvent/constants.pl: $_[0]\n";
@@ -12,7 +14,6 @@
 print "package AnyEvent;\n";
 
 our $WIN32 = $^O =~ /mswin32/i;
-
 
 i CYGWIN => $^O =~ /cygwin/i;
 i WIN32  => $WIN32;

Modified: branches/upstream/libanyevent-perl/current/lib/AE.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AE.pm?rev=56195&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AE.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AE.pm Fri Apr 16 19:15:18 2010
@@ -5,6 +5,35 @@
 =head1 SYNOPSIS
 
   use AnyEvent; # not AE
+
+  # file handle or descriptor readable
+  my $w = AE::io $fh, 0, sub { ...  };
+
+  # one-shot or repeating timers
+  my $w = AE::timer $seconds,        0, sub { ... }; # once
+  my $w = AE::timer $seconds, interval, sub { ... }; # repeated
+
+  print AE::now;  # prints current event loop time
+  print AE::time; # think Time::HiRes::time or simply CORE::time.
+
+  # POSIX signal
+  my $w = AE::signal TERM => sub { ... };
+
+  # child process exit
+  my $w = AE::child $pid, sub {
+     my ($pid, $status) = @_;
+     ...
+  };
+
+  # called when event loop idle (if applicable)
+  my $w = AE::idle { ... };
+
+  my $w = AE::cv; # stores whether a condition was flagged
+  $w->send; # wake up current and all future recv's
+  $w->recv; # enters "main loop" till $condvar gets ->send
+  # use a condvar in callback mode:
+  $w->cb (sub { $_[0]->recv });
+
 
 =head1 DESCRIPTION
 
@@ -23,8 +52,8 @@
 many mistakes are caught at compiletime with this API.
 
 Also, some backends (Perl and EV) are so fast that the method call
-overhead is very noticeable (with EV it increases the time five- to
-six-fold, with Perl the method call overhead is about a factor of two).
+overhead is very noticeable (with EV it increases the execution time five-
+to six-fold, with Perl the method call overhead is about a factor of two).
 
 At the moment, there will be no checking (L<AnyEvent::Strict> does not
 affect his API), so the L<AnyEvent> API has a definite advantage here
@@ -32,7 +61,8 @@
 
 Note that the C<AE> API is an alternative to, not the future version of,
 the AnyEvent API. Both APIs can be used interchangably and and there are
-no plans to "switch", so if in doubt, use the L<AnyEvent> API.
+no plans to "switch", so if in doubt, feel free to use the L<AnyEvent>
+API in new code.
 
 As the AE API is complementary, not everything in the AnyEvent API is
 available, so you still need to use AnyEvent for the finer stuff. Also,

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=56195&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm Fri Apr 16 19:15:18 2010
@@ -9,7 +9,10 @@
 
    use AnyEvent;
 
-   # file descriptor readable
+   # if you prefer function calls, look at the L<AE> manpage for
+   # an alternative API.
+
+   # file handle or descriptor readable
    my $w = AnyEvent->io (fh => $fh, poll => "r", cb => sub { ...  });
 
    # one-shot or repeating timers
@@ -608,21 +611,21 @@
 
 Example: wait for a timer.
 
-   # wait till the result is ready
-   my $result_ready = AnyEvent->condvar;
-
-   # do something such as adding a timer
-   # or socket watcher the calls $result_ready->send
-   # when the "result" is ready.
+   # condition: "wait till the timer is fired"
+   my $timer_fired = AnyEvent->condvar;
+
+   # create the timer - we could wait for, say
+   # a handle becomign ready, or even an
+   # AnyEvent::HTTP request to finish, but
    # in this case, we simply use a timer:
    my $w = AnyEvent->timer (
       after => 1,
-      cb    => sub { $result_ready->send },
+      cb    => sub { $timer_fired->send },
    );
 
    # this "blocks" (while handling events) till the callback
    # calls ->send
-   $result_ready->recv;
+   $timer_fired->recv;
 
 Example: wait for a timer, but take advantage of the fact that condition
 variables are also callable directly.
@@ -1158,7 +1161,7 @@
 
 use Carp ();
 
-our $VERSION = '5.251';
+our $VERSION = '5.26';
 our $MODEL;
 
 our $AUTOLOAD;
@@ -1171,7 +1174,7 @@
 BEGIN {
    require "AnyEvent/constants.pl";
 
-   eval "sub TAINT (){" . (${^TAINT}          *1) . "}";
+   eval "sub TAINT (){" . (${^TAINT}*1) . "}";
 
    delete @ENV{grep /^PERL_ANYEVENT_/, keys %ENV}
       if ${^TAINT};
@@ -1224,17 +1227,11 @@
 sub post_detect(&) {
    my ($cb) = @_;
 
-   if ($MODEL) {
-      $cb->();
-
-      undef
-   } else {
-      push @post_detect, $cb;
-
-      defined wantarray
-         ? bless \$cb, "AnyEvent::Util::postdetect"
-         : ()
-   }
+   push @post_detect, $cb;
+
+   defined wantarray
+      ? bless \$cb, "AnyEvent::Util::postdetect"
+      : ()
 }
 
 sub AnyEvent::Util::postdetect::DESTROY {
@@ -1297,9 +1294,22 @@
    push @{"$MODEL\::ISA"}, "AnyEvent::Base";
    unshift @ISA, $MODEL;
 
+   # now nuke some methods that are overriden by the backend.
+   # SUPER is not allowed.
+   for (qw(time signal child idle)) {
+      undef &{"AnyEvent::Base::$_"}
+         if defined &{"$MODEL\::$_"};
+   }
+
    require AnyEvent::Strict if $ENV{PERL_ANYEVENT_STRICT};
 
    (shift @post_detect)->() while @post_detect;
+
+   *post_detect = sub(&) {
+      shift->();
+
+      undef
+   };
 
    $MODEL
 }
@@ -1337,7 +1347,7 @@
 
 Starting with version 5.0, AnyEvent officially supports a second, much
 simpler, API that is designed to reduce the calling, typing and memory
-overhead.
+overhead by using function call syntax and a fixed number of parameters.
 
 See the L<AE> manpage for details.
 
@@ -1346,6 +1356,9 @@
 package AE;
 
 our $VERSION = $AnyEvent::VERSION;
+
+# fall back to the main API by default - backends and AnyEvent::Base
+# implementations can overwrite these.
 
 sub io($$$) {
    AnyEvent->io (fh => $_[0], poll => $_[1] ? "w" : "r", cb => $_[2])
@@ -1387,31 +1400,44 @@
 
 # default implementations for many methods
 
-sub _time() {
-   eval q{ # poor man's autoloading
+sub time {
+   eval q{ # poor man's autoloading {}
       # probe for availability of Time::HiRes
       if (eval "use Time::HiRes (); Time::HiRes::time (); 1") {
          warn "AnyEvent: using Time::HiRes for sub-second timing accuracy.\n" if $VERBOSE >= 8;
-         *_time = \&Time::HiRes::time;
+         *AE::time = \&Time::HiRes::time;
          # if (eval "use POSIX (); (POSIX::times())...
       } else {
          warn "AnyEvent: using built-in time(), WARNING, no sub-second resolution!\n" if $VERBOSE;
-         *_time = sub (){ time }; # epic fail
+         *AE::time = sub (){ time }; # epic fail
       }
+
+      *time = sub { AE::time }; # different prototypes
    };
    die if $@;
 
-   &_time
-}
-
-sub time { _time }
-sub now  { _time }
+   &time
+}
+
+*now = \&time;
+
 sub now_update { }
 
 # default implementation for ->condvar
 
 sub condvar {
-   bless { @_ == 3 ? (_ae_cb => $_[2]) : () }, "AnyEvent::CondVar"
+   eval q{ # poor man's autoloading {}
+      *condvar = sub {
+         bless { @_ == 3 ? (_ae_cb => $_[2]) : () }, "AnyEvent::CondVar"
+      };
+
+      *AE::cv = sub (;&) {
+         bless { @_ ? (_ae_cb => shift) : () }, "AnyEvent::CondVar"
+      };
+   };
+   die if $@;
+
+   &condvar
 }
 
 # default implementation for ->signal
@@ -1451,7 +1477,7 @@
 }
 
 our $_sig_name_init; $_sig_name_init = sub {
-   eval q{ # poor man's autoloading
+   eval q{ # poor man's autoloading {}
       undef $_sig_name_init;
 
       if (_have_async_interrupt) {
@@ -1515,45 +1541,43 @@
          $SIG_IO = AE::io $SIGPIPE_R, 0, \&_signal_exec;
       }
 
-      *signal = sub {
-         my (undef, %arg) = @_;
-
-         my $signal = uc $arg{signal}
-            or Carp::croak "required option 'signal' is missing";
-
-         if ($HAVE_ASYNC_INTERRUPT) {
-            # async::interrupt
-
-            $signal = sig2num $signal;
-            $SIG_CB{$signal}{$arg{cb}} = $arg{cb};
-
-            $SIG_ASY{$signal} ||= new Async::Interrupt
-               cb             => sub { undef $SIG_EV{$signal} },
-               signal         => $signal,
-               pipe           => [$SIGPIPE_R->filenos],
-               pipe_autodrain => 0,
-            ;
-
-         } else {
-            # pure perl
-
-            # AE::Util has been loaded in signal
-            $signal = sig2name $signal;
-            $SIG_CB{$signal}{$arg{cb}} = $arg{cb};
-
-            $SIG{$signal} ||= sub {
-               local $!;
-               syswrite $SIGPIPE_W, "\x00", 1 unless %SIG_EV;
-               undef $SIG_EV{$signal};
-            };
-
-            # can't do signal processing without introducing races in pure perl,
-            # so limit the signal latency.
-            _sig_add;
-         }
-
-         bless [$signal, $arg{cb}], "AnyEvent::Base::signal"
-      };
+      *signal = $HAVE_ASYNC_INTERRUPT
+         ? sub {
+              my (undef, %arg) = @_;
+
+              # async::interrupt
+              my $signal = sig2num $arg{signal};
+              $SIG_CB{$signal}{$arg{cb}} = $arg{cb};
+
+              $SIG_ASY{$signal} ||= new Async::Interrupt
+                 cb             => sub { undef $SIG_EV{$signal} },
+                 signal         => $signal,
+                 pipe           => [$SIGPIPE_R->filenos],
+                 pipe_autodrain => 0,
+              ;
+
+              bless [$signal, $arg{cb}], "AnyEvent::Base::signal"
+           }
+         : sub {
+              my (undef, %arg) = @_;
+
+              # pure perl
+              my $signal = sig2name $arg{signal};
+              $SIG_CB{$signal}{$arg{cb}} = $arg{cb};
+
+              $SIG{$signal} ||= sub {
+                 local $!;
+                 syswrite $SIGPIPE_W, "\x00", 1 unless %SIG_EV;
+                 undef $SIG_EV{$signal};
+              };
+
+              # can't do signal processing without introducing races in pure perl,
+              # so limit the signal latency.
+              _sig_add;
+
+              bless [$signal, $arg{cb}], "AnyEvent::Base::signal"
+           }
+      ;
 
       *AnyEvent::Base::signal::DESTROY = sub {
          my ($signal, $cb) = @{$_[0]};
@@ -2059,7 +2083,7 @@
 that occurred during request processing. The C<result> method detects
 whether an exception as thrown (it is stored inside the $txn object)
 and just throws the exception, which means connection errors and other
-problems get reported tot he code that tries to use the result, not in a
+problems get reported to the code that tries to use the result, not in a
 random callback.
 
 All of this enables the following usage styles:
@@ -2526,6 +2550,9 @@
 C<kqueue>, and is the fastest backend I<by far>. You can even embed
 L<Glib>/L<Gtk2> in it (or vice versa, see L<EV::Glib> and L<Glib::EV>).
 
+If you only use backends that rely on another event loop (e.g. C<Tk>),
+then this module will do nothing for you.
+
 =item L<Guard>
 
 The guard module, when used, will be used to implement
@@ -2536,11 +2563,8 @@
 =item L<JSON> and L<JSON::XS>
 
 One of these modules is required when you want to read or write JSON data
-via L<AnyEvent::Handle>. It is also written in pure-perl, but can take
+via L<AnyEvent::Handle>. L<JSON> is also written in pure-perl, but can take
 advantage of the ultra-high-speed L<JSON::XS> module when it is installed.
-
-In fact, L<AnyEvent::Handle> will use L<JSON::XS> by default if it is
-installed.
 
 =item L<Net::SSLeay>
 

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm?rev=56195&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm Fri Apr 16 19:15:18 2010
@@ -834,6 +834,9 @@
 Sets the C<on_drain> callback or clears it (see the description of
 C<on_drain> in the constructor).
 
+This method may invoke callbacks (and therefore the handle might be
+destroyed after it returns).
+
 =cut
 
 sub on_drain {
@@ -850,6 +853,9 @@
 Queues the given scalar to be written. You can push as much data as you
 want (only limited by the available memory), as C<AnyEvent::Handle>
 buffers it independently of the kernel.
+
+This method may invoke callbacks (and therefore the handle might be
+destroyed after it returns).
 
 =cut
 
@@ -1035,6 +1041,9 @@
 
 You can rely on the normal read queue and C<on_eof> handling
 afterwards. This is the cleanest way to close a connection.
+
+This method may invoke callbacks (and therefore the handle might be
+destroyed after it returns).
 
 =cut
 
@@ -1241,6 +1250,9 @@
 the new callback is C<undef>). See the description of C<on_read> in the
 constructor.
 
+This method may invoke callbacks (and therefore the handle might be
+destroyed after it returns).
+
 =cut
 
 sub on_read {
@@ -1288,6 +1300,9 @@
 If enough data was available, then the callback must remove all data it is
 interested in (which can be none at all) and return a true value. After returning
 true, it will be removed from the queue.
+
+These methods may invoke callbacks (and therefore the handle might be
+destroyed after it returns).
 
 =cut
 
@@ -1853,6 +1868,9 @@
 Due to bugs in OpenSSL, it might or might not be possible to do multiple
 handshakes on the same stream. Best do not attempt to use the stream after
 stopping TLS.
+
+This method may invoke callbacks (and therefore the handle might be
+destroyed after it returns).
 
 =cut
 
@@ -1931,6 +1949,9 @@
 support non-blocking shut downs, it is not guaranteed that you can re-use
 the stream afterwards.
 
+This method may invoke callbacks (and therefore the handle might be
+destroyed after it returns).
+
 =cut
 
 sub stoptls {

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EV.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EV.pm?rev=56195&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EV.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EV.pm Fri Apr 16 19:15:18 2010
@@ -22,9 +22,14 @@
 use AnyEvent (); BEGIN { AnyEvent::common_sense }
 use EV 3.44;
 
+# cannot override directly, as EV doesn't allow arguments
 sub time       { EV::time       }
 sub now        { EV::now        }
 sub now_update { EV::now_update }
+
+*AE::time       = \&EV::time;
+*AE::now        = \&EV::now;
+*AE::now_update = \&EV::now_update;
 
 *AE::timer = \&EV::timer;
 

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm?rev=56195&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm Fri Apr 16 19:15:18 2010
@@ -167,6 +167,9 @@
 
 sub now        { $NOW          }
 sub now_update { _update_clock }
+
+*AE::now        = sub () { $NOW };
+*AE::now_update = sub () { _update_clock };
 
 # fds[0] is for read, fds[1] is for write watchers
 # fds[poll][V] is the bitmask for select
@@ -217,7 +220,7 @@
 
       _update_clock;
 
-      if ($fds) {
+      if ($fds > 0) {
          # buggy microshit windows errornously sets exceptfds instead of writefds
          $vec[1] |= $vec[2] if AnyEvent::WIN32;
 
@@ -236,10 +239,10 @@
                }
             }
          }
-      } elsif (AnyEvent::WIN32 && $! == AnyEvent::Util::WSAEINVAL) {
+      } elsif (AnyEvent::WIN32 && $fds && $! == AnyEvent::Util::WSAEINVAL) {
          # buggy microshit windoze asks us to route around it
          CORE::select undef, undef, undef, $wait if $wait;
-      } elsif (!@timer || $timer[0][0] > $MNOW) {
+      } elsif (!@timer || $timer[0][0] > $MNOW && !$fds) {
          $$$_ && $$$_->() for @idle = grep $$$_, @idle;
       }
    }




More information about the Pkg-perl-cvs-commits mailing list