Permalink
Browse files

Merge pull request #8 from gerdr/patch-1

Cleanup and necessary change after rakudo/rakudo@a98aa70
  • Loading branch information...
2 parents d347fdc + f855e6b commit e15c98f95d2d7162ec416c5273e4be7554854bf2 @supernovus committed Mar 14, 2013
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/HTTP/Easy.pm6
View
@@ -35,7 +35,8 @@ method connect (:$port=$.port, :$host=$.host)
$!listener = IO::Socket::INET.new(
:localhost($host),
:localport($port),
- :listen(1)
+ :listen(1),
+ :input-line-separator("\r\n")
);
}
@@ -53,12 +54,18 @@ method run
if $.debug { message("Client connection received."); }
self.on-connection;
my $request = $!connection.get;
+ unless defined $request
+ {
+ if $.debug { message("Client connection lost."); }
+ $!connection.close;
+ next;
+ }
message($request);
my @headers;
my $in-headers = True;
while $in-headers
{
- my $line = $!connection.get.chomp;
+ my $line = $!connection.get;
if ! $line { $in-headers = False; }
if $.debug { $*ERR.say: " $line"; }
@headers.push($line);

0 comments on commit e15c98f

Please sign in to comment.