Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove trailing whitespace and carriage returns

  • Loading branch information...
commit 60fec732ceeeb847a2e071c59ae2a9e6a8476e64 1 parent 92a9edb
@ikegami authored
View
32 .gitignore
@@ -1,16 +1,16 @@
-Makefile
-Makefile.old
-*.tar.gz
-*.bak
-pm_to_blib
-blib/
-LWP-Protocol-AnyEvent-http-*
-LWP-Protocol-AnyEvent-http-*/
-.releaserc
-cover_db
-MYMETA.*
-Build
-Build.bat
-_build/
-pod2htmd.tmp
-pod2htmi.tmp
+Makefile
+Makefile.old
+*.tar.gz
+*.bak
+pm_to_blib
+blib/
+LWP-Protocol-AnyEvent-http-*
+LWP-Protocol-AnyEvent-http-*/
+.releaserc
+cover_db
+MYMETA.*
+Build
+Build.bat
+_build/
+pod2htmd.tmp
+pod2htmi.tmp
View
38 MANIFEST
@@ -1,19 +1,19 @@
-.gitignore
-Build.PL
-Changes.txt
-inc/IO/Catch.pm
-inc/Test/HTTP/LocalServer.pm
-inc/Test/HTTP/log-server
-lib/LWP/Protocol/AnyEvent/http.pm
-LICENSE.txt
-MANIFEST
-MANIFEST.SKIP
-META.json
-META.yml
-README.txt
-t/00_load.t
-t/01_timer.t
-t/02_large.t
-t/03_error_after_headers.t
-t/04_error_404.t
-t/05_error_500_bogus_host.t
+.gitignore
+Build.PL
+Changes.txt
+inc/IO/Catch.pm
+inc/Test/HTTP/LocalServer.pm
+inc/Test/HTTP/log-server
+lib/LWP/Protocol/AnyEvent/http.pm
+LICENSE.txt
+MANIFEST
+MANIFEST.SKIP
+META.json
+META.yml
+README.txt
+t/00_load.t
+t/01_timer.t
+t/02_large.t
+t/03_error_after_headers.t
+t/04_error_404.t
+t/05_error_500_bogus_host.t
View
2  MANIFEST.SKIP
@@ -6,4 +6,4 @@
^LWP-Protocol-AnyEvent-http-.*
~$
^.git/
-.*.bak$
+.*.bak$
View
6 lib/LWP/Protocol/AnyEvent/http.pm
@@ -101,7 +101,7 @@ sub request {
$data_avail->send();
},
);
-
+
# We need to wait for the headers so the response code
# is set up properly. LWP::Protocol decides on ->is_success
# whether to call the :content_cb or not.
@@ -111,11 +111,11 @@ sub request {
if (!@data_queue) {
# Wait for more data to arrive
$data_avail->recv();
-
+
# Re-prime our channel, in case there is more.
$data_avail = AnyEvent->condvar();
};
-
+
return shift(@data_queue);
});
}
View
84 t/01_timer.t
@@ -1,42 +1,42 @@
-#!perl -w
-use strict;
-use Test::More;
-
-use AnyEvent;
-use LWP::Protocol::AnyEvent::http;
-use LWP::Simple qw(get);
-
-# Check whether we can launch the local webserver
-if (! eval {
- use lib '../inc', 'inc';
- require Test::HTTP::LocalServer;
- 1;
-}) {
- plan skip_all => "Couldn't launch test server: $@";
-} else {
- plan tests => 2;
-};
-
-# Launch a timer
-my $timer_events = 0;
-my $t = AnyEvent->timer(
- after => 1, interval => 1, cb => sub { diag "Waiting for reply\n"; $timer_events++ }
-);
-
-my $server = Test::HTTP::LocalServer->spawn(
- eval => 'sleep(4)',
- #debug => 1,
-);
-my $url = $server->url;
-diag "Retrieving URL: " . $url;
-
-my $data = get($url) || '';
-isn't $data, '', "Retrieve " . $url;
-cmp_ok $timer_events, '>', 3, "While retrieving the data we got three timer callbacks(because the server sleeps)";
-
-undef $t; # stop the timer
-
-diag "Shutting down server";
-$server->stop;
-undef $server;
-diag "Done";
+#!perl -w
+use strict;
+use Test::More;
+
+use AnyEvent;
+use LWP::Protocol::AnyEvent::http;
+use LWP::Simple qw(get);
+
+# Check whether we can launch the local webserver
+if (! eval {
+ use lib '../inc', 'inc';
+ require Test::HTTP::LocalServer;
+ 1;
+}) {
+ plan skip_all => "Couldn't launch test server: $@";
+} else {
+ plan tests => 2;
+};
+
+# Launch a timer
+my $timer_events = 0;
+my $t = AnyEvent->timer(
+ after => 1, interval => 1, cb => sub { diag "Waiting for reply\n"; $timer_events++ }
+);
+
+my $server = Test::HTTP::LocalServer->spawn(
+ eval => 'sleep(4)',
+ #debug => 1,
+);
+my $url = $server->url;
+diag "Retrieving URL: " . $url;
+
+my $data = get($url) || '';
+isn't $data, '', "Retrieve " . $url;
+cmp_ok $timer_events, '>', 3, "While retrieving the data we got three timer callbacks(because the server sleeps)";
+
+undef $t; # stop the timer
+
+diag "Shutting down server";
+$server->stop;
+undef $server;
+diag "Done";
View
100 t/02_large.t
@@ -1,50 +1,50 @@
-#!perl -w
-use strict;
-use Test::More;
-
-use AnyEvent;
-use LWP::Protocol::AnyEvent::http;
-use LWP::UserAgent;
-
-# Check whether we can launch the local webserver
-if (! eval {
- use lib '../inc', 'inc';
- require Test::HTTP::LocalServer;
- 1;
-}) {
- plan skip_all => "Couldn't launch test server: $@";
-} else {
- plan tests => 5;
-};
-
-# Launch a timer
-my $timer_events = 0;
-my $t = AnyEvent->timer(
- after => 1, interval => 1, cb => sub { diag "Waiting for reply\n"; $timer_events++ }
-);
-
-my $client = LWP::UserAgent->new();
-
-my $server = Test::HTTP::LocalServer->spawn(
- #debug => 1,
-);
-my $url = $server->chunked;
-diag "Retrieving URL: " . $url;
-
-my $chunk_count;
-my $res = $client->get($server->chunked, ':content_cb' => sub {
- diag "Got chunk";
- $chunk_count++
-});
-ok $res->is_success, "We made a successfull request";
-is $res->code, 200, "Yes, real success";
-is $res->content, '', "We got an empty response";
-is $chunk_count, 5, "We received 5 chunks";
-cmp_ok $timer_events, '>', 3, "Retrieving the data took more than 3 seconds (because the server sleeps)";
-
-undef $t; # stop the timer
-
-diag "Shutting down server";
-$server->stop;
-undef $server;
-diag "Done";
+#!perl -w
+use strict;
+use Test::More;
+
+use AnyEvent;
+use LWP::Protocol::AnyEvent::http;
+use LWP::UserAgent;
+
+# Check whether we can launch the local webserver
+if (! eval {
+ use lib '../inc', 'inc';
+ require Test::HTTP::LocalServer;
+ 1;
+}) {
+ plan skip_all => "Couldn't launch test server: $@";
+} else {
+ plan tests => 5;
+};
+
+# Launch a timer
+my $timer_events = 0;
+my $t = AnyEvent->timer(
+ after => 1, interval => 1, cb => sub { diag "Waiting for reply\n"; $timer_events++ }
+);
+
+my $client = LWP::UserAgent->new();
+
+my $server = Test::HTTP::LocalServer->spawn(
+ #debug => 1,
+);
+my $url = $server->chunked;
+diag "Retrieving URL: " . $url;
+
+my $chunk_count;
+my $res = $client->get($server->chunked, ':content_cb' => sub {
+ diag "Got chunk";
+ $chunk_count++
+});
+ok $res->is_success, "We made a successfull request";
+is $res->code, 200, "Yes, real success";
+is $res->content, '', "We got an empty response";
+is $chunk_count, 5, "We received 5 chunks";
+cmp_ok $timer_events, '>', 3, "Retrieving the data took more than 3 seconds (because the server sleeps)";
+
+undef $t; # stop the timer
+
+diag "Shutting down server";
+$server->stop;
+undef $server;
+diag "Done";
View
98 t/03_error_after_headers.t
@@ -1,49 +1,49 @@
-#!perl -w
-use strict;
-use Test::More;
-
-use AnyEvent;
-use LWP::Protocol::AnyEvent::http;
-use LWP::UserAgent;
-
-# Check whether we can launch the local webserver
-if (! eval {
- use lib '../inc', 'inc';
- require Test::HTTP::LocalServer;
- 1;
-}) {
- plan skip_all => "Couldn't launch test server: $@";
-} else {
- plan tests => 4;
-};
-
-# Launch a timer
-my $timer_events = 0;
-my $t = AnyEvent->timer(
- after => 1, interval => 1, cb => sub { diag "Waiting for reply\n"; $timer_events++ }
-);
-
-my $client = LWP::UserAgent->new();
-
-my $server = Test::HTTP::LocalServer->spawn(
- #debug => 1,
-);
-my $url = $server->url;
-diag "Retrieving URL: " . $url;
-
-my $chunk_count;
-my $res = $client->get($server->error_after_headers, ':content_cb' => sub {
- diag "Got chunk";
- $chunk_count++
-});
-ok !$res->is_success, "The request was not successfull, as planned";
-cmp_ok $res->code, '>=', 500, "We caught the remote error";
-is $res->content, '', "We got an empty response";
-is $chunk_count, 2, "We received 2 chunks";
-
-undef $t; # stop the timer
-
-diag "Shutting down server";
-$server->stop;
-undef $server;
-diag "Done";
+#!perl -w
+use strict;
+use Test::More;
+
+use AnyEvent;
+use LWP::Protocol::AnyEvent::http;
+use LWP::UserAgent;
+
+# Check whether we can launch the local webserver
+if (! eval {
+ use lib '../inc', 'inc';
+ require Test::HTTP::LocalServer;
+ 1;
+}) {
+ plan skip_all => "Couldn't launch test server: $@";
+} else {
+ plan tests => 4;
+};
+
+# Launch a timer
+my $timer_events = 0;
+my $t = AnyEvent->timer(
+ after => 1, interval => 1, cb => sub { diag "Waiting for reply\n"; $timer_events++ }
+);
+
+my $client = LWP::UserAgent->new();
+
+my $server = Test::HTTP::LocalServer->spawn(
+ #debug => 1,
+);
+my $url = $server->url;
+diag "Retrieving URL: " . $url;
+
+my $chunk_count;
+my $res = $client->get($server->error_after_headers, ':content_cb' => sub {
+ diag "Got chunk";
+ $chunk_count++
+});
+ok !$res->is_success, "The request was not successfull, as planned";
+cmp_ok $res->code, '>=', 500, "We caught the remote error";
+is $res->content, '', "We got an empty response";
+is $chunk_count, 2, "We received 2 chunks";
+
+undef $t; # stop the timer
+
+diag "Shutting down server";
+$server->stop;
+undef $server;
+diag "Done";
View
96 t/04_error_404.t
@@ -1,48 +1,48 @@
-#!perl -w
-use strict;
-use Test::More;
-
-use AnyEvent;
-use LWP::Protocol::AnyEvent::http;
-use LWP::UserAgent;
-
-# Check whether we can launch the local webserver
-if (! eval {
- use lib '../inc', 'inc';
- require Test::HTTP::LocalServer;
- 1;
-}) {
- plan skip_all => "Couldn't launch test server: $@";
-} else {
- plan tests => 4;
-};
-
-# Launch a timer
-my $timer_events = 0;
-my $t = AnyEvent->timer(
- after => 1, interval => 1, cb => sub { diag "Waiting for reply\n"; $timer_events++ }
-);
-
-my $client = LWP::UserAgent->new();
-
-my $server = Test::HTTP::LocalServer->spawn(
- #debug => 1,
-);
-my $url = $server->url;
-diag "Retrieving URL: " . $url;
-
-my $chunk_count = 0;
-my $res = $client->get("${url}error/notfound/foo", ":content_cb" => sub {
- $chunk_count++
-});
-ok !$res->is_success, "The request was not successfull, as planned";
-is $res->code, 404, "We caught the remote error (404)";
-is $res->content, '', "We got an empty response";
-is $chunk_count, 0, "We received no chunks either";
-
-undef $t; # stop the timer
-
-diag "Shutting down server";
-$server->stop;
-undef $server;
-diag "Done";
+#!perl -w
+use strict;
+use Test::More;
+
+use AnyEvent;
+use LWP::Protocol::AnyEvent::http;
+use LWP::UserAgent;
+
+# Check whether we can launch the local webserver
+if (! eval {
+ use lib '../inc', 'inc';
+ require Test::HTTP::LocalServer;
+ 1;
+}) {
+ plan skip_all => "Couldn't launch test server: $@";
+} else {
+ plan tests => 4;
+};
+
+# Launch a timer
+my $timer_events = 0;
+my $t = AnyEvent->timer(
+ after => 1, interval => 1, cb => sub { diag "Waiting for reply\n"; $timer_events++ }
+);
+
+my $client = LWP::UserAgent->new();
+
+my $server = Test::HTTP::LocalServer->spawn(
+ #debug => 1,
+);
+my $url = $server->url;
+diag "Retrieving URL: " . $url;
+
+my $chunk_count = 0;
+my $res = $client->get("${url}error/notfound/foo", ":content_cb" => sub {
+ $chunk_count++
+});
+ok !$res->is_success, "The request was not successfull, as planned";
+is $res->code, 404, "We caught the remote error (404)";
+is $res->content, '', "We got an empty response";
+is $chunk_count, 0, "We received no chunks either";
+
+undef $t; # stop the timer
+
+diag "Shutting down server";
+$server->stop;
+undef $server;
+diag "Done";
View
58 t/05_error_500_bogus_host.t
@@ -1,29 +1,29 @@
-#!perl -w
-use strict;
-use Test::More;
-
-use LWP::Protocol::AnyEvent::http;
-use LWP::UserAgent;
-
-# Check whether we can launch the local webserver
-if (! eval {
- use lib '../inc', 'inc';
- require Test::HTTP::LocalServer;
- 1;
-}) {
- plan skip_all => "Couldn't launch test server: $@";
-} else {
- plan tests => 4;
-};
-
-my $client = LWP::UserAgent->new();
-
-my $url = 'http://doesnotexist.example';
-diag "Retrieving URL: " . $url;
-
-my $chunk_count = 0;
-my $res = $client->get("${url}", ":content_cb" => sub { ++$chunk_count });
-ok !$res->is_success, "The request was not successfull, as planned";
-like $res->code, qr/^5\d\d/, "We caught the remote error (5xx)";
-is $res->content, '', "We got an empty response";
-is $chunk_count, 0, "We received no chunks either";
+#!perl -w
+use strict;
+use Test::More;
+
+use LWP::Protocol::AnyEvent::http;
+use LWP::UserAgent;
+
+# Check whether we can launch the local webserver
+if (! eval {
+ use lib '../inc', 'inc';
+ require Test::HTTP::LocalServer;
+ 1;
+}) {
+ plan skip_all => "Couldn't launch test server: $@";
+} else {
+ plan tests => 4;
+};
+
+my $client = LWP::UserAgent->new();
+
+my $url = 'http://doesnotexist.example';
+diag "Retrieving URL: " . $url;
+
+my $chunk_count = 0;
+my $res = $client->get("${url}", ":content_cb" => sub { ++$chunk_count });
+ok !$res->is_success, "The request was not successfull, as planned";
+like $res->code, qr/^5\d\d/, "We caught the remote error (5xx)";
+is $res->content, '', "We got an empty response";
+is $chunk_count, 0, "We received no chunks either";
Please sign in to comment.
Something went wrong with that request. Please try again.