Comparison

net/http/parser.lua @ 5477:50cbea68586f

net.http.parser: Remove accidentally-committed debugging
author Matthew Wild <mwild1@gmail.com>
date Mon, 15 Apr 2013 21:25:59 +0100
parent 5475:c2c9f07c5d6a
child 6386:f942cf2a9a03
comparison
equal deleted inserted replaced
5475:c2c9f07c5d6a 5477:50cbea68586f
131 if chunk_size == 0 and buf:find("\r\n\r\n", chunk_start-2, true) then 131 if chunk_size == 0 and buf:find("\r\n\r\n", chunk_start-2, true) then
132 state, chunk_size = nil, nil; 132 state, chunk_size = nil, nil;
133 buf = buf:gsub("^.-\r\n\r\n", ""); -- This ensure extensions and trailers are stripped 133 buf = buf:gsub("^.-\r\n\r\n", ""); -- This ensure extensions and trailers are stripped
134 success_cb(packet); 134 success_cb(packet);
135 elseif #buf - chunk_start + 2 >= chunk_size then -- we have a chunk 135 elseif #buf - chunk_start + 2 >= chunk_size then -- we have a chunk
136 print(chunk_start, chunk_size, ("%q"):format(buf))
137 packet.body = packet.body..buf:sub(chunk_start, chunk_start + (chunk_size-1)); 136 packet.body = packet.body..buf:sub(chunk_start, chunk_start + (chunk_size-1));
138 buf = buf:sub(chunk_start + chunk_size + 2); 137 buf = buf:sub(chunk_start + chunk_size + 2);
139 chunk_size, chunk_start = nil, nil; 138 chunk_size, chunk_start = nil, nil;
140 else -- Partial chunk remaining 139 else -- Partial chunk remaining
141 break; 140 break;