# HG changeset patch # User jbe # Date 1434733492 -7200 # Node ID fac4ea0c41203996f78c1ff1592c10cd9e18cc41 # Parent f7ed5b9233310913fcea1194d3f17f16ca88175a Fixed mistake with additional local state variable in HTTP module diff -r f7ed5b923331 -r fac4ea0c4120 moonbridge_http.lua --- a/moonbridge_http.lua Fri Jun 19 18:57:02 2015 +0200 +++ b/moonbridge_http.lua Fri Jun 19 19:04:52 2015 +0200 @@ -366,7 +366,7 @@ end -- functions to send data to the browser: local function send(...) - local old_state, state = state, "faulty" + local old_state = state; state = "faulty" if not socket:write_call(unblock, ...) then socket:reset() error("Could not send data to client: " .. errmsg) @@ -374,7 +374,7 @@ state = old_state end local function send_flush(...) - local old_state, state = state, "faulty" + local old_state = state; state = "faulty" if not socket:flush_call(unblock, ...) then socket:reset() error("Could not send data to client: " .. errmsg) @@ -409,7 +409,7 @@ -- function that writes out buffered chunks (without flushing the socket): function send_chunk() if chunk_bytes > 0 then - local old_state, state = state, "faulty" + local old_state = state; state = "faulty" send(string.format("%x\r\n", chunk_bytes)) for i = 1, #chunk_parts do send(chunk_parts[i]) @@ -732,7 +732,7 @@ then error("All HTTP headers have already been sent") end - local old_state, state = state, "faulty" + local old_state = state; state = "faulty" enable_drain() close_requested = true if old_state == "init" then @@ -744,7 +744,7 @@ -- method to send a HTTP response status (e.g. "200 OK"): function request:send_status(status) prepare() - local old_state, state = state, "faulty" + local old_state = state; state = "faulty" if old_state == "info_status_sent" then send_flush("\r\n") elseif old_state ~= "no_status_sent" then @@ -778,7 +778,7 @@ then error("All HTTP headers have already been sent") end - local old_state, state = state, "faulty" + local old_state = state; state = "faulty" local key_lower = string.lower(key) if key_lower == "content-length" then if old_state == "info_status_sent" then