Skip to content

Commit

Permalink
increased default connect timeout from 3 to 10 seconds in Mojo::UserA…
Browse files Browse the repository at this point in the history
…gent and Mojo::IOLoop::Client
  • Loading branch information
kraih committed Feb 25, 2012
1 parent b586426 commit 28e4acc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,6 +1,8 @@
This file documents the revision history for Perl extension Mojolicious.

2.54 2012-02-25 00:00:00
- Increased default connect timeout from 3 to 10 seconds in
Mojo::UserAgent and Mojo::IOLoop::Client.
- Improved test command to colorize by default.
- Improved documentation.
- Fixed small rendering bug in Mojolicious::Plugin::PODRenderer.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/IOLoop/Client.pm
Expand Up @@ -64,7 +64,7 @@ sub _connect {
unless $handle = $class->new(%options);

# Timer
$self->{timer} = $watcher->timer($args->{timeout} || 3,
$self->{timer} = $watcher->timer($args->{timeout} || 10,
sub { $self->emit_safe(error => 'Connect timeout.') });

# IPv6 needs an early start
Expand Down Expand Up @@ -231,7 +231,7 @@ Port to connect to.
=item C<timeout>
Maximum amount of time in seconds establishing connection may take before
getting canceled.
getting canceled, defaults to C<10>.
=item C<tls>
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -15,7 +15,7 @@ use constant DEBUG => $ENV{MOJO_USERAGENT_DEBUG} || 0;
# "You can't let a single bad experience scare you away from drugs."
has ca => sub { $ENV{MOJO_CA_FILE} };
has cert => sub { $ENV{MOJO_CERT_FILE} };
has connect_timeout => 3;
has connect_timeout => 10;
has cookie_jar => sub { Mojo::CookieJar->new };
has [qw/http_proxy https_proxy local_address no_proxy/];
has inactivity_timeout => 20;
Expand Down Expand Up @@ -261,6 +261,7 @@ sub _connect_proxy {
return $loop->client(
handle => $handle,
id => $id,
timeout => $self->connect_timeout,
tls => 1,
tls_ca => $self->ca,
tls_cert => $self->cert,
Expand Down Expand Up @@ -697,7 +698,7 @@ environment variable.
$ua = $ua->connect_timeout(5);
Maximum amount of time in seconds establishing a connection may take before
getting canceled, defaults to C<3>.
getting canceled, defaults to C<10>.
=head2 C<cookie_jar>
Expand Down

0 comments on commit 28e4acc

Please sign in to comment.