moonbridge
changeset 169:a9433e394eb7
Fixes for last commit
author | jbe |
---|---|
date | Mon Jun 15 02:39:49 2015 +0200 (2015-06-15) |
parents | d4f5d6a7d401 |
children | 4d5cf5cacc68 |
files | moonbridge_http.lua |
line diff
1.1 --- a/moonbridge_http.lua Mon Jun 15 02:14:55 2015 +0200 1.2 +++ b/moonbridge_http.lua Mon Jun 15 02:39:49 2015 +0200 1.3 @@ -431,6 +431,7 @@ 1.4 error("Unexpected error while sending error response: " .. errmsg2) 1.5 end 1.6 elseif state ~= "faulty" then 1.7 + state = "faulty" 1.8 assert_close(socket:reset()) 1.9 end 1.10 if throw_error then 1.11 @@ -493,13 +494,13 @@ 1.12 end 1.13 if len == 0 then break end 1.14 read_body_bytes(len) 1.15 - local term = socket:read(2, "\n") 1.16 + local term = socket:read_yield(2, "\n") 1.17 if term ~= "\r\n" and term ~= "\n" then 1.18 request_error(true, "400 Bad Request", "Encoding error while reading chunk of request body") 1.19 end 1.20 end 1.21 while true do 1.22 - local line = socket:read(2 + remaining_body_size_limit, "\n") 1.23 + local line = socket:read_yield(2 + remaining_body_size_limit, "\n") 1.24 if line == "\r\n" or line == "\n" then break end 1.25 remaining_body_size_limit = remaining_body_size_limit - #line 1.26 if remaining_body_size_limit < 0 then