# HG changeset patch # User jbe # Date 1436720391 -7200 # Node ID f132dc5b5bb01dffd0e9f102f06a6c231a9692da # Parent 2ecaa4d8ee5c2e1c8a66504cf9ec82206924bb28 Bugfix in error handling regarding broken client connection diff -r 2ecaa4d8ee5c -r f132dc5b5bb0 moonbridge_http.lua --- a/moonbridge_http.lua Tue Jun 23 20:00:20 2015 +0200 +++ b/moonbridge_http.lua Sun Jul 12 18:59:51 2015 +0200 @@ -429,7 +429,8 @@ -- functions to send data to the browser: local function send(...) local old_state = state; state = "faulty" - if not socket:write_call(unblock, ...) then + local success, errmsg = socket:write_call(unblock, ...) + if not success then socket:reset() error("Could not send data to client: " .. errmsg) end @@ -437,7 +438,8 @@ end local function send_flush(...) local old_state = state; state = "faulty" - if not socket:flush_call(unblock, ...) then + local success, errmsg = socket:flush_call(unblock, ...) + if not success then socket:reset() error("Could not send data to client: " .. errmsg) end