Skip to content

Commit

Permalink
Merge pull request #8 from gerdr/patch-1
Browse files Browse the repository at this point in the history
Cleanup and necessary change after rakudo/rakudo@a98aa70
  • Loading branch information
supernovus committed Mar 14, 2013
2 parents d347fdc + f855e6b commit e15c98f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/HTTP/Easy.pm6
Expand Up @@ -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")
);
}

Expand All @@ -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);
Expand Down

0 comments on commit e15c98f

Please sign in to comment.