sessionmanager: Make session.send() return true unless there really is an error [backported from 0.10]
authorKim Alvefur <zash@zash.se>
Mon, 21 Sep 2015 23:19:48 +0200
changeset 7498 caee8a32983a
parent 7462 94af49ad657e
child 7499 98c8d14be4ef
child 7578 3ae247af68f4
sessionmanager: Make session.send() return true unless there really is an error [backported from 0.10]
core/sessionmanager.lua
--- a/core/sessionmanager.lua	Wed Jun 22 22:22:29 2016 +0200
+++ b/core/sessionmanager.lua	Mon Sep 21 23:19:48 2015 +0200
@@ -37,9 +37,15 @@
 		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("debug", "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]+$");