moonbridge

changeset 226:f132dc5b5bb0

Bugfix in error handling regarding broken client connection
author jbe
date Sun Jul 12 18:59:51 2015 +0200 (2015-07-12)
parents 2ecaa4d8ee5c
children 280bd7c84b38
files moonbridge_http.lua
line diff
     1.1 --- a/moonbridge_http.lua	Tue Jun 23 20:00:20 2015 +0200
     1.2 +++ b/moonbridge_http.lua	Sun Jul 12 18:59:51 2015 +0200
     1.3 @@ -429,7 +429,8 @@
     1.4        -- functions to send data to the browser:
     1.5        local function send(...)
     1.6          local old_state = state; state = "faulty"
     1.7 -        if not socket:write_call(unblock, ...) then
     1.8 +        local success, errmsg = socket:write_call(unblock, ...)
     1.9 +        if not success then
    1.10            socket:reset()
    1.11            error("Could not send data to client: " .. errmsg)
    1.12          end
    1.13 @@ -437,7 +438,8 @@
    1.14        end
    1.15        local function send_flush(...)
    1.16          local old_state = state; state = "faulty"
    1.17 -        if not socket:flush_call(unblock, ...) then
    1.18 +        local success, errmsg = socket:flush_call(unblock, ...)
    1.19 +        if not success then
    1.20            socket:reset()
    1.21            error("Could not send data to client: " .. errmsg)
    1.22          end

Impressum / About Us