Skip to content

Commit

Permalink
renamed MOJO_NO_DNS to MOJO_NO_NDN
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 4, 2014
1 parent c4b8cb8 commit 60f8229
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/IOLoop.pm
Expand Up @@ -324,7 +324,7 @@ For better scalability (epoll, kqueue) and to provide non-blocking name
resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
L<Net::DNS::Native> (0.10+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (1.84+) will be used automatically if they are installed.
Individual features can also be disabled with the C<MOJO_NO_DNS>,
Individual features can also be disabled with the C<MOJO_NO_NDN>,
C<MOJO_NO_SOCKS> and C<MOJO_NO_TLS> environment variables.
See L<Mojolicious::Guides::Cookbook/"REAL-TIME WEB"> for more.
Expand Down
12 changes: 6 additions & 6 deletions lib/Mojo/IOLoop/Client.pm
Expand Up @@ -8,10 +8,10 @@ use Scalar::Util 'weaken';
use Socket qw(IPPROTO_TCP SO_ERROR TCP_NODELAY);

# Non-blocking name resolution requires Net::DNS::Native
use constant DNS => $ENV{MOJO_NO_DNS}
use constant NDN => $ENV{MOJO_NO_NDN}
? 0
: eval 'use Net::DNS::Native 0.10 (); 1';
my $DNS = DNS ? Net::DNS::Native->new : undef;
my $NDN = NDN ? Net::DNS::Native->new : undef;

# TLS support requires IO::Socket::SSL
use constant TLS => $ENV{MOJO_NO_TLS}
Expand Down Expand Up @@ -44,18 +44,18 @@ sub connect {
# Blocking name resolution
my $address = $args->{socks_address} || ($args->{address} ||= 'localhost');
return $reactor->next_tick(sub { $self && $self->_connect($args) })
unless DNS && $address ne 'localhost' && !$args->{handle};
unless NDN && $address ne 'localhost' && !$args->{handle};

# Non-blocking name resolution
$address =~ s/[\[\]]//g;
my $handle = $self->{dns}
= $DNS->getaddrinfo($address, _port($args), {protocol => IPPROTO_TCP});
= $NDN->getaddrinfo($address, _port($args), {protocol => IPPROTO_TCP});
$reactor->io(
$handle => sub {
my $reactor = shift;

$reactor->remove($self->{dns});
my ($err, @res) = $DNS->get_result(delete $self->{dns});
my ($err, @res) = $NDN->get_result(delete $self->{dns});
return $self->emit(error => "Can't resolve: $err") if $err;

$args->{addr_info} = \@res;
Expand All @@ -67,7 +67,7 @@ sub connect {
sub _cleanup {
my $self = shift;
return $self unless my $reactor = $self->reactor;
$DNS->timedout($self->{dns}) if $self->{dns};
$NDN->timedout($self->{dns}) if $self->{dns};
$self->{$_} && $reactor->remove(delete $self->{$_}) for qw(dns timer handle);
return $self;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Daemon.pm
Expand Up @@ -268,7 +268,7 @@ For better scalability (epoll, kqueue) and to provide non-blocking name
resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
L<Net::DNS::Native> (0.10+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (1.84+) will be used automatically if they are installed.
Individual features can also be disabled with the C<MOJO_NO_DNS>,
Individual features can also be disabled with the C<MOJO_NO_NDN>,
C<MOJO_NO_SOCKS> and C<MOJO_NO_TLS> environment variables.
See L<Mojolicious::Guides::Cookbook/"DEPLOYMENT"> for more.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -175,7 +175,7 @@ For better scalability (epoll, kqueue) and to provide non-blocking name
resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
L<Net::DNS::Native> (0.10+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (1.84+) will be used automatically if they are installed.
Individual features can also be disabled with the C<MOJO_NO_DNS>,
Individual features can also be disabled with the C<MOJO_NO_NDN>,
C<MOJO_NO_SOCKS> and C<MOJO_NO_TLS> environment variables.
See L<Mojolicious::Guides::Cookbook/"DEPLOYMENT"> for more.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Morbo.pm
Expand Up @@ -134,7 +134,7 @@ For better scalability (epoll, kqueue) and to provide non-blocking name
resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
L<Net::DNS::Native> (0.10+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (1.84+) will be used automatically if they are installed.
Individual features can also be disabled with the C<MOJO_NO_DNS>,
Individual features can also be disabled with the C<MOJO_NO_NDN>,
C<MOJO_NO_SOCKS> and C<MOJO_NO_TLS> environment variables.
See L<Mojolicious::Guides::Cookbook/"DEPLOYMENT"> for more.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Prefork.pm
Expand Up @@ -265,7 +265,7 @@ For better scalability (epoll, kqueue) and to provide non-blocking name
resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
L<Net::DNS::Native> (0.10+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (1.84+) will be used automatically if they are installed.
Individual features can also be disabled with the C<MOJO_NO_DNS>,
Individual features can also be disabled with the C<MOJO_NO_NDN>,
C<MOJO_NO_SOCKS> and C<MOJO_NO_TLS> environment variables.
See L<Mojolicious::Guides::Cookbook/"DEPLOYMENT"> for more.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/UserAgent.pm
Expand Up @@ -444,7 +444,7 @@ For better scalability (epoll, kqueue) and to provide non-blocking name
resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+),
L<Net::DNS::Native> (0.10+), L<IO::Socket::Socks> (0.64+) and
L<IO::Socket::SSL> (1.84+) will be used automatically if they are installed.
Individual features can also be disabled with the C<MOJO_NO_DNS>,
Individual features can also be disabled with the C<MOJO_NO_NDN>,
C<MOJO_NO_SOCKS> and C<MOJO_NO_TLS> environment variables.
See L<Mojolicious::Guides::Cookbook/"USER AGENT"> for more.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Command/version.pm
Expand Up @@ -13,7 +13,7 @@ sub run {

my $ev = eval 'use Mojo::Reactor::EV; 1' ? $EV::VERSION : 'not installed';
my $class = 'Mojo::IOLoop::Client';
my $dns = $class->DNS ? $Net::DNS::Native::VERSION : 'not installed';
my $dns = $class->NDN ? $Net::DNS::Native::VERSION : 'not installed';
my $socks = $class->SOCKS ? $IO::Socket::Socks::VERSION : 'not installed';
my $tls = $class->TLS ? $IO::Socket::SSL::VERSION : 'not installed';

Expand Down

0 comments on commit 60f8229

Please sign in to comment.