Software /
code /
prosody
Comparison
core/sessionmanager.lua @ 7495:caee8a32983a
sessionmanager: Make session.send() return true unless there really is an error [backported from 0.10]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 21 Sep 2015 23:19:48 +0200 |
parent | 6599:f93e1b2ec327 |
child | 7496:98c8d14be4ef |
comparison
equal
deleted
inserted
replaced
7459:94af49ad657e | 7495:caee8a32983a |
---|---|
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("debug", "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 |