Skip to content

Commit

Permalink
fixed on FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
creaktive committed Oct 15, 2012
1 parent 3b31b39 commit 414880b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.pod
Expand Up @@ -8,7 +8,7 @@ Test::HTTP::AnyEvent::Server - the async counterpart to Test::HTTP::Server

=head1 VERSION

version 0.003
version 0.004

=head1 SYNOPSIS

Expand Down
9 changes: 4 additions & 5 deletions lib/Test/HTTP/AnyEvent/Server.pm
Expand Up @@ -268,17 +268,16 @@ sub BUILD {
my $h = AnyEvent::Handle->new(
fh => $wh,
on_error => sub {
#my ($_h, $fatal, $msg) = @_;
my ($_h) = @_;
shutdown $_h->{fh}, 2;
$_h->destroy;
AE::log fatal =>
"couldn't syswrite() to pipe: $!";
},
);

$self->set_server(
$self->start_server(sub {
my (undef, $address, $port) = @_;
$h->push_write(join("\t", $address, $port));
# have to postpone so the address/port gets actually bound
AE::postpone { $h->push_write(join("\t", $address, $port)) };
})
);

Expand Down
4 changes: 2 additions & 2 deletions t/02-forked.t
Expand Up @@ -17,8 +17,8 @@ my $ua = HTTP::Tiny->new(
proxy => undef,
);

my $res = $ua->get($server->uri . q(repeat/10000/asdfgh));
my $res = $ua->get($server->uri . q(repeat/1000/asdfgh));
ok($res->{success}, q(success));
like($res->{content}, qr{^(?:asdfgh){10000}$}x, q(content OK));
like($res->{content}, qr{^(?:asdfgh){1000}$}x, q(content OK));

done_testing(2);

0 comments on commit 414880b

Please sign in to comment.