r39717 - in /branches/upstream/libanyevent-perl/current: ./ lib/ lib/AnyEvent/ lib/AnyEvent/Impl/ t/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Sat Jul 11 20:12:37 UTC 2009
Author: jawnsy-guest
Date: Sat Jul 11 20:12:31 2009
New Revision: 39717
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=39717
Log:
[svn-upgrade] Integrating new upstream version, libanyevent-perl (4.820)
Modified:
branches/upstream/libanyevent-perl/current/Changes
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/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/IOAsync.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
branches/upstream/libanyevent-perl/current/t/03_child.t
Modified: branches/upstream/libanyevent-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/Changes?rev=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/Changes (original)
+++ branches/upstream/libanyevent-perl/current/Changes Sat Jul 11 20:12:31 2009
@@ -1,4 +1,15 @@
Revision history for Perl extension AnyEvent.
+
+4.82 Sat Jul 11 00:34:55 CEST 2009
+ - POE and Event backends didn't accept some callable objects as
+ callbacks.
+ - use Config module instead of POSIX module to detect signal names
+ in AnyEvent::Strict and AnyEvent::Impl::EventLib, as the POSIX
+ module doesn't even have all POSIX signals :/.
+ - use more workarounds around the many refcnt/corruption bugs in
+ Event::Lib.
+ - work around a race condition in perl's select, causing t/03_child.t
+ to rarely fail.
4.81 Thu Jul 9 10:30:30 CEST 2009
- AnyEvent::Handle didn't properly diagnose write errors
Modified: branches/upstream/libanyevent-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/META.yml?rev=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/META.yml (original)
+++ branches/upstream/libanyevent-perl/current/META.yml Sat Jul 11 20:12:31 2009
@@ -1,26 +1,33 @@
---- #YAML:1.0
-name: AnyEvent
-version: 4.81
-abstract: ~
-author: []
-license: unknown
-distribution_type: module
-configure_requires:
- ExtUtils::MakeMaker: 0
-build_requires:
- ExtUtils::MakeMaker: 0
-requires: {}
-no_index:
- directory:
- - t
- - inc
-generated_by: ExtUtils::MakeMaker version 6.50
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
-recommends:
- EV: 3.05
- Guard: 1.02
- JSON: 2.09
- JSON::XS: 2.2
- Net::SSLeay: 1.33
+{
+ "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.50",
+ "distribution_type" : "module",
+ "version" : "4.82",
+ "name" : "AnyEvent",
+ "author" : [],
+ "license" : "unknown",
+ "build_requires" : {
+ "ExtUtils::MakeMaker" : 0
+ },
+ "requires" : {},
+ "recommends" : {
+ "Net::SSLeay" : 1.33,
+ "Guard" : 1.02,
+ "EV" : 3.05,
+ "JSON::XS" : 2.2,
+ "JSON" : 2.09
+ },
+ "abstract" : null,
+ "configure_requires" : {
+ "ExtUtils::MakeMaker" : 0
+ }
+}
Modified: branches/upstream/libanyevent-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/README?rev=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/README (original)
+++ branches/upstream/libanyevent-perl/current/README Sat Jul 11 20:12:31 2009
@@ -1588,8 +1588,9 @@
emulation for event loops that do not support them natively. Also,
some event loops install a similar handler.
- If, when AnyEvent is loaded, SIGCHLD is set to IGNORE, then AnyEvent
- will reset it to default, to avoid losing child exit statuses.
+ Additionally, when AnyEvent is loaded and SIGCHLD is set to IGNORE,
+ then AnyEvent will reset it to default, to avoid losing child exit
+ statuses.
SIGPIPE
A no-op handler is installed for "SIGPIPE" when $SIG{PIPE} is
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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm Sat Jul 11 20:12:31 2009
@@ -1035,7 +1035,7 @@
use Carp;
-our $VERSION = 4.81;
+our $VERSION = 4.82;
our $MODEL;
our $AUTOLOAD;
@@ -2102,8 +2102,8 @@
emulation for event loops that do not support them natively. Also, some
event loops install a similar handler.
-If, when AnyEvent is loaded, SIGCHLD is set to IGNORE, then AnyEvent will
-reset it to default, to avoid losing child exit statuses.
+Additionally, when AnyEvent is loaded and SIGCHLD is set to IGNORE, then
+AnyEvent will reset it to default, to avoid losing child exit statuses.
=item SIGPIPE
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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm Sat Jul 11 20:12:31 2009
@@ -37,7 +37,7 @@
use AnyEvent ();
use AnyEvent::Util qw(AF_INET6);
-our $VERSION = 4.81;
+our $VERSION = 4.82;
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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm Sat Jul 11 20:12:31 2009
@@ -16,7 +16,7 @@
=cut
-our $VERSION = 4.81;
+our $VERSION = 4.82;
=head1 SYNOPSIS
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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Event.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Event.pm Sat Jul 11 20:12:31 2009
@@ -33,22 +33,26 @@
my ($class, %arg) = @_;
$arg{fd} = delete $arg{fh};
$arg{poll} .= "e" if AnyEvent::WIN32; # work around windows connect bug
+ my $cb = $arg{cb}; $arg{cb} = sub { &$cb }; # event doesn't like callable objects
bless \(Event->io (%arg)), $class
}
sub timer {
my ($class, %arg) = @_;
$arg{after} = 0 if $arg{after} < 0;
+ my $cb = $arg{cb}; $arg{cb} = sub { &$cb }; # event doesn't like callable objects
bless \Event->timer (%arg, repeat => $arg{interval}), $class
}
sub signal {
my ($class, %arg) = @_;
+ my $cb = $arg{cb}; $arg{cb} = sub { &$cb }; # event doesn't like callable objects
bless \Event->signal (%arg), $class
}
sub idle {
my ($class, %arg) = @_;
+ my $cb = $arg{cb}; $arg{cb} = sub { &$cb }; # event doesn't like callable objects
bless \Event->idle (repeat => 1, min => 0, %arg), $class
}
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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EventLib.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/EventLib.pm Sat Jul 11 20:12:31 2009
@@ -48,7 +48,22 @@
use Carp ();
use AnyEvent ();
+use AnyEvent::Util ();
use Event::Lib;
+
+# Event::Lib doesn't always take a reference to the callback, so closures
+# cause memory corruption and segfaults. it also has an issue actually
+# calling callbacks, so this exists as workaround.
+sub ccb {
+ # Event:Lib accesses $_[0] after the callback, when it might be freed,
+ # so we keep it referenced until after the callback. This still accesses
+ # a freed scalar, but at least it'll not crash.
+ my $keep_it = $_[0];
+
+ $_[2]();
+}
+
+my $ccb = \&ccb;
sub io {
my ($class, %arg) = @_;
@@ -60,7 +75,7 @@
# event_new errornously takes a reference to fh and cb instead of making a copy
# fortunately, going through %arg/_dupfh already makes a copy, so it happpens to work
- my $w = event_new $fh, $mode | EV_PERSIST, $arg{cb};
+ my $w = event_new $fh, $mode | EV_PERSIST, $ccb, $arg{cb};
event_add $w;
bless \\$w, $class
}
@@ -71,7 +86,7 @@
my $ival = $arg{interval};
my $cb = $arg{cb};
- my $w; $w = timer_new
+ my $w; $w = timer_new $ccb,
$ival
? sub { event_add $w, $ival; &$cb }
: sub { undef $w ; &$cb };
@@ -81,22 +96,10 @@
bless \\$w, $class
}
-my %sigidx;
-
-# horrid way to get signal name to value mapping
-eval {
- local $SIG{__DIE__};
- require POSIX;
-
- for (keys %SIG) {
- eval "\$sigidx{$_} = &POSIX::SIG$_";
- }
-};
-
sub signal {
my ($class, %arg) = @_;
- my $w = signal_new $sigidx{$arg{signal}}, $arg{cb};
+ my $w = signal_new AnyEvent::Util::sig2num $arg{signal}, $ccb, $arg{cb};
event_add $w;
bless \\$w, $class
}
Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/IOAsync.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/IOAsync.pm?rev=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/IOAsync.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/IOAsync.pm Sat Jul 11 20:12:31 2009
@@ -57,8 +57,8 @@
not let you watch for any child, and apparently an interface to unregister
child watchers has been forgotten as well.
-As a result, AnyEvent::Impl::IOAsync has to fall back on it's own
-child management, which makes it impossible to watch for childs via
+As a result, AnyEvent::Impl::IOAsync has to fall back on it's own child
+management, which makes it impossible to watch for child processes via
both AnyEvent and IO::Async. Hooking and Patching IO::Async has been
considered, but is considerable work.
@@ -119,9 +119,9 @@
IO::Async has weird checks - passing in a callable reference is sometimes
forbidden (of course, this is checked on every invocation, not when the
-callback is registered, so you have no idea which watcher it caused),
-as the code checks explicitly for code references, disallowing callable
-objects.
+callback is registered, so you have no idea where in your code you passed
+it in), as the code checks explicitly for code references, disallowing
+callable objects.
=item Environmentally unfriendly
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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/POE.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/POE.pm Sat Jul 11 20:12:31 2009
@@ -292,7 +292,7 @@
# any further *g*
my ($fh, $pee) = AnyEvent::_dupfh $arg{poll}, $arg{fh}, "select_read", "select_write";
- my $cb = $arg{cb};
+ my $cb = delete $arg{cb}; my $cb = sub { &$cb }; # POE doesn't like callable objects
my $session = POE::Session->create (
inline_states => {
@@ -307,9 +307,9 @@
sub timer {
my ($class, %arg) = @_;
- my $after = $arg{after};
- my $ival = $arg{interval};
- my $cb = $arg{cb};
+ my $after = delete $arg{after};
+ my $ival = delete $arg{interval};
+ my $cb = delete $arg{cb}; my $cb = sub { &$cb }; # POE doesn't like callable objects
my $session = POE::Session->create (
inline_states => {
@@ -328,7 +328,7 @@
sub signal {
my ($class, %arg) = @_;
my $signal = delete $arg{signal};
- my $cb = delete $arg{cb};
+ my $cb = delete $arg{cb}; my $cb = sub { &$cb }; # POE doesn't like callable objects
my $session = POE::Session->create (
inline_states => {
_start => sub {
@@ -351,7 +351,7 @@
sub child {
my ($class, %arg) = @_;
my $pid = delete $arg{pid};
- my $cb = delete $arg{cb};
+ my $cb = delete $arg{cb}; my $cb = sub { &$cb }; # POE doesn't like callable objects
my $session = POE::Session->create (
inline_states => {
_start => sub {
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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm Sat Jul 11 20:12:31 2009
@@ -113,11 +113,11 @@
use AnyEvent ();
use AnyEvent::Util ();
-our $VERSION = 4.81;
+our $VERSION = 4.82;
our ($NOW, $MNOW);
-sub MAXWAIT() { 1000 } # never sleep for longer than this many seconds
+sub MAXWAIT() { 10 } # never sleep for longer than this many seconds
BEGIN {
local $SIG{__DIE__};
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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm Sat Jul 11 20:12:31 2009
@@ -60,7 +60,7 @@
tcp_connect
);
-our $VERSION = 4.81;
+our $VERSION = 4.82;
=item $ipn = parse_ipv4 $dotted_quad
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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Strict.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Strict.pm Sat Jul 11 20:12:31 2009
@@ -30,6 +30,7 @@
use Fcntl ();
use AnyEvent ();
+use AnyEvent::Util ();
our @ISA;
@@ -101,7 +102,7 @@
or croak "AnyEvent->signal called with illegal cb argument '$arg{cb}'";
delete $arg{cb};
- eval "require POSIX; 0 < &POSIX::SIG$arg{signal}"
+ 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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/TLS.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/TLS.pm Sat Jul 11 20:12:31 2009
@@ -16,7 +16,7 @@
=cut
-our $VERSION = 4.81;
+our $VERSION = 4.82;
=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=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm Sat Jul 11 20:12:31 2009
@@ -34,16 +34,11 @@
our @EXPORT = qw(fh_nonblocking guard fork_call portable_pipe portable_socketpair);
our @EXPORT_OK = qw(AF_INET6 WSAEWOULDBLOCK WSAEINPROGRESS WSAEINVAL WSAWOULDBLOCK);
-our $VERSION = 4.81;
+our $VERSION = 4.82;
BEGIN {
my $posix = 1 * eval { local $SIG{__DIE__}; require POSIX };
eval "sub POSIX() { $posix }";
-}
-
-BEGIN {
- # TODO remove this once not used anymore
- *socket_inet_aton = \&Socket::inet_aton; # take a copy, in case Coro::LWP overrides it
}
BEGIN {
@@ -420,6 +415,23 @@
}
}
+#############################################################################
+
+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
Modified: branches/upstream/libanyevent-perl/current/t/03_child.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/t/03_child.t?rev=39717&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/t/03_child.t (original)
+++ branches/upstream/libanyevent-perl/current/t/03_child.t Sat Jul 11 20:12:31 2009
@@ -60,16 +60,16 @@
$cv2->broadcast;
});
-my $error = AnyEvent->timer (after => 5, cb => sub {
+my $error = AnyEvent->timer (after => 15, cb => sub {
print <<EOF;
Bail out! No child exit detected. This is either a bug in AnyEvent or a bug in your Perl (mostly some windows distributions suffer from that): child watchers might not work properly on this platform. You can force installation of this module if you do not rely on child watchers, or you could upgrade to a working version of Perl for your platform.\n";
EOF
exit 0;
});
-my $inter = AnyEvent->timer (after => 4, cb => sub {
- print "not ok 5 # inter\n";#d# temporary
- print "not ok 6 # inter\n";#d# temporary
+my $inter = AnyEvent->timer (after => 14, cb => sub {
+ print "not ok 5 # inter\n";
+ print "not ok 6 # inter\n";
$cv2->send;
});
More information about the Pkg-perl-cvs-commits
mailing list