r41098 - in /branches/upstream/libanyevent-perl: 4.900/ current/ current/lib/ current/lib/AnyEvent/ current/lib/AnyEvent/Impl/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sun Aug 2 22:49:15 UTC 2009


Author: jawnsy-guest
Date: Sun Aug  2 22:49:09 2009
New Revision: 41098

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=41098
Log:
revert my recent upgrade

Removed:
    branches/upstream/libanyevent-perl/4.900/
    branches/upstream/libanyevent-perl/current/lib/AE.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Debug.pm
Modified:
    branches/upstream/libanyevent-perl/current/Changes
    branches/upstream/libanyevent-perl/current/MANIFEST
    branches/upstream/libanyevent-perl/current/META.yml
    branches/upstream/libanyevent-perl/current/Makefile.PL
    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/Handle.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Event.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EventLib.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Glib.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/POE.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Strict.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/TLS.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=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/Changes (original)
+++ branches/upstream/libanyevent-perl/current/Changes Sun Aug  2 22:49:09 2009
@@ -1,31 +1,8 @@
 Revision history for Perl extension AnyEvent.
-
-4.9  Sat Aug  1 11:07:01 CEST 2009
-	- Glib silently fails when registering a timeout with
-          a negative value, so avoid that.
-        - call condvar callback immediately  when it is set
-          after the condition is already signalled.
-        - check rbuf_max condition only after trying to consume
-          data.
-	- normalise signal numbers to names when using the ae's
-          signal handling, but do not document this (yet).
-        - pure perl signal emulation did not properly set nonblocking
-          mode on the signal pipe on win32 (this is unlikely to have caused
-          any issues).
-        - new module: AnyEvent::Debug.
-        - AnyEvent::Strict now checks that a signal was specified
-          by name (not name or number).
-        - reduce memory footprint in typical cases by ~50kb by
-          only compiling signal code when necessary.
-        - add AnyEvent::Handle->rbuf_max.
-        - grab the AE namespace for future new API, implement stubs for
-          said future/alternative API.
-        - new function: AnyEvent::Socket::format_hostport.
 
 4.881 Tue Jul 28 12:51:53 CEST 2009
 	- work around a bug in local in pre-5.10 perls, causing
-          AnyEvent::Handle to recurse when it should not
-          (analyzed by elmex).
+          AnyEvent::Handle to recurse when it should not.
 
 4.88 Tue Jul 28 04:04:37 CEST 2009
 	- re-bless the handle into a dummy package after calling

Modified: branches/upstream/libanyevent-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/MANIFEST?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/MANIFEST (original)
+++ branches/upstream/libanyevent-perl/current/MANIFEST Sun Aug  2 22:49:09 2009
@@ -4,11 +4,9 @@
 README
 Makefile.PL
 
-lib/AE.pm
 lib/AnyEvent.pm
 lib/AnyEvent/Intro.pod
 lib/AnyEvent/Strict.pm
-lib/AnyEvent/Debug.pm
 lib/AnyEvent/DNS.pm
 lib/AnyEvent/Util.pm
 lib/AnyEvent/TLS.pm

Modified: branches/upstream/libanyevent-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/META.yml?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/META.yml (original)
+++ branches/upstream/libanyevent-perl/current/META.yml Sun Aug  2 22:49:09 2009
@@ -11,7 +11,7 @@
    },
    "generated_by" : "ExtUtils::MakeMaker version 6.50",
    "distribution_type" : "module",
-   "version" : "4.9",
+   "version" : "4.881",
    "name" : "AnyEvent",
    "author" : [],
    "license" : "unknown",
@@ -23,7 +23,7 @@
       "Net::SSLeay" : 1.33,
       "Guard" : 1.02,
       "EV" : 3.05,
-      "Async::Interrupt" : 1,
+      "Async::Interrupt" : 0.6,
       "JSON::XS" : 2.2,
       "JSON" : 2.09
    },

Modified: branches/upstream/libanyevent-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/Makefile.PL?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/Makefile.PL (original)
+++ branches/upstream/libanyevent-perl/current/Makefile.PL Sun Aug  2 22:49:09 2009
@@ -37,7 +37,7 @@
            "JSON::XS"         => 2.2,
            "EV"               => 3.05,
            "Guard"            => 1.02,
-           "Async::Interrupt" => 1.0,
+           "Async::Interrupt" => 0.6,
         }
     },
 );

Modified: branches/upstream/libanyevent-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/README?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/README (original)
+++ branches/upstream/libanyevent-perl/current/README Sun Aug  2 22:49:09 2009
@@ -175,12 +175,6 @@
     declared.
 
   I/O WATCHERS
-       $w = AnyEvent->io (
-          fh   => <filehandle_or_fileno>,
-          poll => <"r" or "w">,
-          cb   => <callback>,
-       );
-
     You can create an I/O watcher by calling the "AnyEvent->io" method with
     the following mandatory key-value pairs as arguments:
 
@@ -218,14 +212,6 @@
        });
 
   TIME WATCHERS
-       $w = AnyEvent->timer (after => <seconds>, cb => <callback>);
-
-       $w = AnyEvent->timer (
-          after    => <fractional_seconds>,
-          interval => <fractional_seconds>,
-          cb       => <callback>,
-       );
-
     You can create a time watcher by calling the "AnyEvent->timer" method
     with the following mandatory arguments:
 
@@ -359,8 +345,6 @@
         Note that updating the time *might* cause some events to be handled.
 
   SIGNAL WATCHERS
-       $w = AnyEvent->signal (signal => <uppercase_signal_name>, cb => <callback>);
-
     You can watch for signals using a signal watcher, "signal" is the signal
     *name* in uppercase and without any "SIG" prefix, "cb" is the Perl
     callback to be invoked whenever a signal occurs.
@@ -389,25 +373,19 @@
    Signal Races, Delays and Workarounds
     Many event loops (e.g. Glib, Tk, Qt, IO::Async) do not support attaching
     callbacks to signals in a generic way, which is a pity, as you cannot do
-    race-free signal handling in perl, requiring C libraries for this.
-    AnyEvent will try to do it's best, which means in some cases, signals
-    will be delayed. The maximum time a signal might be delayed is specified
-    in $AnyEvent::MAX_SIGNAL_LATENCY (default: 10 seconds). This variable
-    can be changed only before the first signal watcher is created, and
-    should be left alone otherwise. This variable determines how often
-    AnyEvent polls for signals (in case a wake-up was missed). Higher values
+    race-free signal handling in perl. AnyEvent will try to do it's best,
+    but in some cases, signals will be delayed. The maximum time a signal
+    might be delayed is specified in $AnyEvent::MAX_SIGNAL_LATENCY (default:
+    10 seconds). This variable can be changed only before the first signal
+    watcher is created, and should be left alone otherwise. Higher values
     will cause fewer spurious wake-ups, which is better for power and CPU
-    saving.
-
-    All these problems can be avoided by installing the optional
-    Async::Interrupt module, which works with most event loops. It will not
-    work with inherently broken event loops such as Event or Event::Lib (and
-    not with POE currently, as POE does it's own workaround with one-second
-    latency). For those, you just have to suffer the delays.
+    saving. All these problems can be avoided by installing the optional
+    Async::Interrupt module. This will not work with inherently broken event
+    loops such as Event or Event::Lib (and not with POE currently, as POE
+    does it's own workaround with one-second latency). With those, you just
+    have to suffer the delays.
 
   CHILD PROCESS WATCHERS
-       $w = AnyEvent->child (pid => <process id>, cb => <callback>);
-
     You can also watch on a child process exit and catch its exit status.
 
     The child process is specified by the "pid" argument (one some backends,
@@ -463,8 +441,6 @@
        $done->recv;
 
   IDLE WATCHERS
-       $w = AnyEvent->idle (cb => <callback>);
-
     Sometimes there is a need to do something, but it is not so important to
     do it instantly, but only when there is nothing better to do. This
     "nothing better to do" is usually defined to be "no other events need
@@ -499,11 +475,6 @@
        });
 
   CONDITION VARIABLES
-       $cv = AnyEvent->condvar;
-
-       $cv->send (<list>);
-       my @res = $cv->recv;
-
     If you are familiar with some event loops you will know that all of them
     require you to run some blocking "loop", "run" or similar function that
     will actively watch for new events and call your callbacks.
@@ -762,11 +733,10 @@
         This is a mutator function that returns the callback set and
         optionally replaces it before doing so.
 
-        The callback will be called when the condition becomes (or already
-        was) "true", i.e. when "send" or "croak" are called (or were
-        called), with the only argument being the condition variable itself.
-        Calling "recv" inside the callback or at any later time is
-        guaranteed not to block.
+        The callback will be called when the condition becomes "true", i.e.
+        when "send" or "croak" are called, with the only argument being the
+        condition variable itself. Calling "recv" inside the callback or at
+        any later time is guaranteed not to block.
 
 SUPPORTED EVENT LOOPS/BACKENDS
     The available backend classes are (every class has its own manpage):

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=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm Sun Aug  2 22:49:09 2009
@@ -183,12 +183,6 @@
 
 =head2 I/O WATCHERS
 
-   $w = AnyEvent->io (
-      fh   => <filehandle_or_fileno>,
-      poll => <"r" or "w">,
-      cb   => <callback>,
-   );
-
 You can create an I/O watcher by calling the C<< AnyEvent->io >> method
 with the following mandatory key-value pairs as arguments:
 
@@ -227,14 +221,6 @@
 
 =head2 TIME WATCHERS
 
-   $w = AnyEvent->timer (after => <seconds>, cb => <callback>);
-
-   $w = AnyEvent->timer (
-      after    => <fractional_seconds>,
-      interval => <fractional_seconds>,
-      cb       => <callback>,
-   );
-
 You can create a time watcher by calling the C<< AnyEvent->timer >>
 method with the following mandatory arguments:
 
@@ -371,8 +357,6 @@
 
 =head2 SIGNAL WATCHERS
 
-   $w = AnyEvent->signal (signal => <uppercase_signal_name>, cb => <callback>);
-
 You can watch for signals using a signal watcher, C<signal> is the signal
 I<name> in uppercase and without any C<SIG> prefix, C<cb> is the Perl
 callback to be invoked whenever a signal occurs.
@@ -401,26 +385,20 @@
 =head3 Signal Races, Delays and Workarounds
 
 Many event loops (e.g. Glib, Tk, Qt, IO::Async) do not support attaching
-callbacks to signals in a generic way, which is a pity, as you cannot
-do race-free signal handling in perl, requiring C libraries for
-this. AnyEvent will try to do it's best, which means in some cases,
-signals will be delayed. The maximum time a signal might be delayed is
-specified in C<$AnyEvent::MAX_SIGNAL_LATENCY> (default: 10 seconds). This
-variable can be changed only before the first signal watcher is created,
-and should be left alone otherwise. This variable determines how often
-AnyEvent polls for signals (in case a wake-up was missed). Higher values
+callbacks to signals in a generic way, which is a pity, as you cannot do
+race-free signal handling in perl. AnyEvent will try to do it's best, but
+in some cases, signals will be delayed. The maximum time a signal might
+be delayed is specified in C<$AnyEvent::MAX_SIGNAL_LATENCY> (default: 10
+seconds). This variable can be changed only before the first signal
+watcher is created, and should be left alone otherwise. Higher values
 will cause fewer spurious wake-ups, which is better for power and CPU
-saving.
-
-All these problems can be avoided by installing the optional
-L<Async::Interrupt> module, which works with most event loops. It will not
-work with inherently broken event loops such as L<Event> or L<Event::Lib>
-(and not with L<POE> currently, as POE does it's own workaround with
-one-second latency). For those, you just have to suffer the delays.
+saving. All these problems can be avoided by installing the optional
+L<Async::Interrupt> module. This will not work with inherently broken
+event loops such as L<Event> or L<Event::Lib> (and not with L<POE>
+currently, as POE does it's own workaround with one-second latency). With
+those, you just have to suffer the delays.
 
 =head2 CHILD PROCESS WATCHERS
-
-   $w = AnyEvent->child (pid => <process id>, cb => <callback>);
 
 You can also watch on a child process exit and catch its exit status.
 
@@ -479,8 +457,6 @@
 
 =head2 IDLE WATCHERS
 
-   $w = AnyEvent->idle (cb => <callback>);
-
 Sometimes there is a need to do something, but it is not so important
 to do it instantly, but only when there is nothing better to do. This
 "nothing better to do" is usually defined to be "no other events need
@@ -516,11 +492,6 @@
 
 =head2 CONDITION VARIABLES
 
-   $cv = AnyEvent->condvar;
-
-   $cv->send (<list>);
-   my @res = $cv->recv;
-
 If you are familiar with some event loops you will know that all of them
 require you to run some blocking "loop", "run" or similar function that
 will actively watch for new events and call your callbacks.
@@ -792,10 +763,10 @@
 This is a mutator function that returns the callback set and optionally
 replaces it before doing so.
 
-The callback will be called when the condition becomes (or already was)
-"true", i.e. when C<send> or C<croak> are called (or were called), with
-the only argument being the condition variable itself. Calling C<recv>
-inside the callback or at any later time is guaranteed not to block.
+The callback will be called when the condition becomes "true", i.e. when
+C<send> or C<croak> are called, with the only argument being the condition
+variable itself. Calling C<recv> inside the callback or at any later time
+is guaranteed not to block.
 
 =back
 
@@ -1117,7 +1088,7 @@
 
 use Carp ();
 
-our $VERSION = 4.9;
+our $VERSION = 4.881;
 our $MODEL;
 
 our $AUTOLOAD;
@@ -1320,15 +1291,6 @@
 # default implementation for ->signal
 
 our $HAVE_ASYNC_INTERRUPT;
-
-sub _have_async_interrupt() {
-   $HAVE_ASYNC_INTERRUPT = 1*(!$ENV{PERL_ANYEVENT_AVOID_ASYNC_INTERRUPT}
-                              && eval "use Async::Interrupt 1.0 (); 1")
-      unless defined $HAVE_ASYNC_INTERRUPT;
-
-   $HAVE_ASYNC_INTERRUPT
-}
-
 our ($SIGPIPE_R, $SIGPIPE_W, %SIG_CB, %SIG_EV, $SIG_IO);
 our (%SIG_ASY, %SIG_ASY_W);
 our ($SIG_COUNT, $SIG_TW);
@@ -1346,7 +1308,7 @@
    }
 }
 
-# install a dummy wakeup watcher to reduce signal catching latency
+# install a dumym wakeupw atcher to reduce signal catching latency
 sub _sig_add() {
    unless ($SIG_COUNT++) {
       # try to align timer on a full-second boundary, if possible
@@ -1365,131 +1327,99 @@
       unless --$SIG_COUNT;
 }
 
-our $_sig_name_init; $_sig_name_init = sub {
-   eval q{ # poor man's autoloading
-      undef $_sig_name_init;
-
-      if (_have_async_interrupt) {
-         *sig2num  = \&Async::Interrupt::sig2num;
-         *sig2name = \&Async::Interrupt::sig2name;
+sub _signal {
+   my (undef, %arg) = @_;
+
+   my $signal = uc $arg{signal}
+      or Carp::croak "required option 'signal' is missing";
+
+   $SIG_CB{$signal}{$arg{cb}} = $arg{cb};
+
+   if ($HAVE_ASYNC_INTERRUPT) {
+      # async::interrupt
+
+      $SIG_ASY{$signal} ||= do {
+         my $asy = new Async::Interrupt
+            cb     => sub { undef $SIG_EV{$signal} },
+            signal => $signal,
+            pipe   => [$SIGPIPE_R->filenos],
+         ;
+         $asy->pipe_autodrain (0);
+
+         $asy
+      };
+
+   } else {
+      # pure perl
+
+      $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"
+}
+
+sub signal {
+   # probe for availability of Async::Interrupt
+   if (!$ENV{PERL_ANYEVENT_AVOID_ASYNC_INTERRUPT} && eval "use Async::Interrupt 0.6 (); 1") {
+      warn "AnyEvent: using Async::Interrupt for race-free signal handling.\n" if $VERBOSE >= 8;
+
+      $HAVE_ASYNC_INTERRUPT = 1;
+      $SIGPIPE_R = new Async::Interrupt::EventPipe;
+      $SIG_IO = AnyEvent->io (fh => $SIGPIPE_R->fileno, poll => "r", cb => \&_signal_exec);
+
+   } else {
+      warn "AnyEvent: using emulated perl signal handling with latency timer.\n" if $VERBOSE >= 8;
+
+      require Fcntl;
+
+      if (AnyEvent::WIN32) {
+         require AnyEvent::Util;
+
+         ($SIGPIPE_R, $SIGPIPE_W) = AnyEvent::Util::portable_pipe ();
+         AnyEvent::Util::fh_nonblocking ($SIGPIPE_R) if $SIGPIPE_R;
+         AnyEvent::Util::fh_nonblocking ($SIGPIPE_W) if $SIGPIPE_W; # just in case
       } else {
-         require Config;
-
-         my %signame2num;
-         @signame2num{ split ' ', $Config::Config{sig_name} }
-                        = split ' ', $Config::Config{sig_num};
-
-         my @signum2name;
-         @signum2name[values %signame2num] = keys %signame2num;
-
-         *sig2num = sub($) {
-            $_[0] > 0 ? shift : $signame2num{+shift}
-         };
-         *sig2name = sub ($) {
-            $_[0] > 0 ? $signum2name[+shift] : shift
-         };
+         pipe $SIGPIPE_R, $SIGPIPE_W;
+         fcntl $SIGPIPE_R, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK if $SIGPIPE_R;
+         fcntl $SIGPIPE_W, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK if $SIGPIPE_W; # just in case
+
+         # not strictly required, as $^F is normally 2, but let's make sure...
+         fcntl $SIGPIPE_R, &Fcntl::F_SETFD, &Fcntl::FD_CLOEXEC;
+         fcntl $SIGPIPE_W, &Fcntl::F_SETFD, &Fcntl::FD_CLOEXEC;
       }
-   };
-   die if $@;
-};
-
-sub sig2num ($) { &$_sig_name_init; &sig2num  }
-sub sig2name($) { &$_sig_name_init; &sig2name }
-
-sub signal {
-   eval q{ # poor man's autoloading {}
-      # probe for availability of Async::Interrupt 
-      if (_have_async_interrupt) {
-         warn "AnyEvent: using Async::Interrupt for race-free signal handling.\n" if $VERBOSE >= 8;
-
-         $SIGPIPE_R = new Async::Interrupt::EventPipe;
-         $SIG_IO = AnyEvent->io (fh => $SIGPIPE_R->fileno, poll => "r", cb => \&_signal_exec);
-
-      } else {
-         warn "AnyEvent: using emulated perl signal handling with latency timer.\n" if $VERBOSE >= 8;
-
-         require Fcntl;
-
-         if (AnyEvent::WIN32) {
-            require AnyEvent::Util;
-
-            ($SIGPIPE_R, $SIGPIPE_W) = AnyEvent::Util::portable_pipe ();
-            AnyEvent::Util::fh_nonblocking ($SIGPIPE_R, 1) if $SIGPIPE_R;
-            AnyEvent::Util::fh_nonblocking ($SIGPIPE_W, 1) if $SIGPIPE_W; # just in case
-         } else {
-            pipe $SIGPIPE_R, $SIGPIPE_W;
-            fcntl $SIGPIPE_R, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK if $SIGPIPE_R;
-            fcntl $SIGPIPE_W, &Fcntl::F_SETFL, &Fcntl::O_NONBLOCK if $SIGPIPE_W; # just in case
-
-            # not strictly required, as $^F is normally 2, but let's make sure...
-            fcntl $SIGPIPE_R, &Fcntl::F_SETFD, &Fcntl::FD_CLOEXEC;
-            fcntl $SIGPIPE_W, &Fcntl::F_SETFD, &Fcntl::FD_CLOEXEC;
-         }
-
-         $SIGPIPE_R
-            or Carp::croak "AnyEvent: unable to create a signal reporting pipe: $!\n";
-
-         $SIG_IO = AnyEvent->io (fh => $SIGPIPE_R, poll => "r", cb => \&_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"
-      };
-
-      *AnyEvent::Base::signal::DESTROY = sub {
-         my ($signal, $cb) = @{$_[0]};
-
-         _sig_del;
-
-         delete $SIG_CB{$signal}{$cb};
-
-         $HAVE_ASYNC_INTERRUPT
-            ? delete $SIG_ASY{$signal}
-            : # delete doesn't work with older perls - they then
-              # print weird messages, or just unconditionally exit
-              # instead of getting the default action.
-              undef $SIG{$signal}
-            unless keys %{ $SIG_CB{$signal} };
-      };
-   };
-   die if $@;
+
+      $SIGPIPE_R
+         or Carp::croak "AnyEvent: unable to create a signal reporting pipe: $!\n";
+
+      $SIG_IO = AnyEvent->io (fh => $SIGPIPE_R, poll => "r", cb => \&_signal_exec);
+   }
+
+   *signal = \&_signal;
    &signal
+}
+
+sub AnyEvent::Base::signal::DESTROY {
+   my ($signal, $cb) = @{$_[0]};
+
+   _sig_del;
+
+   delete $SIG_CB{$signal}{$cb};
+
+   $HAVE_ASYNC_INTERRUPT
+      ? delete $SIG_ASY{$signal}
+      : # delete doesn't work with older perls - they then
+        # print weird messages, or just unconditionally exit
+        # instead of getting the default action.
+        undef $SIG{$signal}
+      unless keys %{ $SIG_CB{$signal} };
 }
 
 # default implementation for ->child
@@ -1636,14 +1566,8 @@
 }
 
 sub cb {
-   my $cv = shift;
-
-   @_
-      and $cv->{_ae_cb} = shift
-      and $cv->{_ae_sent}
-      and (delete $cv->{_ae_cb})->($cv);
-
-   $cv->{_ae_cb}
+   $_[0]{_ae_cb} = $_[1] if @_ > 1;
+   $_[0]{_ae_cb}
 }
 
 sub begin {
@@ -1659,48 +1583,6 @@
 # undocumented/compatibility with pre-3.4
 *broadcast = \&send;
 *wait      = \&_wait;
-
-#############################################################################
-# "new" API, currently only emulation of it
-#############################################################################
-
-package AE;
-
-sub io($$$) {
-   AnyEvent->io (fh => $_[0], poll => $_[1] ? "w" : "r", cb => $_[2])
-}
-
-sub timer($$$) {
-   AnyEvent->timer (after => $_[0], interval => $_[1], cb => $_[2]);
-}
-
-sub signal($$) {
-   AnyEvent->signal (signal => $_[0], cb => $_[1]);
-}
-
-sub child($$) {
-   AnyEvent->child (pid => $_[0], cb => $_[1]);
-}
-
-sub idle($) {
-   AnyEvent->idle (cb => $_[0]);
-}
-
-sub cv() {
-   AnyEvent->condvar
-}
-
-sub now() {
-   AnyEvent->now
-}
-
-sub now_update() {
-   AnyEvent->now_update
-}
-
-sub time() {
-   AnyEvent->time
-}
 
 =head1 ERROR AND EXCEPTION HANDLING
 

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=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm Sun Aug  2 22:49:09 2009
@@ -34,7 +34,7 @@
 use AnyEvent (); BEGIN { AnyEvent::common_sense }
 use AnyEvent::Util qw(AF_INET6);
 
-our $VERSION = 4.9;
+our $VERSION = 4.881;
 
 our @DNS_FALLBACK = (v208.67.220.220, v208.67.222.222);
 

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=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm Sun Aug  2 22:49:09 2009
@@ -13,7 +13,7 @@
 
 =cut
 
-our $VERSION = 4.9;
+our $VERSION = 4.881;
 
 =head1 SYNOPSIS
 
@@ -602,16 +602,6 @@
 
 sub on_starttls {
    $_[0]{on_stoptls} = $_[1];
-}
-
-=item $handle->rbuf_max ($max_octets)
-
-Configures the C<rbuf_max> setting (C<undef> disables it).
-
-=cut
-
-sub rbuf_max {
-   $_[0]{rbuf_max} = $_[1];
 }
 
 #############################################################################
@@ -996,6 +986,13 @@
    return if $self->{_skip_drain_rbuf};
    local $self->{_skip_drain_rbuf} = 1;
 
+   if (
+      defined $self->{rbuf_max}
+      && $self->{rbuf_max} < length $self->{rbuf}
+   ) {
+      $self->_error (Errno::ENOSPC, 1), return;
+   }
+
    while () {
       # we need to use a separate tls read buffer, as we must not receive data while
       # we are draining the buffer, and this can only happen with TLS.
@@ -1044,13 +1041,6 @@
          : $self->_error (0, 1, "Unexpected end-of-file");
 
       return;
-   }
-
-   if (
-      defined $self->{rbuf_max}
-      && $self->{rbuf_max} < length $self->{rbuf}
-   ) {
-      $self->_error (Errno::ENOSPC, 1), return;
    }
 
    # may need to restart read watcher

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Event.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Event.pm?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Event.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Event.pm Sun Aug  2 22:49:09 2009
@@ -53,12 +53,8 @@
 
 sub signal {
    my (undef, %arg) = @_;
-
-   my $cb = $arg{cb};
-   my $w = Event->signal (
-      signal => AnyEvent::Base::sig2name $arg{signal},
-      cb     => sub { &$cb }, # event doesn't like callable objects
-   );
+   my $cb = $arg{cb}; $arg{cb} = sub { &$cb }; # event doesn't like callable objects
+   my $w = Event->signal (%arg);
 
    AnyEvent::Base::_sig_add;
    bless \$w, "AnyEvent::Impl::Event::signal"

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EventLib.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EventLib.pm?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EventLib.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EventLib.pm Sun Aug  2 22:49:09 2009
@@ -44,6 +44,7 @@
 package AnyEvent::Impl::EventLib;
 
 use AnyEvent (); BEGIN { AnyEvent::common_sense }
+use AnyEvent::Util ();
 
 use Event::Lib;
 
@@ -100,7 +101,7 @@
 sub signal {
    my (undef, %arg) = @_;
 
-   my $w = signal_new AnyEvent::Base::sig2num $arg{signal}, $ccb, $arg{cb};
+   my $w = signal_new AnyEvent::Util::sig2num $arg{signal}, $ccb, $arg{cb};
    event_add $w;
    AnyEvent::Base::_sig_add;
    bless \\$w, "AnyEvent::Impl::EventLib::signal"

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Glib.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Glib.pm?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Glib.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Glib.pm Sun Aug  2 22:49:09 2009
@@ -65,7 +65,7 @@
    my $cb   = $arg{cb};
    my $ival = $arg{interval} * 1000;
 
-   my $source; $source = add Glib::Timeout $arg{after} < 0 ? 0 : $arg{after} * 1000,
+   my $source; $source = add Glib::Timeout $arg{after} * 1000,
       $ival ? sub {
                 remove Glib::Source $source;
                 $source = add Glib::Timeout $ival, sub { &$cb; 1 };

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/POE.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/POE.pm?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/POE.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/POE.pm Sun Aug  2 22:49:09 2009
@@ -342,7 +342,7 @@
 
 sub signal {
    my ($class, %arg) = @_;
-   my $signal = AnyEvent::Base::sig2name delete $arg{signal};
+   my $signal = delete $arg{signal};
    my $cb     = delete $arg{cb}; my $cb = sub { &$cb }; # POE doesn't like callable objects
    my $session = POE::Session->create (
       inline_states => {

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=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm Sun Aug  2 22:49:09 2009
@@ -110,7 +110,7 @@
 use AnyEvent (); BEGIN { AnyEvent::common_sense }
 use AnyEvent::Util ();
 
-our $VERSION = 4.9;
+our $VERSION = 4.881;
 
 our ($NOW, $MNOW);
 

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm Sun Aug  2 22:49:09 2009
@@ -47,7 +47,7 @@
 
 our @EXPORT = qw(
    getprotobyname
-   parse_hostport format_hostport
+   parse_hostport
    parse_ipv4 parse_ipv6
    parse_ip parse_address
    format_ipv4 format_ipv6
@@ -58,7 +58,7 @@
    tcp_connect
 );
 
-our $VERSION = 4.9;
+our $VERSION = 4.881;
 
 =item $ipn = parse_ipv4 $dotted_quad
 
@@ -229,7 +229,7 @@
 It also supports defaulting the service name in a simple way by using
 C<$default_service> if no service was detected. If neither a service was
 detected nor a default was specified, then this function returns the
-empty list. The same happens when a parse error was detected, such as a
+empty list. The same happens when a parse error weas detected, such as a
 hostname with a colon in it (the function is rather conservative, though).
 
 Example:
@@ -280,22 +280,6 @@
    return if $host =~ /:/ && !parse_ipv6 $host;
 
    ($host, $port)
-}
-
-=item $string = format_hostport $host, $port
-
-Takes a host (in textual form) and a port and formats in unambigiously in
-a way that C<parse_hostport> can parse it again. C<$port> can be C<undef>.
-
-=cut
-
-sub format_hostport($;$) {
-   my ($host, $port) = @_;
-
-   $port = ":$port"  if length $port;
-   $host = "[$host]" if $host =~ /:/;
-
-   "$host$port"
 }
 
 =item $sa_family = address_family $ipn

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Strict.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Strict.pm?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Strict.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Strict.pm Sun Aug  2 22:49:09 2009
@@ -27,6 +27,7 @@
 use Fcntl ();
 
 use AnyEvent (); BEGIN { AnyEvent::common_sense }
+use AnyEvent::Util ();
 
 our @ISA;
 
@@ -98,7 +99,7 @@
       or croak "AnyEvent->signal called with illegal cb argument '$arg{cb}'";
    delete $arg{cb};
  
-   defined AnyEvent::Base::sig2num $arg{signal} and $arg{signal} == 0
+   defined AnyEvent::Util::sig2num $arg{signal}
       or croak "AnyEvent->signal called with illegal signal name '$arg{signal}'";
    delete $arg{signal};
  

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/TLS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/TLS.pm?rev=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/TLS.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/TLS.pm Sun Aug  2 22:49:09 2009
@@ -14,7 +14,7 @@
 
 =cut
 
-our $VERSION = 4.9;
+our $VERSION = 4.881;
 
 =head1 SYNOPSIS
 

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=41098&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm Sun Aug  2 22:49:09 2009
@@ -31,7 +31,7 @@
 our @EXPORT = qw(fh_nonblocking guard fork_call portable_pipe portable_socketpair);
 our @EXPORT_OK = qw(AF_INET6 WSAEWOULDBLOCK WSAEINPROGRESS WSAEINVAL);
 
-our $VERSION = 4.9;
+our $VERSION = 4.881;
 
 BEGIN {
    my $af_inet6 = eval { local $SIG{__DIE__}; &Socket::AF_INET6 };
@@ -426,6 +426,23 @@
    goto &guard;
 }
 
+#############################################################################
+
+our %SIGNAME2NUM;
+
+sub sig2num($) {
+   return shift if $_[0] > 0;
+
+   unless (scalar keys %SIGNAME2NUM) {
+      require Config;
+
+      @SIGNAME2NUM{ split ' ', $Config::Config{sig_name} }
+                  = split ' ', $Config::Config{sig_num};
+   }
+
+   $SIGNAME2NUM{+shift}
+}
+
 1;
 
 =back




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