sessionmanager: Make session.send() return true unless there really is an error

Mon, 21 Sep 2015 23:19:48 +0200

author
Kim Alvefur <zash@zash.se>
date
Mon, 21 Sep 2015 23:19:48 +0200
changeset 6842
eed846384178
parent 6841
be87ab2d611c
child 6843
161cccfdf015
child 6844
8946052e12d2

sessionmanager: Make session.send() return true unless there really is an error

core/sessionmanager.lua file | annotate | diff | comparison | revisions
--- a/core/sessionmanager.lua	Mon Sep 21 23:06:22 2015 +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("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]+$");

mercurial