Created
December 7, 2011 19:31
-
-
Save leedo/1444260 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/AnyEvent/IRC/Client.pm b/lib/AnyEvent/IRC/Client.pm | |
index 4992398..2b2cd98 100644 | |
--- a/lib/AnyEvent/IRC/Client.pm | |
+++ b/lib/AnyEvent/IRC/Client.pm | |
@@ -452,7 +452,9 @@ All keys, except C<nick> are optional. | |
sub connect { | |
my ($self, $host, $port, $info) = @_; | |
- if (defined $info) { | |
+ my $timeout = delete $info->{timeout}; | |
+ | |
+ if (defined $info and keys %$info) { | |
$self->{register_cb_guard} = $self->reg_cb ( | |
ext_before_connect => sub { | |
my ($self, $err) = @_; | |
@@ -468,7 +470,7 @@ sub connect { | |
); | |
} | |
- $self->SUPER::connect ($host, $port, $info->{timeout}); | |
+ $self->SUPER::connect ($host, $port, $timeout); | |
} | |
=item $cl->register ($nick, $user, $real, $server_pass) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment