r31866 - in /branches/upstream/libanyevent-perl/current: ./ lib/ lib/AnyEvent/ lib/AnyEvent/Impl/
gregoa at users.alioth.debian.org
gregoa at users.alioth.debian.org
Tue Mar 10 18:17:01 UTC 2009
Author: gregoa
Date: Tue Mar 10 18:16:58 2009
New Revision: 31866
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=31866
Log:
[svn-upgrade] Integrating new upstream version, libanyevent-perl (4.340)
Modified:
branches/upstream/libanyevent-perl/current/Changes
branches/upstream/libanyevent-perl/current/META.yml
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/Perl.pm
branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Tk.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/Util.pm
Modified: branches/upstream/libanyevent-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/Changes?rev=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/Changes (original)
+++ branches/upstream/libanyevent-perl/current/Changes Tue Mar 10 18:16:58 2009
@@ -1,4 +1,14 @@
Revision history for Perl extension AnyEvent.
+
+4.34 Thu Feb 12 18:32:45 CET 2009
+ - separately buffer TLS read data, as otherwise the read queue could
+ deadlock as receiving data is not expected while draining the
+ read queue (which cna only happen with TLS).
+ - raise EBADMSG error on JSON decoding errors.
+ - fix some minor manpage bugs (reported by Maximilian GaÃ).
+ - speed up select bitmask parsing quite a bit in the pure perl
+ backend.
+ - use CORE::select instead of just select in AnyEvent::Impl::Perl.
4.331 Tue Jan 6 21:07:25 CET 2009
- socketpair fails on many vista machines because vista has
Modified: branches/upstream/libanyevent-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/META.yml?rev=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/META.yml (original)
+++ branches/upstream/libanyevent-perl/current/META.yml Tue Mar 10 18:16:58 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: AnyEvent
-version: 4.331
+version: 4.34
abstract: ~
license: ~
author: ~
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=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm Tue Mar 10 18:16:58 2009
@@ -863,7 +863,7 @@
use Carp;
-our $VERSION = 4.331;
+our $VERSION = 4.34;
our $MODEL;
our $AUTOLOAD;
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=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/DNS.pm Tue Mar 10 18:16:58 2009
@@ -37,7 +37,7 @@
use AnyEvent::Handle ();
use AnyEvent::Util qw(AF_INET6);
-our $VERSION = 4.331;
+our $VERSION = 4.34;
our @DNS_FALLBACK = (v208.67.220.220, v208.67.222.222);
@@ -1133,14 +1133,12 @@
CNAME chains (although illegal) are followed up to a length of 10.
-The callback will be invoked with an result code in string form (noerror,
-formerr, servfail, nxdomain, notimp, refused and so on), or numerical
-form if the result code is not supported. The remaining arguments are
-arraryefs of the form C<[$name, $type, $class, @data>], where C<$name> is
-the domain name, C<$type> a type string or number, C<$class> a class name
-and @data is resource-record-dependent data. For C<a> records, this will
-be the textual IPv4 addresses, for C<ns> or C<cname> records this will be
-a domain name, for C<txt> records these are all the strings and so on.
+The callback will be invoked with arraryefs of the form C<[$name, $type,
+$class, @data>], where C<$name> is the domain name, C<$type> a type string
+or number, C<$class> a class name and @data is resource-record-dependent
+data. For C<a> records, this will be the textual IPv4 addresses, for C<ns>
+or C<cname> records this will be a domain name, for C<txt> records these
+are all the strings and so on.
All types mentioned in RFC 1035, C<aaaa>, C<srv>, C<naptr> and C<spf> are
decoded. All resource records not known to this module will have
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=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Handle.pm Tue Mar 10 18:16:58 2009
@@ -16,7 +16,7 @@
=cut
-our $VERSION = 4.331;
+our $VERSION = 4.34;
=head1 SYNOPSIS
@@ -129,7 +129,9 @@
read buffer).
To access (and remove data from) the read buffer, use the C<< ->rbuf >>
-method or access the C<$handle->{rbuf}> member directly.
+method or access the C<$handle->{rbuf}> member directly. Note that you
+must not enlarge or modify the read buffer, you can only remove data at
+the beginning from it.
When an EOF condition is detected then AnyEvent::Handle will first try to
feed all the remaining data to the queued callbacks and C<on_read> before
@@ -256,6 +258,11 @@
to make sure that you call either C<Net::SSLeay::set_connect_state>
or C<Net::SSLeay::set_accept_state> on it before you pass it to
AnyEvent::Handle.
+
+B<IMPORTANT:> since Net::SSLeay "objects" are really only integers,
+passing in the wrong integer will lead to certain crash. This most often
+happens when one uses a stylish C<< tls => 1 >> and is surprised about the
+segmentation fault.
See the C<< ->starttls >> method for when need to start TLS negotiation later.
@@ -764,6 +771,10 @@
}
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.
+ $self->{rbuf} .= delete $self->{_tls_rbuf} if exists $self->{_tls_rbuf};
+
my $len = length $self->{rbuf};
if (my $cb = shift @{ $self->{_queue} }) {
@@ -834,8 +845,11 @@
Returns the read buffer (as a modifiable lvalue).
-You can access the read buffer directly as the C<< ->{rbuf} >> member, if
-you want.
+You can access the read buffer directly as the C<< ->{rbuf} >>
+member, if you want. However, the only operation allowed on the
+read buffer (apart from looking at it) is removing data from its
+beginning. Otherwise modifying or appending to it is not allowed and will
+lead to hard-to-track-down bugs.
NOTE: The read buffer should only be used or modified if the C<on_read>,
C<push_read> or C<unshift_read> methods are used. The other read methods
@@ -1141,7 +1155,8 @@
=item json => $cb->($handle, $hash_or_arrayref)
-Reads a JSON object or array, decodes it and passes it to the callback.
+Reads a JSON object or array, decodes it and passes it to the
+callback. When a parse error occurs, an C<EBADMSG> error will be raised.
If a C<json> object was passed to the constructor, then that will be used
for the final decode, otherwise it will create a JSON coder expecting UTF-8.
@@ -1168,7 +1183,7 @@
my $json = $self->{json} ||= JSON->new->utf8;
sub {
- my $ref = $json->incr_parse ($self->{rbuf});
+ my $ref = eval { $json->incr_parse ($self->{rbuf}) };
if ($ref) {
$self->{rbuf} = $json->incr_text;
@@ -1176,8 +1191,19 @@
$cb->($self, $ref);
1
+ } elsif ($@) {
+ # error case
+ $json->incr_skip;
+
+ $self->{rbuf} = $json->incr_text;
+ $json->incr_text = "";
+
+ $self->_error (&Errno::EBADMSG);
+
+ ()
} else {
$self->{rbuf} = "";
+
()
}
}
@@ -1328,7 +1354,7 @@
&_freetls;
}
- $self->{rbuf} .= $tmp;
+ $self->{_tls_rbuf} .= $tmp;
$self->_drain_rbuf unless $self->{_in_drain};
$self->{tls} or return; # tls session might have gone away in callback
}
@@ -1338,7 +1364,7 @@
if ($tmp != Net::SSLeay::ERROR_WANT_READ ()) {
if ($tmp == Net::SSLeay::ERROR_SYSCALL ()) {
return $self->_error ($!, 1);
- } elsif ($tmp == Net::SSLeay::ERROR_SSL ()) {
+ } elsif ($tmp == Net::SSLeay::ERROR_SSL ()) {
return $self->_error (&Errno::EIO, 1);
}
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=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Event.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Event.pm Tue Mar 10 18:16:58 2009
@@ -27,7 +27,7 @@
use AnyEvent ();
-use Event qw(time); # we have to important something to make Event use Time::HiRes
+use Event qw(time); # we have to importt something to make Event use Time::HiRes
sub io {
my ($class, %arg) = @_;
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=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Perl.pm Tue Mar 10 18:16:58 2009
@@ -91,7 +91,7 @@
use AnyEvent ();
use AnyEvent::Util ();
-our $VERSION = 4.331;
+our $VERSION = 4.34;
our ($NOW, $MNOW);
@@ -186,7 +186,7 @@
$wait = $wait < MAXWAIT ? $wait + ROUNDUP : MAXWAIT;
- if ($fds = select
+ if ($fds = CORE::select
$vec[0] = $fds[0][V],
$vec[1] = $fds[1][V],
AnyEvent::WIN32 ? $vec[2] = $fds[1][V] : undef,
@@ -205,17 +205,17 @@
# we parse the bitmask by first expanding it into
# a string of bits
for (unpack "b*", $vec[$_]) {
- # and then repeatedly match a regex skipping the 0's
- while (/\G0*1/g) {
- # and using the resulting string position as fd
+ # and then repeatedly matching a regex against it
+ while (/1/g) {
+ # and use the resulting string position as fd
$_ && $_->[2]()
- for @{ $fds->[W][-1 + pos] || [] };
+ for @{ $fds->[W][(pos) - 1] || [] };
}
}
}
} elsif (AnyEvent::WIN32 && $! == AnyEvent::Util::WSAEINVAL) {
# buggy microshit windoze asks us to route around it
- select undef, undef, undef, $wait;
+ CORE::select undef, undef, undef, $wait;
}
}
}
Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Tk.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Tk.pm?rev=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Tk.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Impl/Tk.pm Tue Mar 10 18:16:58 2009
@@ -17,7 +17,7 @@
Tk is buggy. Tk is extremely buggy. Tk is so unbelievably buggy that
for each bug reported and fixed, you get one new bug followed by
-reintroduction of the old bug in a later revision. It is also basiclaly
+reintroduction of the old bug in a later revision. It is also basically
unmaintained: the maintainers are not even interested in improving
the situation - reporting bugs is considered rude, and fixing bugs is
considered changing holy code, so it's apparently better to leave it
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=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm Tue Mar 10 18:16:58 2009
@@ -59,7 +59,7 @@
tcp_connect
);
-our $VERSION = 4.331;
+our $VERSION = 4.34;
=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=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Strict.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Strict.pm Tue Mar 10 18:16:58 2009
@@ -5,7 +5,7 @@
=head1 SYNOPSIS
use AnyEvent::Strict;
- # struct mode now switched on
+ # strict mode now switched on
=head1 DESCRIPTION
@@ -13,7 +13,7 @@
Loading it makes AnyEvent check all arguments to AnyEvent-methods, at the
expense of being slower (often the argument checking takes longer than the
-actual fucntion).
+actual function).
Normally, you don't load this module yourself but instead use it
indirectly via the C<PERL_ANYEVENT_STRICT> environment variable (see
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=31866&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Util.pm Tue Mar 10 18:16:58 2009
@@ -34,7 +34,7 @@
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.331;
+our $VERSION = 4.34;
BEGIN {
my $posix = 1 * eval { local $SIG{__DIE__}; require POSIX };
More information about the Pkg-perl-cvs-commits
mailing list