Skip to content

Commit

Permalink
improved IPv6 exception handling in Mojo::IOLoop::Client
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 28, 2012
1 parent fcc3f02 commit 5f0cd81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,5 +1,6 @@

2.98 2012-05-29
- Improved IPv6 exception handling in Mojo::IOLoop::Client.
- Improved tests.

2.97 2012-05-28
Expand Down
7 changes: 4 additions & 3 deletions lib/Mojo/IOLoop/Client.pm
Expand Up @@ -64,12 +64,13 @@ sub _connect {
return $self->emit_safe(error => "Couldn't connect.")
unless $handle = $class->new(%options);

# IPv6 needs an early start
return $self->emit_safe(error => "Couldn't connect.")
if IPV6 && !defined($handle->connect);

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

# IPv6 needs an early start
$handle->connect if IPV6;
}
$handle->blocking(0);

Expand Down

0 comments on commit 5f0cd81

Please sign in to comment.