Hello community, here is the log from the commit of package perl-AnyEvent for openSUSE:Factory checked in at 2013-06-05 17:47:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-AnyEvent (Old) and /work/SRC/openSUSE:Factory/.perl-AnyEvent.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-AnyEvent" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-AnyEvent/perl-AnyEvent.changes 2012-09-14 12:33:33.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-AnyEvent.new/perl-AnyEvent.changes 2013-06-05 17:47:07.000000000 +0200 @@ -1,0 +2,10 @@ +Mon Jun 3 11:24:29 UTC 2013 - [email protected] + +- updated to 7.04 + - debugging code left in. + - AnyEvent::Socket::inet_aton did not work when dns resolution was + used to find the addresses (analyzed and patch by Maxime Soulé). + - fix a memory leak in the /etc/hosts lookup code when hosts don't + resolve and are not in hosts (analyzed by sten). + +------------------------------------------------------------------- Old: ---- AnyEvent-7.02.tar.gz New: ---- AnyEvent-7.04.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-AnyEvent.spec ++++++ --- /var/tmp/diff_new_pack.h3Za1o/_old 2013-06-05 17:47:08.000000000 +0200 +++ /var/tmp/diff_new_pack.h3Za1o/_new 2013-06-05 17:47:08.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-AnyEvent # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: perl-AnyEvent -Version: 7.02 +Version: 7.04 Release: 0 %define cpan_name AnyEvent Summary: the DBI of event loop programming @@ -25,6 +25,8 @@ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/AnyEvent/ Source: http://www.cpan.org/authors/id/M/ML/MLEHMANN/%{cpan_name}-%{version}.tar.gz +# MANUAL +#BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros ++++++ AnyEvent-7.02.tar.gz -> AnyEvent-7.04.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/Changes new/AnyEvent-7.04/Changes --- old/AnyEvent-7.02/Changes 2012-08-14 04:28:00.000000000 +0200 +++ new/AnyEvent-7.04/Changes 2012-11-15 02:24:06.000000000 +0100 @@ -7,6 +7,15 @@ TODO: FAQ: scope-ids? hosts file order? TODO: AnyEvent::Handle with AnyEvent::IO? +7.04 Thu Nov 15 02:23:58 CET 2012 + - debugging code left in. + +7.03 Thu Nov 15 02:16:11 CET 2012 + - AnyEvent::Socket::inet_aton did not work when dns resolution was + used to find the addresses (analyzed and patch by Maxime Soulé). + - fix a memory leak in the /etc/hosts lookup code when hosts don't + resolve and are not in hosts (analyzed by sten). + 7.02 Tue Aug 14 04:27:58 CEST 2012 - AnyEvent::Util::run_cmd could block indefinitely (analyzed and test program by Yorhel). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/META.json new/AnyEvent-7.04/META.json --- old/AnyEvent-7.02/META.json 2012-08-14 05:06:44.000000000 +0200 +++ new/AnyEvent-7.04/META.json 2012-11-15 02:24:58.000000000 +0100 @@ -44,5 +44,5 @@ } }, "release_status" : "stable", - "version" : "7.02" + "version" : "7.04" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/META.yml new/AnyEvent-7.04/META.yml --- old/AnyEvent-7.02/META.yml 2012-08-14 05:06:43.000000000 +0200 +++ new/AnyEvent-7.04/META.yml 2012-11-15 02:24:58.000000000 +0100 @@ -26,4 +26,4 @@ Net::SSLeay: 1.33 Task::Weaken: 0 requires: {} -version: 7.02 +version: 7.04 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/constants.pl.PL new/AnyEvent-7.04/constants.pl.PL --- old/AnyEvent-7.02/constants.pl.PL 2012-03-28 00:24:04.000000000 +0200 +++ new/AnyEvent-7.04/constants.pl.PL 2012-09-22 02:22:48.000000000 +0200 @@ -10,7 +10,7 @@ BEGIN { eval "use POSIX ()" } open my $fh, ">lib/AnyEvent/constants.pl" - or die "lib/AnyEvent/constants.pl: $_[0]\n"; + or die "lib/AnyEvent/constants.pl: $!\n"; my $oldstdout = select $fh; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/lib/AnyEvent/Debug.pm new/AnyEvent-7.04/lib/AnyEvent/Debug.pm --- old/AnyEvent-7.02/lib/AnyEvent/Debug.pm 2012-04-08 06:20:09.000000000 +0200 +++ new/AnyEvent-7.04/lib/AnyEvent/Debug.pm 2012-09-25 19:20:59.000000000 +0200 @@ -176,7 +176,7 @@ t enable tracing for newly created watchers (enabled by default) ut disable tracing for newly created watchers t id,... enable tracing for the given watcher (enabled by default) -ut id,... disable tracing for the given weatcher +ut id,... disable tracing for the given watcher w id,... converts the watcher ids to watcher objects (for scripting) EOF } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/lib/AnyEvent/IO.pm new/AnyEvent-7.04/lib/AnyEvent/IO.pm --- old/AnyEvent-7.02/lib/AnyEvent/IO.pm 2012-04-13 17:22:58.000000000 +0200 +++ new/AnyEvent-7.04/lib/AnyEvent/IO.pm 2012-10-19 05:19:20.000000000 +0200 @@ -54,14 +54,14 @@ =head1 DESCRIPTION This module provides functions that do I/O in an asynchronous fashion. It -is to to I/O the same as L<AnyEvent> is to event libraries - it only +is to I/O the same as L<AnyEvent> is to event libraries - it only I<interfaces> to other implementations or to a portable pure-perl -implementation (that does not, however, do asynchronous I/O). +implementation (which does not, however, do asynchronous I/O). -The only such implementation that is supported (or even known to the -author) is L<IO::AIO>, which is used automatically when it can be -loaded. If it is not available, L<AnyEvent::IO> falls back to its -(synchronous) pure-perl implementation. +The only other implementation that is supported (or even known to +the author) is L<IO::AIO>, which is used automatically when it can +be loaded. If it is not available, L<AnyEvent::IO> falls back to its +synchronous pure-perl implementation. Unlike L<AnyEvent>, which model to use is currently decided at module load time, not at first use. Future releases might change this. @@ -71,7 +71,7 @@ While disk I/O often seems "instant" compared to, say, socket I/O, there are many situations where your program can block for extended time periods when doing disk I/O. For example, you access a disk on an NFS server and -it is gone - can take ages to respond again, if ever. OR your system is +it is gone - can take ages to respond again, if ever. Or your system is extremely busy because it creates or restores a backup - reading data from disk can then take seconds. Or you use Linux, which for so many years has a close-to-broken VM/IO subsystem that can often induce minutes or more of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/lib/AnyEvent/Socket.pm new/AnyEvent-7.04/lib/AnyEvent/Socket.pm --- old/AnyEvent-7.02/lib/AnyEvent/Socket.pm 2012-06-25 13:03:52.000000000 +0200 +++ new/AnyEvent-7.04/lib/AnyEvent/Socket.pm 2012-11-15 02:24:42.000000000 +0100 @@ -493,7 +493,7 @@ if ($ipv4) { $cv->begin; AnyEvent::DNS::a ($name, sub { - $res[$ipv4] = [map &parse_ipv4, @_]; + $res[$ipv4] = [map { parse_ipv4 $_ } @_]; $cv->end; }); }; @@ -501,7 +501,7 @@ if ($ipv6) { $cv->begin; AnyEvent::DNS::aaaa ($name, sub { - $res[$ipv6] = [map &parse_ipv6, @_]; + $res[$ipv6] = [map { parse_ipv6 $_ } @_]; $cv->end; }); }; @@ -671,7 +671,7 @@ } } -# helper function - unless dns delivered results, check and parse hosts, then clal continuation code +# helper function - unless dns delivered results, check and parse hosts, then call continuation code sub _load_hosts_unless(&$@) { my ($cont, $cv, @dns) = @_; @@ -796,7 +796,7 @@ _load_hosts_unless { push @res, map [$idx, "ipv4", [AF_INET , $type, $proton, pack_sockaddr $port, $_]], - @{ $HOSTS{$node}[0] }; + @{ $hosts->[0] }; } $cv, @_; }; } @@ -811,7 +811,7 @@ _load_hosts_unless { push @res, map [$idx + 0.5, "ipv6", [AF_INET6, $type, $proton, pack_sockaddr $port, $_]], - @{ $HOSTS{$node}[1] } + @{ $hosts->[1] } } $cv, @_; }; } @@ -1015,7 +1015,7 @@ $state{next}(); } if $timeout; - # now connect + # now connect if ( (connect $state{fh}, $sockaddr) || ($! == Errno::EINPROGRESS # POSIX diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/lib/AnyEvent.pm new/AnyEvent-7.04/lib/AnyEvent.pm --- old/AnyEvent-7.02/lib/AnyEvent.pm 2012-08-14 04:27:45.000000000 +0200 +++ new/AnyEvent-7.04/lib/AnyEvent.pm 2012-11-15 02:24:55.000000000 +0100 @@ -1236,7 +1236,7 @@ use Carp (); -our $VERSION = '7.02'; +our $VERSION = '7.04'; our $MODEL; our @ISA; our @REGISTRY; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/t/63_eventlib_01_basic.t new/AnyEvent-7.04/t/63_eventlib_01_basic.t --- old/AnyEvent-7.02/t/63_eventlib_01_basic.t 2012-04-04 04:17:58.000000000 +0200 +++ new/AnyEvent-7.04/t/63_eventlib_01_basic.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,27 +0,0 @@ -use AnyEvent; - - BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) } - BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable\n}), exit 0) } - - - -$| = 1; print "1..6\n"; - -print "ok 1\n"; - -my $cv = AnyEvent->condvar; - -print "ok 2\n"; - -my $timer1 = AnyEvent->timer (after => 0.1, cb => sub { print "ok 5\n"; $cv->broadcast }); - -print "ok 3\n"; - -AnyEvent->timer (after => 0.01, cb => sub { print "not ok 5\n" }); - -print "ok 4\n"; - -$cv->wait; - -print "ok 6\n"; - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/t/63_eventlib_02_signals.t new/AnyEvent-7.04/t/63_eventlib_02_signals.t --- old/AnyEvent-7.02/t/63_eventlib_02_signals.t 2012-04-04 04:17:58.000000000 +0200 +++ new/AnyEvent-7.04/t/63_eventlib_02_signals.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,45 +0,0 @@ -BEGIN { - unless (exists $SIG{USR1}) { - print <<EOF; -1..0 # SKIP Broken perl detected, skipping tests. -EOF - exit 0; - } -} - -use AnyEvent; - - BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) } - BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable\n}), exit 0) } - - - -$| = 1; print "1..5\n"; - -print "ok 1\n"; - -my $cv = AnyEvent->condvar; - -my $error = AnyEvent->timer (after => 5, cb => sub { - print <<EOF; -Bail out! No signal caught. -EOF - exit 0; -}); - -my $sw = AnyEvent->signal (signal => 'INT', cb => sub { - print "ok 3\n"; - $cv->broadcast; -}); - -print "ok 2\n"; -kill 'INT', $$; -$cv->recv; -undef $error; - -print "ok 4\n"; - -undef $sw; - -print "ok 5\n"; - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/t/63_eventlib_03_child.t new/AnyEvent-7.04/t/63_eventlib_03_child.t --- old/AnyEvent-7.02/t/63_eventlib_03_child.t 2012-04-04 04:17:58.000000000 +0200 +++ new/AnyEvent-7.04/t/63_eventlib_03_child.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,98 +0,0 @@ -use POSIX (); - -no warnings; - -BEGIN { - # check for broken perls - if ($^O =~ /mswin32/i) { - my $ok; - local $SIG{CHLD} = sub { $ok = 1 }; - kill 'CHLD', 0; - - unless ($ok) { - print <<EOF; -1..0 # SKIP Your perl interpreter is badly BROKEN. Child watchers will not work, ever. Try upgrading to a newer perl or a working perl (cygwin's perl is known to work). If that is not an option, you should be able to use the remaining functionality of AnyEvent, but child watchers WILL NOT WORK. -EOF - exit 0; - } - } -} - -use AnyEvent; - - BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) } - BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable\n}), exit 0) } - - - -$| = 1; print "1..50\n"; - -$AnyEvent::MAX_SIGNAL_LATENCY = 0.2; - -for my $it ("", 1, 2, 3, 4) { - print "ok ${it}1\n"; - - AnyEvent::detect; # force-load event model - - my $pid = fork; - - defined $pid or die "unable to fork"; - - # work around Tk bug until it has been fixed. - #my $timer = AnyEvent->timer (after => 2, cb => sub { }); - - my $cv = AnyEvent->condvar; - - unless ($pid) { - print "ok ${it}2 # child $$\n"; - - # POE hits a race condition when the child dies too quickly - # because it checks for child exit before installing the signal handler. - # seen in version 1.352 - earlier versions had the same bug, but - # polled for child exits regularly, so only caused a delay. - sleep 1 if $AnyEvent::MODEL eq "AnyEvent::Impl::POE"; - - POSIX::_exit 3; - } - my $w = AnyEvent->child (pid => $pid, cb => sub { - print $pid == $_[0] ? "" : "not ", "ok ${it}3\ # $pid == $_[0]\n"; - print 3 == ($_[1] >> 8) ? "" : "not ", "ok ${it}4 # 3 == $_[1] >> 8 ($_[1])\n"; - $cv->broadcast; - }); - - $cv->recv; - - my $pid2 = fork || do { - sleep 1 if $AnyEvent::MODEL eq "AnyEvent::Impl::POE"; - POSIX::_exit 7; - }; - - my $cv2 = AnyEvent->condvar; - - # Glib is the only model that doesn't support pid == 0 - my $pid0 = $AnyEvent::MODEL eq "AnyEvent::Impl::Glib" ? $pid2 : 0; - - my $w2 = AnyEvent->child (pid => $pid0, cb => sub { - print $pid2 == $_[0] ? "" : "not ", "ok ${it}5 # $pid2 == $_[0]\n"; - print 7 == ($_[1] >> 8) ? "" : "not ", "ok ${it}6 # 7 == $_[1] >> 8 ($_[1])\n"; - $cv2->broadcast; - }); - - my $error = AnyEvent->timer (after => 5, 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; - }); - - $cv2->recv; - - print "ok ${it}7\n"; - print "ok ${it}8\n"; - print "ok ${it}9\n"; - print "ok ", $it*10+10, "\n"; -} - - - - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/t/63_eventlib_04_condvar.t new/AnyEvent-7.04/t/63_eventlib_04_condvar.t --- old/AnyEvent-7.02/t/63_eventlib_04_condvar.t 2012-04-04 04:17:58.000000000 +0200 +++ new/AnyEvent-7.04/t/63_eventlib_04_condvar.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,98 +0,0 @@ -use AnyEvent; - - BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) } - BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable\n}), exit 0) } - - - -$| = 1; print "1..28\n"; - -print "ok 1\n"; - -{ - my $cv = AnyEvent->condvar; - - $cv->cb (sub { - print $_[0]->ready ? "" : "not ", "ok 4\n"; - - my $x = $_[0]->recv; - print $x == 7 ? "" : "not ", "ok 5 # $x == 7\n"; - - my @x = $_[0]->recv; - print $x[1] == 5 ? "" : "not ", "ok 6 # $x[1] == 5\n"; - - my $y = $cv->recv; - print $y == 7 ? "" : "not ", "ok 7 # $x == 7\n"; - }); - - my $t = AnyEvent->timer (after => 0, cb => sub { - print "ok 3\n"; - $cv->send (7, 5); - }); - - print "ok 2\n"; - $cv->recv; - print "ok 8\n"; - - my @x = $cv->recv; - print $x[1] == 5 ? "" : "not ", "ok 9 # $x[1] == 5\n"; -} - -{ - my $cv = AnyEvent->condvar; - - $cv->cb (sub { - print $_[0]->ready ? "" : "not ", "ok 12\n"; - - my $x = eval { $_[0]->recv }; - print !defined $x ? "" : "not ", "ok 13\n"; - print $@ =~ /^kill/ ? "" : "not ", "ok 14 # $@\n"; - }); - - my $t = AnyEvent->timer (after => 0, cb => sub { - print "ok 11\n"; - $cv->croak ("kill"); - print "ok 15\n"; - $cv->send (8, 6, 4); - print "ok 16\n"; - }); - - print "ok 10\n"; - my @x = eval { $cv->recv }; - print !@x ? "" : "not ", "ok 17 # @x\n"; - print $@ =~ /^kill / ? "" : "not ", "ok 18 # $@\n"; -} - -{ - my $cv = AnyEvent->condvar; - - print "ok 19\n"; - my $t = AnyEvent->timer (after => 0, cb => $cv); - - print "ok 20\n"; - $cv->recv; - print "ok 21\n"; -} - -{ - my $cv = AE::cv { - print +($_[0]->recv)[0] == 6 ? "" : "not ", "ok 27\n"; - }; - - print "ok 22\n"; - - $cv->begin (sub { - print "ok 26\n"; - $_[0](6); - }); - - print "ok 23\n"; - $cv->begin; - print "ok 24\n"; - $cv->end; - print "ok 25\n"; - $cv->end; - - print "ok 28\n"; -} - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/t/63_eventlib_05_dns.t new/AnyEvent-7.04/t/63_eventlib_05_dns.t --- old/AnyEvent-7.02/t/63_eventlib_05_dns.t 2012-04-04 04:17:58.000000000 +0200 +++ new/AnyEvent-7.04/t/63_eventlib_05_dns.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,36 +0,0 @@ -# we avoid complicated tests here because some systems will -# not have working DNS - -use AnyEvent; - - BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) } - BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable\n}), exit 0) } - - -use AnyEvent::DNS; - -$| = 1; print "1..5\n"; - -print "ok 1\n"; - -AnyEvent::DNS::resolver; - -print "ok 2\n"; - -# make sure we timeout faster -AnyEvent::DNS::resolver->{timeout} = [0.5]; -AnyEvent::DNS::resolver->_compile; - -print "ok 3\n"; - -my $cv = AnyEvent->condvar; - -AnyEvent::DNS::a "www.google.de", sub { - print "ok 4 # www.google.de => @_\n"; - $cv->send; -}; - -$cv->recv; - -print "ok 5\n"; - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/t/63_eventlib_07_io.t new/AnyEvent-7.04/t/63_eventlib_07_io.t --- old/AnyEvent-7.02/t/63_eventlib_07_io.t 2012-04-04 04:17:58.000000000 +0200 +++ new/AnyEvent-7.04/t/63_eventlib_07_io.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,84 +0,0 @@ -use AnyEvent; -use AnyEvent::Util; - - BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) } - BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable\n}), exit 0) } - - - -$| = 1; print "1..18\n"; - -print "ok 1\n"; - -my ($a, $b) = AnyEvent::Util::portable_socketpair; - -print $a && $b ? "" : "not ", "ok 2 # $a,$b\n"; - -my ($cv, $t, $ra, $wa, $rb, $wb); - -$rb = AnyEvent->io (fh => $b, poll => "r", cb => sub { - print "ok 6\n"; - sysread $b, my $buf, 1; - print "ok 7\n"; - $wb = AnyEvent->io (fh => $b, poll => "w", cb => sub { - print "ok 8\n"; - undef $wb; - syswrite $b, "1"; - }); -}); - -print "ok 3\n"; - -{ my $cv = AnyEvent->condvar; $t = AnyEvent->timer (after => 0.05, cb => sub { $cv->send }); $cv->recv } - -print "ok 4\n"; - -$wa = AnyEvent->io (fh => $a, poll => "w", cb => sub { - syswrite $a, "0"; - undef $wa; - print "ok 5\n"; -}); - -$ra = AnyEvent->io (fh => $a, poll => "r", cb => sub { - sysread $a, my $buf, 1; - print "ok 9\n"; - $cv->send; -}); - -$cv = AnyEvent->condvar; $cv->recv; - -print "ok 10\n"; - -$rb = AnyEvent->io (fh => fileno $b, poll => "r", cb => sub { - print "ok 14\n"; - sysread $b, my $buf, 1; - print "ok 15\n"; - $wb = AnyEvent->io (fh => fileno $b, poll => "w", cb => sub { - print "ok 16\n"; - undef $wb; - syswrite $b, "1"; - }); -}); - -print "ok 11\n"; - -{ my $cv = AnyEvent->condvar; $t = AnyEvent->timer (after => 0.05, cb => sub { $cv->send }); $cv->recv } - -print "ok 12\n"; - -$wa = AnyEvent->io (fh => fileno $a, poll => "w", cb => sub { - syswrite $a, "0"; - undef $wa; - print "ok 13\n"; -}); - -$ra = AnyEvent->io (fh => $a, poll => "r", cb => sub { - sysread $a, my $buf, 1; - print "ok 17\n"; - $cv->send; -}); - -$cv = AnyEvent->condvar; $cv->recv; - -print "ok 18\n"; - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/AnyEvent-7.02/t/63_eventlib_09_multi.t new/AnyEvent-7.04/t/63_eventlib_09_multi.t --- old/AnyEvent-7.02/t/63_eventlib_09_multi.t 2012-04-04 04:17:58.000000000 +0200 +++ new/AnyEvent-7.04/t/63_eventlib_09_multi.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,178 +0,0 @@ -BEGIN { - # check for broken perls - if ($^O =~ /mswin32/i) { - my $ok; - local $SIG{CHLD} = sub { $ok = 1 }; - kill 'CHLD', 0; - - unless ($ok) { - print <<EOF; -1..0 # SKIP Your perl interpreter is badly BROKEN. Child watchers will not work, ever. Try upgrading to a newer perl or a working perl (cygwin's perl is known to work). If that is not an option, you should be able to use the remaining functionality of AnyEvent, but child watchers WILL NOT WORK. -EOF - exit 0; - } - } -} - -$^W = 0; # 5.8.6 bugs - -use AnyEvent; -use AnyEvent::Util; - - BEGIN { $ENV{PERL_ANYEVENT_LOOP_TESTS} or ((print qq{1..0 # SKIP PERL_ANYEVENT_LOOP_TESTS not true\n}), exit 0) } - BEGIN { eval q{use AnyEvent::Impl::EventLib;1} or ((print qq{1..0 # SKIP AnyEvent::Impl::EventLib not loadable\n}), exit 0) } - - - -$| = 1; print "1..15\n"; - -print "ok 1\n"; - -$AnyEvent::MAX_SIGNAL_LATENCY = 0.05; - -my ($a, $b) = AnyEvent::Util::portable_socketpair; - -# I/O write -{ - my $cv = AE::cv; - my $wt = AE::timer 1, 0, $cv; - my $s = 0; - - $cv->begin; my $wa = AE::io $a, 1, sub { $cv->end; $s |= 1 }; - $cv->begin; my $wb = AE::io $a, 1, sub { $cv->end; $s |= 2 }; - - $cv->recv; - - print $s == 3 ? "" : "not ", "ok 2 # $s\n"; -} - -# I/O read -{ - my $cv = AE::cv; - my $wt = AE::timer 0.01, 0, $cv; - my $s = 0; - - my $wa = AE::io $a, 0, sub { $cv->end; $s |= 1 }; - my $wb = AE::io $a, 0, sub { $cv->end; $s |= 2 }; - - $cv->recv; - - print $s == 0 ? "" : "not ", "ok 3 # $s\n"; - - syswrite $b, "x"; - - $cv = AE::cv; - $wt = AE::timer 1, 0, $cv; - - $s = 0; - $cv->begin; - $cv->begin; - $cv->recv; - - print $s == 3 ? "" : "not ", "ok 4 # $s\n"; - - sysread $a, my $dummy, 1; - - $cv = AE::cv; - $wt = AE::timer 0.01, 0, $cv; - - $s = 0; - $cv->recv; - - print $s == 0 ? "" : "not ", "ok 5 # $s\n"; -} - -# signal -{ - my $cv = AE::cv; - my $wt = AE::timer 0.01, 0, $cv; - my $s = 0; - - $cv->begin; my $wa = AE::signal INT => sub { $cv->end; $s |= 1 }; - $cv->begin; my $wb = AE::signal INT => sub { $cv->end; $s |= 2 }; - - $cv->recv; - - print $s == 0 ? "" : "not ", "ok 6 # $s\n"; - - kill INT => $$; - - $cv = AE::cv; - $wt = AE::timer 0.2, 0, $cv; # maybe OS X needs more time here? or maybe some buggy arm kernel? - - $s = 0; - $cv->recv; - - print $s == 3 ? "" : "not ", "ok 7 # $s\n"; - - $cv = AE::cv; - $wt = AE::timer 0.01, 0, $cv; - - $s = 0; - $cv->recv; - - print $s == 0 ? "" : "not ", "ok 8 # $s\n"; -} - -# child -{ - my $cv = AE::cv; - my $wt = AE::timer 0.01, 0, $cv; - my $s = 0; - - my $pid = fork; - - unless ($pid) { - sleep 2; - exit 1; - } - - my ($apid, $bpid, $astatus, $bstatus); - - $cv->begin; my $wa = AE::child $pid, sub { ($apid, $astatus) = @_; $cv->end; $s |= 1 }; - $cv->begin; my $wb = AE::child $pid, sub { ($bpid, $bstatus) = @_; $cv->end; $s |= 2 }; - - $cv->recv; - - print $s == 0 ? "" : "not ", "ok 9 # $s\n"; - - kill 9, $pid; - - $cv = AE::cv; - $wt = AE::timer 0.2, 0, $cv; # cygwin needs ages for this - - $s = 0; - $cv->recv; - - print $s == 3 ? "" : "not ", "ok 10 # $s\n"; - print $apid == $pid && $bpid == $pid ? "" : "not ", "ok 11 # $apid == $bpid == $pid\n"; - print $astatus == 9 && $bstatus == 9 ? "" : "not ", "ok 12 # $astatus == $bstatus == 9\n"; - - $cv = AE::cv; - $wt = AE::timer 0.01, 0, $cv; - - $s = 0; - $cv->recv; - - print $s == 0 ? "" : "not ", "ok 13 # $s\n"; -} - -# timers (don't laugh, some event loops are more broken...) -{ - my $cv = AE::cv; - my $wt = AE::timer 1, 0, $cv; - my $s = 0; - - $cv->begin; my $wa = AE::timer 0 , 0, sub { $cv->end; $s |= 1 }; - $cv->begin; my $wb = AE::timer 0 , 0, sub { $cv->end; $s |= 2 }; - $cv->begin; my $wc = AE::timer 0.01, 0, sub { $cv->end; $s |= 4 }; - - $cv->recv; - - print $s == 7 ? "" : "not ", "ok 14 # $s\n"; -} - -print "ok 15\n"; - -exit 0; - -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
