Permalink
Browse files

improved IPv6 exception handling in Mojo::IOLoop::Client

  • Loading branch information...
1 parent fcc3f02 commit 5f0cd8184f11a45c21f970247b0d9ea148bdcb9d @kraih committed May 28, 2012
Showing with 5 additions and 3 deletions.
  1. +1 −0 Changes
  2. +4 −3 lib/Mojo/IOLoop/Client.pm
View
@@ -1,5 +1,6 @@
2.98 2012-05-29
+ - Improved IPv6 exception handling in Mojo::IOLoop::Client.
- Improved tests.
2.97 2012-05-28
@@ -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);

0 comments on commit 5f0cd81

Please sign in to comment.