Commit f93e0ada authored by gregor herrmann's avatar gregor herrmann

New upstream version 7.140

parent 2771cb3e
......@@ -9,9 +9,27 @@ TODO: AnyEvent::Handle with AnyEvent::IO?
TODO: invalid. and localhost. specialcasing inside AEDNS and not AESocket (rfc6761)
TODO: maybe implement env variable to give hosts precedence
TODO: more formats for parse_ipv6 (single ipv6 address without port, ...p80, ...#80)
TODO: inet_aton maybe pack C4? no, add a comment why not
TODO: hosts read multiple times for initial concurrent tcp_connect's?
TODO: socket prepare callbacks, can they easily signal failure as well?
7.14 Sat Jun 24 01:44:19 CEST 2017
- fix a crash bug in AnyEvent::Handle with openssl 1.1.0 (patched
by Paul Howarth and apparently tracked down by Mike McCauley).
- AnyEvent::Handle->keepalive was documented (and defined) twice
(found by Matt Merhar).
- AnyEvent::Socket::tcp_bind/tcp_server would immediately unlink a unix
listening socket unless a guard is used. Change this so that no
cleanup will be performed unless a guard is used and document this more
clearly.
- make tcp_bind/tcp_server error messages more regular.
- work around latest perl upstream breakage - this time, perl5porters were
apparently bullied by a bogus CVE (CVE-2016-1238), and since distros
stupidly apply anything that has "security fix" stamped on it, it's likely
going to be a problem in practise (and working around it is trivial on
windows and unix).
- add TCP_FASTOPEN/MSG_FASTOPEN and MSG_NOSIGNAL/MSG_MORE/MSG_DONTWAIT
to constants.
- update warnings to common::sense 3.74 standards.
7.13 Sat Sep 17 04:31:49 CEST 2016
- Only call tlsext_host_name for non-empty common names (reported
......
......@@ -4,7 +4,7 @@
"unknown"
],
"dynamic_config" : 1,
"generated_by" : "ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001",
"generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.120351",
"license" : [
"unknown"
],
......@@ -45,5 +45,5 @@
}
},
"release_status" : "stable",
"version" : 7.13
"version" : "7.14"
}
......@@ -3,28 +3,28 @@ abstract: unknown
author:
- unknown
build_requires:
ExtUtils::MakeMaker: '0'
ExtUtils::MakeMaker: 0
configure_requires:
Canary::Stability: '0'
ExtUtils::MakeMaker: '6.52'
Canary::Stability: 0
ExtUtils::MakeMaker: 6.52
dynamic_config: 1
generated_by: 'ExtUtils::MakeMaker version 7.1, CPAN::Meta::Converter version 2.150001'
generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.120351'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
version: 1.4
name: AnyEvent
no_index:
directory:
- t
- inc
recommends:
Async::Interrupt: '1'
EV: '4'
Guard: '1.02'
JSON: '2.09'
JSON::XS: '2.2'
Net::SSLeay: '1.33'
Task::Weaken: '0'
Async::Interrupt: 1
EV: 4
Guard: 1.02
JSON: 2.09
JSON::XS: 2.2
Net::SSLeay: 1.33
Task::Weaken: 0
requires: {}
version: 7.13
version: 7.14
......@@ -22,7 +22,7 @@ print <<EOF;
EOF
do "constants.pl.PL"
do "./constants.pl.PL"
or die "cannot execute constants.pl.PL: $@";
WriteMakefile(
......
......@@ -916,13 +916,12 @@ GLOBAL VARIABLES AND FUNCTIONS
model is autodetected (or immediately if that has already happened).
The block will be executed *after* the actual backend has been
detected ($AnyEvent::MODEL is set), but *before* any watchers have
been created, so it is possible to e.g. patch @AnyEvent::ISA or do
other initialisations - see the sources of AnyEvent::Strict or
AnyEvent::AIO to see how this is used.
detected ($AnyEvent::MODEL is set), so it is possible to do some
initialisation only when AnyEvent is actually initialised - see the
sources of AnyEvent::AIO to see how this is used.
The most common usage is to create some global watchers, without
forcing event module detection too early, for example, AnyEvent::AIO
forcing event module detection too early. For example, AnyEvent::AIO
creates and installs the global IO::AIO watcher in a "post_detect"
block to avoid autodetecting the event module at load time.
......@@ -948,9 +947,16 @@ GLOBAL VARIABLES AND FUNCTIONS
$WATCHER ||= $guard;
@AnyEvent::post_detect
If there are any code references in this array (you can "push" to it
before or after loading AnyEvent), then they will be called directly
after the event loop has been chosen.
This is a lower level interface then "AnyEvent::post_detect" (the
function). This variable is mainly useful for modules that can do
something useful when AnyEvent is used and thus want to know when it
is initialised, but do not need to even load it by default. This
array provides the means to hook into AnyEvent passively, without
loading it.
Here is how it works: If there are any code references in this array
(you can "push" to it before or after loading AnyEvent), then they
will be called directly after the event loop has been chosen.
You should check $AnyEvent::MODEL before adding to this array,
though: if it is defined then the event loop has already been
......@@ -959,12 +965,6 @@ GLOBAL VARIABLES AND FUNCTIONS
Best use "AnyEvent::post_detect { BLOCK }" when your application
allows it, as it takes care of these details.
This variable is mainly useful for modules that can do something
useful when AnyEvent is used and thus want to know when it is
initialised, but do not need to even load it by default. This array
provides the means to hook into AnyEvent passively, without loading
it.
Example: To load Coro::AnyEvent whenever Coro and AnyEvent are used
together, you could put this into Coro (this is the actual code used
by Coro to accomplish this):
......
......@@ -14,11 +14,11 @@ BEGIN {
}
{
# from common::sense 3.7
# from common::sense 3.74
use strict qw(vars subs);
no warnings;
use warnings qw(FATAL closed threads internal debugging pack malloc portable prototype
inplace io pipe unpack deprecated glob digit printf
inplace io pipe unpack glob digit printf
layer reserved taint closure semicolon);
no warnings qw(exec newline unopened);
......@@ -165,6 +165,11 @@ linux TCP_INFO 11
linux TCP_QUICKACK 12
linux TCP_CONGESTION 13
linux TCP_MD5SIG 14
linux TCP_FASTOPEN 23
linux MSG_DONTWAIT 0x0040
linux MSG_NOSIGNAL 0x4000
linux MSG_MORE 0x8000
linux MSG_FASTOPEN 0x20000000
netbsd TCP_MAXSEG 2
netbsd TCP_KEEPIDLE 3
netbsd TCP_NOPUSH 4
......@@ -174,15 +179,17 @@ netbsd TCP_KEEPINIT 7
netbsd TCP_NOOPT 8
netbsd TCP_MD5SIG 0x10
netbsd TCP_CONGESTION 0x20
cygwin TCP_MAXSEG 0x02
cygwin TCP_NOPUSH 0x04
cygwin TCP_NOOPT 0x08
netbsd MSG_NOSIGNAL 0x0400
cygwin TCP_MAXSEG 0x02
cygwin TCP_NOPUSH 0x04
cygwin TCP_NOOPT 0x08
freebsd TCP_MAXSEG 0x02
freebsd TCP_NOPUSH 0x04
freebsd TCP_NOOPT 0x08
freebsd TCP_MD5SIG 0x10
freebsd TCP_INFO 0x20
freebsd TCP_CONGESTION 0x40
freebsd MSG_NOSIGNAL 0x20000
solaris TCP_CORK 0x18
solaris TCP_LINGER2 0x1C
solaris TCP_INIT_CWND 0x15
......
......@@ -964,13 +964,12 @@ Arranges for the code block to be executed as soon as the event model is
autodetected (or immediately if that has already happened).
The block will be executed I<after> the actual backend has been detected
(C<$AnyEvent::MODEL> is set), but I<before> any watchers have been
created, so it is possible to e.g. patch C<@AnyEvent::ISA> or do
other initialisations - see the sources of L<AnyEvent::Strict> or
(C<$AnyEvent::MODEL> is set), so it is possible to do some initialisation
only when AnyEvent is actually initialised - see the sources of
L<AnyEvent::AIO> to see how this is used.
The most common usage is to create some global watchers, without forcing
event module detection too early, for example, L<AnyEvent::AIO> creates
event module detection too early. For example, L<AnyEvent::AIO> creates
and installs the global L<IO::AIO> watcher in a C<post_detect> block to
avoid autodetecting the event module at load time.
......@@ -997,9 +996,15 @@ C<$WATCHER>, but do so only do so after the event loop is initialised.
=item @AnyEvent::post_detect
If there are any code references in this array (you can C<push> to it
before or after loading AnyEvent), then they will be called directly
after the event loop has been chosen.
This is a lower level interface then C<AnyEvent::post_detect> (the
function). This variable is mainly useful for modules that can do
something useful when AnyEvent is used and thus want to know when it
is initialised, but do not need to even load it by default. This array
provides the means to hook into AnyEvent passively, without loading it.
Here is how it works: If there are any code references in this array (you
can C<push> to it before or after loading AnyEvent), then they will be
called directly after the event loop has been chosen.
You should check C<$AnyEvent::MODEL> before adding to this array, though:
if it is defined then the event loop has already been detected, and the
......@@ -1008,11 +1013,6 @@ array will be ignored.
Best use C<AnyEvent::post_detect { BLOCK }> when your application allows
it, as it takes care of these details.
This variable is mainly useful for modules that can do something useful
when AnyEvent is used and thus want to know when it is initialised, but do
not need to even load it by default. This array provides the means to hook
into AnyEvent passively, without loading it.
Example: To load Coro::AnyEvent whenever Coro and AnyEvent are used
together, you could put this into Coro (this is the actual code used by
Coro to accomplish this):
......@@ -1260,7 +1260,7 @@ BEGIN {
use Carp ();
our $VERSION = 7.13;
our $VERSION = 7.14;
our $MODEL;
our @ISA;
our @REGISTRY;
......
......@@ -385,11 +385,25 @@ our %type_id = (
minfo => 14,
mx => 15,
txt => 16,
sig => 24,
key => 25,
gpos => 27, # rfc1712
aaaa => 28,
loc => 29, # rfc1876
srv => 33,
naptr => 35, # rfc2915
dname => 39, # rfc2672
opt => 41,
ds => 43, # rfc4034
sshfp => 44, # rfc4255
rrsig => 46, # rfc4034
nsec => 47, # rfc4034
dnskey=> 48, # rfc4034
smimea=> 53, # rfc8162
cds => 59, # rfc7344
cdnskey=> 60, # rfc7344
openpgpkey=> 61, # rfc7926
csync => 62, # rfc7929
spf => 99,
tkey => 249,
tsig => 250,
......@@ -397,6 +411,7 @@ our %type_id = (
axfr => 252,
mailb => 253,
"*" => 255,
uri => 256,
);
our %type_str = reverse %type_id;
......
......@@ -761,23 +761,6 @@ sub oobinline {
};
}
=item $handle->keepalive ($boolean)
Enables or disables the C<keepalive> setting (see constructor argument of
the same name for details).
=cut
sub keepalive {
$_[0]{keepalive} = $_[1];
eval {
local $SIG{__DIE__};
setsockopt $_[0]{fh}, Socket::SOL_SOCKET (), Socket::SO_KEEPALIVE (), int $_[1]
if $_[0]{fh};
};
}
=item $handle->on_starttls ($cb)
Replace the current C<on_starttls> callback (see the C<on_starttls> constructor argument).
......@@ -2212,19 +2195,19 @@ sub starttls {
# basically, this is deep magic (because SSL_read should have the same issues)
# but the openssl maintainers basically said: "trust us, it just works".
# (unfortunately, we have to hardcode constants because the abysmally misdesigned
# and mismaintained ssleay-module doesn't even offer them).
# and mismaintained ssleay-module didn't offer them for a decade or so).
# http://www.mail-archive.com/openssl-dev@openssl.org/msg22420.html
#
# in short: this is a mess.
#
#
# note that we do not try to keep the length constant between writes as we are required to do.
# we assume that most (but not all) of this insanity only applies to non-blocking cases,
# and we drive openssl fully in blocking mode here. Or maybe we don't - openssl seems to
# have identity issues in that area.
# Net::SSLeay::CTX_set_mode ($ssl,
# Net::SSLeay::set_mode ($ssl,
# (eval { local $SIG{__DIE__}; Net::SSLeay::MODE_ENABLE_PARTIAL_WRITE () } || 1)
# | (eval { local $SIG{__DIE__}; Net::SSLeay::MODE_ACCEPT_MOVING_WRITE_BUFFER () } || 2));
Net::SSLeay::CTX_set_mode ($tls, 1|2);
Net::SSLeay::set_mode ($tls, 1|2);
$self->{_rbio} = Net::SSLeay::BIO_new (Net::SSLeay::BIO_s_mem ());
$self->{_wbio} = Net::SSLeay::BIO_new (Net::SSLeay::BIO_s_mem ());
......
......@@ -1102,12 +1102,16 @@ mode) as first, and the peer host and port as second and third arguments
Croaks on any errors it can detect before the listen.
If called in non-void context, then this function returns a guard object
whose lifetime it tied to the TCP server: If the object gets destroyed,
the server will be stopped (but existing accepted connections will
not be affected).
In non-void context, this function returns a guard object whose lifetime
it tied to the TCP server: If the object gets destroyed, the server will
be stopped and the listening socket will be cleaned up/unlinked (already
accepted connections will not be affected).
Regardless, when the function returns to the caller, the socket is bound
When called in void-context, AnyEvent will keep the listening socket alive
internally. In this case, there is no guarantee that the listening socket
will be cleaned up or unlinked.
In all cases, when the function returns to the caller, the socket is bound
and in listening state.
If you need more control over the listening socket, you can provide a
......@@ -1153,8 +1157,9 @@ to do the C<accept>'ing yourself, for example, in another process.
In case of an error, C<tcp_bind> either croaks, or passes C<undef> to the
C<$done_cb>.
The guard only protects the set-up phase, it isn't used after C<$done_cb>
has been invoked.
In non-void context, a guard will be returned. It will clean up/unlink the
listening socket when destroyed. In void context, no automatic clean up
might be performed.
=cut
......@@ -1166,63 +1171,64 @@ sub _tcp_bind($$$;$) {
unless defined $host;
my $ipn = parse_address $host
or Carp::croak "AnyEvent::Socket::tcp_server: cannot parse '$host' as host address";
or Carp::croak "tcp_bind: cannot parse '$host' as host address";
my $af = address_family $ipn;
my %state;
# win32 perl is too stupid to get this right :/
Carp::croak "tcp_server/socket: address family not supported"
Carp::croak "tcp_bind: AF_UNIX address family not supported on win32"
if AnyEvent::WIN32 && $af == AF_UNIX;
socket $state{fh}, $af, SOCK_STREAM, 0
or Carp::croak "tcp_server/socket: $!";
socket my $fh, $af, SOCK_STREAM, 0
or Carp::croak "tcp_bind: $!";
$state{fh} = $fh;
if ($af == AF_INET || $af == AF_INET6) {
setsockopt $state{fh}, SOL_SOCKET, SO_REUSEADDR, 1
or Carp::croak "tcp_server/so_reuseaddr: $!"
setsockopt $fh, SOL_SOCKET, SO_REUSEADDR, 1
or Carp::croak "tcp_bind: so_reuseaddr: $!"
unless AnyEvent::WIN32; # work around windows bug
unless ($service =~ /^\d*$/) {
$service = (getservbyname $service, "tcp")[2]
or Carp::croak "$service: service unknown"
or Carp::croak "tcp_bind: unknown service '$service'"
}
} elsif ($af == AF_UNIX) {
unlink $service;
}
bind $state{fh}, pack_sockaddr $service, $ipn
or Carp::croak "bind: $!";
bind $fh, pack_sockaddr $service, $ipn
or Carp::croak "tcp_bind: $!";
if ($af == AF_UNIX) {
my $fh = $state{fh};
my $ino = (stat $fh)[1];
if ($af == AF_UNIX and defined wantarray) {
# this is racy, but is not designed to be foolproof, just best-effort
my $ino = (lstat $service)[1];
$state{unlink} = guard {
# this is racy, but is not designed to be foolproof, just best-effort
unlink $service
if $ino == (stat $fh)[1];
if (lstat $service)[1] == $ino;
};
}
AnyEvent::fh_unblock $state{fh};
AnyEvent::fh_unblock $fh;
my $len;
if ($prepare) {
my ($service, $host) = unpack_sockaddr getsockname $state{fh};
$len = $prepare && $prepare->($state{fh}, format_address $host, $service);
my ($service, $host) = unpack_sockaddr getsockname $fh;
$len = $prepare && $prepare->($fh, format_address $host, $service);
}
$len ||= 128;
listen $state{fh}, $len
or Carp::croak "listen: $!";
listen $fh, $len
or Carp::croak "tcp_bind: $!";
$done->(\%state);
defined wantarray
? guard { %state = () } # clear fh and watcher, which breaks the circular dependency
? guard { %state = () } # clear fh, unlink
: ()
}
......
......@@ -16,6 +16,7 @@ cat <<EOF
68_poe AnyEvent::Impl::POE $^W = 0;
69_ev AnyEvent::Impl::EV
70_uv AnyEvent::Impl::UV
71_prima AnyEvent::Impl::Prima
EOF
) | while read base module extra; do
for test in 01 02 03 04 05 07 09; do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment