Permalink
Browse files

fix codetest failures - trailing spaces

  • Loading branch information...
mikehh committed Dec 13, 2010
1 parent 55c5515 commit 4e18c2770dd6ff630e7af0ed52c2829b11709f07
Showing with 13 additions and 13 deletions.
  1. +13 −13 runtime/parrot/library/LWP/Protocol.pir
@@ -299,12 +299,12 @@ see http://search.cpan.org/~gaas/libwww-perl/
.param pmc headers
.param pmc url
.param pmc proxy
-
- # FIXME:
+
+ # FIXME:
# There should be no Connection header, because in HTTP/1.1 all
# connections are keep-alive by default.
headers['Connection'] = "Keep-Alive"
-
+
# Extract 'Host' header
.local string host
host = url.'authority'()
@@ -424,14 +424,14 @@ see http://search.cpan.org/~gaas/libwww-perl/
.local int chunk_sum
.local int chunk_len_idx
- .local string data
+ .local string data
.local string chunk
.local string chunk_len_hex
.local string final_buffer
chunk_sum = 0
final_buffer = ''
-
+
$S0 = str
$I0 = index str, "\r\n\r\n"
if $I0 < 0 goto L1
@@ -448,27 +448,27 @@ see http://search.cpan.org/~gaas/libwww-perl/
data = $S0
Lchunki:
# Step 1) Get Chunk Length
- # Find first delimiter, then extract data in between.
+ # Find first delimiter, then extract data in between.
chunk_len_idx = index data, "\r\n"
chunk_len_hex = substr data, 0, chunk_len_idx
-
+
# Box chunk_len_hex, and convert to integer (hex digits so radix 16).
$P0 = box chunk_len_hex
chunk_len = $P0.'to_int'(16)
-
+
# Step 1a) If length is 0, return (L22 cleans up and returns)
if chunk_len == 0 goto L22
-
+
# Step 1b) Chunk-Sum (you heard right, Chunk-Sum)
chunk_sum += chunk_len
-
+
# Step 2) Extract chunk into final_buffer
$I1 = chunk_len_idx + 2
chunk = substr data, $I1, chunk_len
final_buffer = final_buffer . chunk
# Update $S0 for final result (L3 sets $S0 as .content)
$S0 = final_buffer
-
+
# Increment data pointer, then Rinse and Repeat
# We must increment chunk_len by len(chunk_len_hex) + 4
# to skip over current chunk information and its delimiters,
@@ -478,10 +478,10 @@ see http://search.cpan.org/~gaas/libwww-perl/
data = substr data, chunk_len
goto Lchunki
L22:
- # Chunk-Sum Sanity check
+ # Chunk-Sum Sanity check
$I0 = length $S0
if $I0 == chunk_sum goto L3
- say "Something has gone terribly wrong..."
+ say "Something has gone terribly wrong..."
L3:
$P0 = box $S0
setattribute response, 'content', $P0

0 comments on commit 4e18c27

Please sign in to comment.