AnyEvent
view release on metacpan or search on metacpan
- praise the joys of AnyEvent::Fork::*.
- time for an =encoding directive.
- do no longer use JSON to create a default json coder, use
JSON::XS or JSON::PP directly.
7.05 Wed Aug 21 10:38:08 CEST 2013
- uts46data.pl couldn't be found due to wrong naming of the file
(reported by Fulko Hew).
- handle lone \015's properly in AE::Handle's default line read
(reported by various people).
- untaint ip addresses found in /etc/hosts (patch by José Micó).
- the memleak fix in 7.03 caused resolving via /etc/hosts to always
fail on first use (reported and testcase by Andrew Whatson).
- expose AnyEvent::Log::format_time, and allow users to redefine it.
- expose AnyEvent::Log::default_format, and allow redefinition.
- expose AnyEvent::Log::fatal_exit, to allow redefinition.
- AnyEvent::Debug shell can now run coro shell commands, if available.
- t/63* tests were wrongly in MANIFEST.
- kernel.org's finger server went MIA, switch to freebsd.org and
icculus.org.
- clarify that IO::AIO and AnyEvent::AIO are needed for AnyEvent::IO
- AnyEvent::Handle::push_read (line => did pass $1 directly, so
regex-matching inside the callback would change the parameter, despite
$1 being dynamically scoped per-block. this perl bug is now being
worked around (testcase by Cindy Wang).
6.12 Mon Dec 12 13:21:10 CET 2011
- $! was clobbered by subsequent calls in tcp_connect, due to
the postpone not saving/restoring it (analyzed by Richard Garnish).
6.11 Tue Nov 22 10:36:05 CET 2011
- Tk cannot create windows when tainted unless you set a title, so
set a dummy title for AnyEvent's dummy mainwindow. How dummy.
- escape any nonprintable/nonascii characters when stringifying
backtraces.
- log the reason loading an interface module fails to load at level debug.
6.1 Tue Oct 4 19:44:30 CEST 2011
- INCOMPATIBLE CHANGE: the default log level is now "4" (error
and above), and some messages inside AnyEvent have been elevated
to higher log levels to print by default.
- AnyEvent::log, unlike AnyEvent::Log::log, did not always exit on fatal.
- expand condvar begin/end documentation.
4.42 Fri Jun 26 08:32:18 CEST 2009
- preliminary and neccesarily incomplete support for IO::Async.
- reset SIGCHLD to DEFAULT when AnyEvent is loaded, in
case it was set to IGNORE, to ensure we can catch child statuses
even when the calling env acts stupidly.
- updated benchmarks with IO::Async, which performs very well.
4.412 Wed Jun 24 01:35:57 CEST 2009
- support an "untaint" attribute for AnyEvent::DNS
and set it on the default resolver.
- implement and document AnyEvent::Impl::Perl::loop.
- remove all anyevent-env variables from %ENV
when running in tainted mode.
- mention and extend the IO::Lambda benchmark.
4.411 Sun Jun 7 18:48:02 CEST 2009
- do not try to use F_SETFD on windows.
4.41 Thu May 14 06:40:11 CEST 2009
- work around issues in older perls (5.8.0?) when
a signal handler is deleted from the %SIG hash.
- use POSIX::_exit in child test, to avoid running
destructors.
should not access env variables starting with "AE_", see below).
All variables can also be set via the "AE_" prefix, that is, instead of
setting "PERL_ANYEVENT_VERBOSE" you can also set "AE_VERBOSE". In case
there is a clash btween anyevent and another program that uses
"AE_something" you can set the corresponding "PERL_ANYEVENT_something"
variable to the empty string, as those variables take precedence.
When AnyEvent is first loaded, it copies all "AE_xxx" env variables to
their "PERL_ANYEVENT_xxx" counterpart unless that variable already
exists. If taint mode is on, then AnyEvent will remove *all* environment
variables starting with "PERL_ANYEVENT_" from %ENV (or replace them with
"undef" or the empty string, if the corresaponding "AE_" variable is
set).
The exact algorithm is currently:
1. if taint mode enabled, delete all PERL_ANYEVENT_xyz variables from %ENV
2. copy over AE_xyz to PERL_ANYEVENT_xyz unless the latter alraedy exists
3. if taint mode enabled, set all PERL_ANYEVENT_xyz variables to undef.
This ensures that child processes will not see the "AE_" variables.
The following environment variables are currently known to AnyEvent:
"PERL_ANYEVENT_VERBOSE"
By default, AnyEvent will log messages with loglevel 4 ("error") or
higher (see AnyEvent::Log). You can set this environment variable to
a numerical loglevel to make AnyEvent more (or less) talkative.
BEGIN { delete $ENV{PERL_ANYEVENT_MODEL} }
use AnyEvent;
Similar considerations apply to $ENV{PERL_ANYEVENT_VERBOSE}, as that can
be used to probe what backend is used and gain other information (which
is probably even less useful to an attacker than PERL_ANYEVENT_MODEL),
and $ENV{PERL_ANYEVENT_STRICT}.
Note that AnyEvent will remove *all* environment variables starting with
"PERL_ANYEVENT_" from %ENV when it is loaded while taint mode is
enabled.
BUGS
Perl 5.8 has numerous memleaks that sometimes hit this module and are
hard to work around. If you suffer from memleaks, first upgrade to Perl
5.10 and check wether the leaks still show up. (Perl 5.10.0 has other
annoying memleaks, such as leaking on "map" and "grep" but it is usually
not as pronounced).
SEE ALSO
constants.pl.PL view on Meta::CPAN
print "# automatically generated from constants.pl.PL\n";
}
{
# 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 glob digit printf
layer reserved taint closure semicolon);
no warnings qw(exec newline unopened);
BEGIN {
print "sub AnyEvent::common_sense {\n";
printf " local \$^W;\n";
printf " \${^WARNING_BITS} ^= \${^WARNING_BITS} ^ \"%s\";\n",
join "", map "\\x$_", unpack "(H2)*", ${^WARNING_BITS};
# use strict, use utf8;
printf " \$^H |= 0x%x;\n", $^H;
print "}\n";
lib/AnyEvent.pm view on Meta::CPAN
}
use Carp ();
our $VERSION = 7.17;
our $MODEL;
our @ISA;
our @REGISTRY;
our $VERBOSE;
our %PROTOCOL; # (ipv4|ipv6) => (1|2), higher numbers are preferred
our $MAX_SIGNAL_LATENCY = $ENV{PERL_ANYEVENT_MAX_SIGNAL_LATENCY} || 10; # executes after the BEGIN block below (tainting!)
BEGIN {
eval "sub TAINT (){" . (${^TAINT}*1) . "}";
delete @ENV{grep /^PERL_ANYEVENT_/, keys %ENV}
if ${^TAINT};
$ENV{"PERL_ANYEVENT_$_"} = $ENV{"AE_$_"}
for grep s/^AE_// && !exists $ENV{"PERL_ANYEVENT_$_"}, keys %ENV;
lib/AnyEvent.pm view on Meta::CPAN
variables starting with C<AE_>, see below).
All variables can also be set via the C<AE_> prefix, that is, instead
of setting C<PERL_ANYEVENT_VERBOSE> you can also set C<AE_VERBOSE>. In
case there is a clash btween anyevent and another program that uses
C<AE_something> you can set the corresponding C<PERL_ANYEVENT_something>
variable to the empty string, as those variables take precedence.
When AnyEvent is first loaded, it copies all C<AE_xxx> env variables
to their C<PERL_ANYEVENT_xxx> counterpart unless that variable already
exists. If taint mode is on, then AnyEvent will remove I<all> environment
variables starting with C<PERL_ANYEVENT_> from C<%ENV> (or replace them
with C<undef> or the empty string, if the corresaponding C<AE_> variable
is set).
The exact algorithm is currently:
1. if taint mode enabled, delete all PERL_ANYEVENT_xyz variables from %ENV
2. copy over AE_xyz to PERL_ANYEVENT_xyz unless the latter alraedy exists
3. if taint mode enabled, set all PERL_ANYEVENT_xyz variables to undef.
This ensures that child processes will not see the C<AE_> variables.
The following environment variables are currently known to AnyEvent:
=over 4
=item C<PERL_ANYEVENT_VERBOSE>
By default, AnyEvent will log messages with loglevel C<4> (C<error>) or
lib/AnyEvent.pm view on Meta::CPAN
BEGIN { delete $ENV{PERL_ANYEVENT_MODEL} }
use AnyEvent;
Similar considerations apply to $ENV{PERL_ANYEVENT_VERBOSE}, as that can
be used to probe what backend is used and gain other information (which is
probably even less useful to an attacker than PERL_ANYEVENT_MODEL), and
$ENV{PERL_ANYEVENT_STRICT}.
Note that AnyEvent will remove I<all> environment variables starting with
C<PERL_ANYEVENT_> from C<%ENV> when it is loaded while taint mode is
enabled.
=head1 BUGS
Perl 5.8 has numerous memleaks that sometimes hit this module and are hard
to work around. If you suffer from memleaks, first upgrade to Perl 5.10
and check wether the leaks still show up. (Perl 5.10.0 has other annoying
memleaks, such as leaking on C<map> and C<grep> but it is usually not as
pronounced).
lib/AnyEvent/DNS.pm view on Meta::CPAN
is used by AnyEvent itself as well.
It only ever creates one resolver and returns this one on subsequent calls
- see C<$AnyEvent::DNS::RESOLVER>, below, for details.
Unless you have special needs, prefer this function over creating your own
resolver object.
The resolver is created with the following parameters:
untaint enabled
max_outstanding $ENV{PERL_ANYEVENT_MAX_OUTSTANDING_DNS} (default 10)
C<os_config> will be used for OS-specific configuration, unless
C<$ENV{PERL_ANYEVENT_RESOLV_CONF}> is specified, in which case that file
gets parsed.
=item $AnyEvent::DNS::RESOLVER
This variable stores the default resolver returned by
C<AnyEvent::DNS::resolver>, or C<undef> when the default resolver hasn't
lib/AnyEvent/DNS.pm view on Meta::CPAN
by storing it in this variable, causing all subsequent resolves done via
C<AnyEvent::DNS::resolver> to be done via the custom one.
=cut
our $RESOLVER;
sub resolver() {
$RESOLVER || do {
$RESOLVER = new AnyEvent::DNS
untaint => 1,
max_outstanding => $ENV{PERL_ANYEVENT_MAX_OUTSTANDING_DNS}*1 || 10,
;
$ENV{PERL_ANYEVENT_RESOLV_CONF}
? $RESOLVER->_load_resolv_conf_file ($ENV{PERL_ANYEVENT_RESOLV_CONF})
: $RESOLVER->os_config;
$RESOLVER
}
}
lib/AnyEvent/DNS.pm view on Meta::CPAN
(default: C<10>), that means if you request more than this many requests,
then the additional requests will be queued until some other requests have
been resolved.
=item reuse => $seconds
The number of seconds (default: C<300>) that a query id cannot be re-used
after a timeout. If there was no time-out then query ids can be reused
immediately.
=item untaint => $boolean
When true, then the resolver will automatically untaint results, and might
also ignore certain environment variables.
=back
=cut
sub new {
my ($class, %arg) = @_;
my $self = bless {
lib/AnyEvent/DNS.pm view on Meta::CPAN
}
}
$self->{retry} = \@retry;
}
sub _feed {
my ($self, $res) = @_;
($res) = $res =~ /^(.*)$/s
if AnyEvent::TAINT && $self->{untaint};
$res = dns_unpack $res
or return;
my $id = $self->{id}{$res->{id}};
return unless ref $id;
$NOW = time;
$id->[1]->($res);
( run in 0.303 second using v1.01-cache-2.11-cpan-1dc43b0fbd2 )