Comparison

core/sessionmanager.lua @ 6842:eed846384178

sessionmanager: Make session.send() return true unless there really is an error
author Kim Alvefur <zash@zash.se>
date Mon, 21 Sep 2015 23:19:48 +0200
parent 6779:6236668da30a
child 6915:9d74373d621e
comparison
equal deleted inserted replaced
6841:be87ab2d611c 6842:eed846384178
35 t = filter("stanzas/out", t); 35 t = filter("stanzas/out", t);
36 end 36 end
37 if t then 37 if t then
38 t = filter("bytes/out", tostring(t)); 38 t = filter("bytes/out", tostring(t));
39 if t then 39 if t then
40 return w(conn, t); 40 local ret, err = w(conn, t);
41 end 41 if not ret then
42 end 42 session.log("error", "Write-error: %s", tostring(err));
43 return false;
44 end
45 return true;
46 end
47 end
48 return true;
43 end 49 end
44 session.ip = conn:ip(); 50 session.ip = conn:ip();
45 local conn_name = "c2s"..tostring(session):match("[a-f0-9]+$"); 51 local conn_name = "c2s"..tostring(session):match("[a-f0-9]+$");
46 session.log = logger.init(conn_name); 52 session.log = logger.init(conn_name);
47 53