Permalink
Browse files

Fix chunked encoding

There might be stuff after the length in the chunk header
  • Loading branch information...
nwellnhof committed Jan 22, 2011
1 parent 2a4b6f9 commit 661b86eaa26c0372b8f2c909e48d308a42e5190b
Showing with 4 additions and 1 deletion.
  1. +4 −1 runtime/parrot/library/LWP/Protocol.pir
@@ -279,6 +279,7 @@ see http://search.cpan.org/~gaas/libwww-perl/
.namespace ['LWP';'Protocol';'http']
.include 'socket.pasm'
.include 'cclass.pasm'
.sub '' :init :load :anon
$P0 = subclass ['LWP';'Protocol'], ['LWP';'Protocol';'http']
@@ -510,7 +511,9 @@ see http://search.cpan.org/~gaas/libwww-perl/
L51:
.local int chunk_length
$S0 = sock.'readline'()
$S0 = chomp($S0)
$I1 = length $S0
$I0 = find_not_cclass .CCLASS_NUMERIC, $S0, 0, $I1
$S0 = substr $S0, 0, $I0
$P0 = box $S0
chunk_length = $P0.'to_int'(16)
if chunk_length == 0 goto L52

0 comments on commit 661b86e

Please sign in to comment.