r49337 - in /branches/upstream/libio-async-perl/current: ./ lib/IO/ lib/IO/Async/ lib/IO/Async/Loop/ lib/IO/Async/Timer/ t/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Thu Dec 24 15:05:56 UTC 2009
Author: jawnsy-guest
Date: Thu Dec 24 15:05:01 2009
New Revision: 49337
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=49337
Log:
[svn-upgrade] Integrating new upstream version, libio-async-perl (0.27)
Modified:
branches/upstream/libio-async-perl/current/Changes
branches/upstream/libio-async-perl/current/META.yml
branches/upstream/libio-async-perl/current/lib/IO/Async.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/ChildManager.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Connector.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/DetachedCode.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Handle.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Listener.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Loop.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/IO_Poll.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/Poll.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/Select.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/LoopTests.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/MergePoint.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Notifier.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Resolver.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Sequencer.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Signal.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Stream.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Test.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Timer.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Timer/Countdown.pm
branches/upstream/libio-async-perl/current/lib/IO/Async/Timer/Periodic.pm
branches/upstream/libio-async-perl/current/t/21stream.t
branches/upstream/libio-async-perl/current/t/24listener.t
branches/upstream/libio-async-perl/current/t/51loop-connect.t
branches/upstream/libio-async-perl/current/t/52loop-listen.t
Modified: branches/upstream/libio-async-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/Changes?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/Changes (original)
+++ branches/upstream/libio-async-perl/current/Changes Thu Dec 24 15:05:01 2009
@@ -1,4 +1,14 @@
Revision history for IO-Async
+
+0.27 CHANGES:
+ * Implement 'autoflush' option on IO::Async::Stream
+
+ BUGFIXES:
+ * Avoid $_ breaking stored signal handler references when invoking
+ them
+ * Ignore EINTR from sysread/syswrite
+ * More reliable socket address tests - don't rely on uninitialised
+ padding bytes between struct members
0.26 BUGFIXES:
* Connect to INADDR_LOOPBACK rather than INADDR_ANY during
Modified: branches/upstream/libio-async-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/META.yml?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/META.yml (original)
+++ branches/upstream/libio-async-perl/current/META.yml Thu Dec 24 15:05:01 2009
@@ -1,6 +1,6 @@
---
name: IO-Async
-version: 0.26
+version: 0.27
author:
- 'Paul Evans <leonerd at leonerd.org.uk>'
abstract: perform asynchronous filehandle IO and other operations
@@ -24,67 +24,67 @@
provides:
IO::Async:
file: lib/IO/Async.pm
- version: 0.26
+ version: 0.27
IO::Async::ChildManager:
file: lib/IO/Async/ChildManager.pm
- version: 0.26
+ version: 0.27
IO::Async::Connector:
file: lib/IO/Async/Connector.pm
- version: 0.26
+ version: 0.27
IO::Async::DetachedCode:
file: lib/IO/Async/DetachedCode.pm
- version: 0.26
+ version: 0.27
IO::Async::Handle:
file: lib/IO/Async/Handle.pm
- version: 0.26
+ version: 0.27
IO::Async::Listener:
file: lib/IO/Async/Listener.pm
- version: 0.26
+ version: 0.27
IO::Async::Loop:
file: lib/IO/Async/Loop.pm
- version: 0.26
+ version: 0.27
IO::Async::Loop::IO_Poll:
file: lib/IO/Async/Loop/IO_Poll.pm
- version: 0.26
+ version: 0.27
IO::Async::Loop::Poll:
file: lib/IO/Async/Loop/Poll.pm
- version: 0.26
+ version: 0.27
IO::Async::Loop::Select:
file: lib/IO/Async/Loop/Select.pm
- version: 0.26
+ version: 0.27
IO::Async::LoopTests:
file: lib/IO/Async/LoopTests.pm
- version: 0.26
+ version: 0.27
IO::Async::MergePoint:
file: lib/IO/Async/MergePoint.pm
- version: 0.26
+ version: 0.27
IO::Async::Notifier:
file: lib/IO/Async/Notifier.pm
- version: 0.26
+ version: 0.27
IO::Async::Resolver:
file: lib/IO/Async/Resolver.pm
- version: 0.26
+ version: 0.27
IO::Async::Sequencer:
file: lib/IO/Async/Sequencer.pm
- version: 0.26
+ version: 0.27
IO::Async::Signal:
file: lib/IO/Async/Signal.pm
- version: 0.26
+ version: 0.27
IO::Async::Stream:
file: lib/IO/Async/Stream.pm
- version: 0.26
+ version: 0.27
IO::Async::Test:
file: lib/IO/Async/Test.pm
- version: 0.26
+ version: 0.27
IO::Async::Timer:
file: lib/IO/Async/Timer.pm
- version: 0.26
+ version: 0.27
IO::Async::Timer::Countdown:
file: lib/IO/Async/Timer/Countdown.pm
- version: 0.26
+ version: 0.27
IO::Async::Timer::Periodic:
file: lib/IO/Async/Timer/Periodic.pm
- version: 0.26
+ version: 0.27
generated_by: Module::Build version 0.35
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async.pm Thu Dec 24 15:05:01 2009
@@ -12,7 +12,7 @@
# It is provided simply to keep CPAN happy:
# cpan -i IO::Async
-our $VERSION = '0.26';
+our $VERSION = '0.27';
=head1 NAME
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/ChildManager.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/ChildManager.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/ChildManager.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/ChildManager.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
# Not a notifier
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Connector.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Connector.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Connector.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Connector.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use POSIX qw( EINPROGRESS );
use Socket qw( SOL_SOCKET SO_ERROR );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/DetachedCode.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/DetachedCode.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/DetachedCode.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/DetachedCode.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use IO::Async::Stream;
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Handle.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Handle.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Handle.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Handle.pm Thu Dec 24 15:05:01 2009
@@ -9,7 +9,7 @@
use warnings;
use base qw( IO::Async::Notifier );
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use Carp;
use Scalar::Util qw( weaken );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Listener.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Listener.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Listener.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Listener.pm Thu Dec 24 15:05:01 2009
@@ -9,7 +9,7 @@
use warnings;
use base qw( IO::Async::Handle );
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use IO::Async::Handle;
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Loop.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Loop.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Loop.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Loop.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use constant NEED_API_VERSION => '0.24';
use Carp;
@@ -474,7 +474,11 @@
if( not $self->{sigattaches}->{$signal} ) {
my @attaches;
- $self->watch_signal( $signal, sub { $_->() for @attaches } );
+ $self->watch_signal( $signal, sub {
+ foreach my $attachment ( @attaches ) {
+ $attachment->();
+ }
+ } );
$self->{sigattaches}->{$signal} = \@attaches;
}
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/IO_Poll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/IO_Poll.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/IO_Poll.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/IO_Poll.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use base qw( IO::Async::Loop::Poll );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/Poll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/Poll.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/Poll.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/Poll.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use constant API_VERSION => '0.24';
use base qw( IO::Async::Loop );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/Select.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/Select.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/Select.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Loop/Select.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use constant API_VERSION => '0.24';
use base qw( IO::Async::Loop );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/LoopTests.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/LoopTests.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/LoopTests.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/LoopTests.pm Thu Dec 24 15:05:01 2009
@@ -22,7 +22,7 @@
use POSIX qw( SIGTERM WIFEXITED WEXITSTATUS WIFSIGNALED WTERMSIG );
use Time::HiRes qw( time );
-our $VERSION = '0.26';
+our $VERSION = '0.27';
# Abstract Units of Time
use constant AUT => $ENV{TEST_QUICK_TIMERS} ? 0.1 : 1;
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/MergePoint.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/MergePoint.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/MergePoint.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/MergePoint.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use Carp;
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Notifier.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Notifier.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Notifier.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Notifier.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use Carp;
use Scalar::Util qw( weaken );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Resolver.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Resolver.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Resolver.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Resolver.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use Socket::GetAddrInfo qw( :Socket6api getaddrinfo getnameinfo );
use Socket qw( SOCK_STREAM SOCK_DGRAM SOCK_RAW );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Sequencer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Sequencer.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Sequencer.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Sequencer.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use base qw( IO::Async::Stream );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Signal.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Signal.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Signal.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Signal.pm Thu Dec 24 15:05:01 2009
@@ -9,7 +9,7 @@
use warnings;
use base qw( IO::Async::Notifier );
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use Carp;
use Scalar::Util qw( weaken );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Stream.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Stream.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Stream.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Stream.pm Thu Dec 24 15:05:01 2009
@@ -8,11 +8,11 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use base qw( IO::Async::Handle );
-use POSIX qw( EAGAIN EWOULDBLOCK );
+use POSIX qw( EAGAIN EWOULDBLOCK EINTR );
use Carp;
@@ -228,6 +228,16 @@
A CODE reference for when the C<syswrite()> method on the write handle fails.
+=item autoflush => BOOL
+
+Optional. If true, the C<write> method will attempt to write data to the
+operating system immediately, without waiting for the loop to indicate the
+filehandle is write-ready. This is useful, for example, on streams that should
+contain up-to-date logging or console information.
+
+It currently defaults to false for any file handle, but future versions of
+C<IO::Async> may enable this by default on STDOUT and STDERR.
+
=back
If a read handle is given, it is required that either an C<on_read> callback
@@ -246,7 +256,7 @@
my $self = shift;
my %params = @_;
- for (qw( on_read on_outgoing_empty on_read_error on_write_error )) {
+ for (qw( on_read on_outgoing_empty on_read_error on_write_error autoflush )) {
$self->{$_} = delete $params{$_} if exists $params{$_};
}
@@ -261,6 +271,16 @@
=head1 METHODS
=cut
+
+# FUNCTION not method
+sub _nonfatal_error
+{
+ my ( $errno ) = @_;
+
+ return $errno == EAGAIN ||
+ $errno == EWOULDBLOCK ||
+ $errno == EINTR;
+}
=head2 $stream->close
@@ -331,6 +351,12 @@
=back
+If the C<autoflush> option is set, this method will try immediately to write
+the data to the underlying filehandle. If this completes successfully then it
+will have been written by the time this method returns. If it fails to write
+completely, then the data is queued as if C<autoflush> were not set, and will
+be flushed later as normal by the C<on_write_ready()> method.
+
=cut
sub write
@@ -341,6 +367,25 @@
carp "Cannot write data to a Stream that is closing" and return if $self->{stream_closing};
croak "Cannot write data to a Stream with no write_handle" unless $self->write_handle;
+ if( $self->{autoflush} ) {
+ $data = $self->{writebuff} . $data if length $self->{writebuff};
+
+ my $handle = $self->write_handle;
+
+ while( length $data ) {
+ my $len = $handle->syswrite( $data, $WRITELEN );
+
+ last if !$len; # stop on any errors and defer back to the non-autoflush path
+
+ substr( $data, 0, $len ) = "";
+ }
+
+ if( !length $data ) {
+ $self->want_writeready( 0 );
+ return;
+ }
+ }
+
$self->{writebuff} .= $data;
$self->want_writeready( 1 );
@@ -359,7 +404,7 @@
if( !defined $len ) {
my $errno = $!;
- return if $errno == EAGAIN or $errno == EWOULDBLOCK;
+ return if _nonfatal_error( $errno );
if( defined $self->{on_read_error} ) {
$self->{on_read_error}->( $self, $errno );
@@ -418,7 +463,7 @@
if( !defined $len ) {
my $errno = $!;
- return if $errno == EAGAIN or $errno == EWOULDBLOCK;
+ return if _nonfatal_error( $errno );
if( defined $self->{on_write_error} ) {
$self->{on_write_error}->( $self, $errno );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Test.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Test.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Test.pm Thu Dec 24 15:05:01 2009
@@ -8,7 +8,7 @@
use strict;
use warnings;
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use Exporter;
our @ISA = qw( Exporter );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Timer.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Timer.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Timer.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Timer.pm Thu Dec 24 15:05:01 2009
@@ -9,7 +9,7 @@
use warnings;
use base qw( IO::Async::Notifier );
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use Carp;
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Timer/Countdown.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Timer/Countdown.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Timer/Countdown.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Timer/Countdown.pm Thu Dec 24 15:05:01 2009
@@ -9,7 +9,7 @@
use warnings;
use base qw( IO::Async::Timer );
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use Carp;
use Scalar::Util qw( weaken );
Modified: branches/upstream/libio-async-perl/current/lib/IO/Async/Timer/Periodic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/lib/IO/Async/Timer/Periodic.pm?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/lib/IO/Async/Timer/Periodic.pm (original)
+++ branches/upstream/libio-async-perl/current/lib/IO/Async/Timer/Periodic.pm Thu Dec 24 15:05:01 2009
@@ -9,7 +9,7 @@
use warnings;
use base qw( IO::Async::Timer );
-our $VERSION = '0.26';
+our $VERSION = '0.27';
use Carp;
use Scalar::Util qw( weaken );
Modified: branches/upstream/libio-async-perl/current/t/21stream.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/t/21stream.t?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/t/21stream.t (original)
+++ branches/upstream/libio-async-perl/current/t/21stream.t Thu Dec 24 15:05:01 2009
@@ -2,7 +2,7 @@
use strict;
-use Test::More tests => 71;
+use Test::More tests => 75;
use Test::Exception;
use Test::Refcount;
@@ -240,6 +240,20 @@
is( $empty, 1, '$empty after writing buffer' );
is( read_data( $S2 ), "message\n", 'data after writing buffer' );
+
+$stream->configure( autoflush => 1 );
+$stream->write( "immediate\n" );
+
+ok( !$stream->want_writeready, 'not want_writeready after autoflush write' );
+is( read_data( $S2 ), "immediate\n", 'data after autoflush write' );
+
+$stream->configure( autoflush => 0 );
+$stream->write( "partial " );
+$stream->configure( autoflush => 1 );
+$stream->write( "data\n" );
+
+ok( !$stream->want_writeready, 'not want_writeready after split autoflush write' );
+is( read_data( $S2 ), "partial data\n", 'data after split autoflush write' );
is_refcount( $stream, 2, 'writing $stream has refcount 2 before removing from Loop' );
Modified: branches/upstream/libio-async-perl/current/t/24listener.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/t/24listener.t?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/t/24listener.t (original)
+++ branches/upstream/libio-async-perl/current/t/24listener.t Thu Dec 24 15:05:01 2009
@@ -39,7 +39,8 @@
is_oneref( $listener, '$listener has refcount 1 initially' );
ok( $listener->is_listening, '$listener is_listening' );
-is( $listener->sockname, $listensock->sockname, '$listener->sockname' );
+is_deeply( [ unpack_sockaddr_in $listener->sockname ],
+ [ unpack_sockaddr_in $listensock->sockname ], '$listener->sockname' );
$loop->add( $listener );
@@ -54,7 +55,8 @@
wait_for { defined $newclient };
-is( $newclient->peername, $clientsock->sockname, '$newclient peer is correct' );
+is_deeply( [ unpack_sockaddr_in $newclient->peername ],
+ [ unpack_sockaddr_in $clientsock->sockname ], '$newclient peer is correct' );
$loop->remove( $listener );
@@ -89,7 +91,8 @@
wait_for { defined $sub_newclient };
-is( $sub_newclient->peername, $clientsock->sockname, '$sub_newclient peer is correct' );
+is_deeply( [ unpack_sockaddr_in $sub_newclient->peername ],
+ [ unpack_sockaddr_in $clientsock->sockname ], '$sub_newclient peer is correct' );
$loop->remove( $listener );
@@ -139,7 +142,8 @@
wait_for { defined $newclient };
-is( $newclient->peername, $clientsock->sockname, '$newclient peer is correct' );
+is_deeply( [ unpack_sockaddr_in $newclient->peername ],
+ [ unpack_sockaddr_in $clientsock->sockname ], '$newclient peer is correct' );
is_refcount( $listener, 2, 'subclass $listener has refcount 2 before removing from Loop' );
Modified: branches/upstream/libio-async-perl/current/t/51loop-connect.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/t/51loop-connect.t?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/t/51loop-connect.t (original)
+++ branches/upstream/libio-async-perl/current/t/51loop-connect.t Thu Dec 24 15:05:01 2009
@@ -33,7 +33,8 @@
wait_for { $sock };
isa_ok( $sock, "IO::Socket::INET", 'by addr: $sock isa IO::Socket::INET' );
-is( $sock->peername, $addr, 'by addr: $sock->getpeername is $addr' );
+is_deeply( [ unpack_sockaddr_in $sock->peername ],
+ [ unpack_sockaddr_in $addr ], 'by addr: $sock->getpeername is $addr' );
$listensock->accept; # Throw it away
undef $sock; # This too
@@ -52,7 +53,8 @@
wait_for { $sock };
isa_ok( $sock, "IO::Socket::INET", 'by host/service: $sock isa IO::Socket::INET' );
-is( $sock->peername, $addr, 'by host/service: $sock->getpeername is $addr' );
+is_deeply( [ unpack_sockaddr_in $sock->peername ],
+ [ unpack_sockaddr_in $addr ], 'by host/service: $sock->getpeername is $addr' );
$listensock->accept; # Throw it away
undef $sock; # This too
Modified: branches/upstream/libio-async-perl/current/t/52loop-listen.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-async-perl/current/t/52loop-listen.t?rev=49337&op=diff
==============================================================================
--- branches/upstream/libio-async-perl/current/t/52loop-listen.t (original)
+++ branches/upstream/libio-async-perl/current/t/52loop-listen.t Thu Dec 24 15:05:01 2009
@@ -48,7 +48,8 @@
wait_for { defined $newclient };
-is( $newclient->peername, $clientsock->sockname, '$newclient peer is correct' );
+is_deeply( [ unpack_sockaddr_in $newclient->peername ],
+ [ unpack_sockaddr_in $clientsock->sockname ], '$newclient peer is correct' );
undef $listensock;
undef $clientsock;
@@ -101,7 +102,8 @@
isa_ok( $newclient, "IO::Socket::INET", '$newclient isa IO::Socket::INET' );
-is( $newclient->peername, $clientsock->sockname, '$newclient peer is correct' );
+is_deeply( [ unpack_sockaddr_in $newclient->peername ],
+ [ unpack_sockaddr_in $clientsock->sockname ], '$newclient peer is correct' );
# Now we want to test failure. It's hard to know in a test script what will
# definitely fail, but it's likely we're either running as non-root, or the
More information about the Pkg-perl-cvs-commits
mailing list