sessionmanager: Make session.send() return true unless there really is an error
authorKim Alvefur <zash@zash.se>
Mon, 21 Sep 2015 21:19:48 +0000 (23:19 +0200)
committerKim Alvefur <zash@zash.se>
Mon, 21 Sep 2015 21:19:48 +0000 (23:19 +0200)
core/sessionmanager.lua

index 616f38a8d891dee85edd85f12c787fcce97348f9..bc4d7cef230b47603a5694cb3384c646120ad6e6 100644 (file)
@@ -37,9 +37,15 @@ local function new_session(conn)
                if t then
                        t = filter("bytes/out", tostring(t));
                        if t then
-                               return w(conn, t);
+                               local ret, err = w(conn, t);
+                               if not ret then
+                                       session.log("error", "Write-error: %s", tostring(err));
+                                       return false;
+                               end
+                               return true;
                        end
                end
+               return true;
        end
        session.ip = conn:ip();
        local conn_name = "c2s"..tostring(session):match("[a-f0-9]+$");