Permalink
Browse files

fixed small argument bug in client method of Mojo::IOLoop

  • Loading branch information...
1 parent abbe257 commit 5a7b9ae6eff6392840346b75e5b892c016b6a56e @kraih committed Dec 18, 2011
Showing with 8 additions and 5 deletions.
  1. +1 −0 Changes
  2. +1 −1 lib/Mojo/IOLoop.pm
  3. +1 −0 t/mojo/ioloop.t
  4. +5 −4 t/mojo/ioloop_tls.t
View
@@ -2,6 +2,7 @@ This file documents the revision history for Perl extension Mojolicious.
2.39 2011-12-18 00:00:00
- Improved documentation. (vervain, sri)
+ - Fixed small argument bug in client method of Mojo::IOLoop.
2.38 2011-12-17 00:00:00
- Changed Mojo::IOLoop->client arguments from ($loop, $stream, $err)
View
@@ -63,7 +63,7 @@ sub client {
$client->on(
error => sub {
my $c = delete $self->{connections}->{$id};
- $self->$cb(pop);
+ $self->$cb(pop, undef);
}
);
View
@@ -179,6 +179,7 @@ $err = undef;
$loop->client(
(port => $port) => sub {
shift->stop;
+ pop;
$err = pop;
}
);
View
@@ -115,7 +115,7 @@ $id = $loop->client(
tls => 1,
tls_cert => 't/mojo/certs/badcert.key',
tls_key => 't/mojo/certs/badcert.crt',
- sub { $client_error = pop }
+ sub { shift; $client_error = shift }
);
$loop->timer(1 => sub { shift->stop });
$loop->start;
@@ -142,7 +142,7 @@ $id = $loop->client(
tls => 1,
tls_cert => 't/mojo/certs/client.crt',
tls_key => 't/mojo/certs/client.key',
- sub { $client_error = pop }
+ sub { shift; $client_error = shift }
);
$loop->timer(1 => sub { shift->stop });
$loop->start;
@@ -190,7 +190,8 @@ is $client_close, 1, 'client emitted close event once';
# Missing client certificate
$server_error = $client_error = '';
-$id = $loop->client({port => $port, tls => 1} => sub { $client_error = pop });
+$id = $loop->client(
+ {port => $port, tls => 1} => sub { shift; $client_error = shift });
$loop->timer(1 => sub { shift->stop });
$loop->start;
ok !$server_error, 'no error';
@@ -218,7 +219,7 @@ $id = $loop->client(
tls => 1,
tls_cert => 't/mojo/certs/client.crt',
tls_key => 't/mojo/certs/client.key',
- sub { $client_error = pop }
+ sub { shift; $client_error = shift }
);
$loop->timer(1 => sub { shift->stop });
$loop->start;

0 comments on commit 5a7b9ae

Please sign in to comment.