Comparison

plugins/mod_c2s.lua @ 7540:e69df8093387

mod_c2s: Don't try to keep alive sessions where the stream is not (yet) open
author Kim Alvefur <zash@zash.se>
date Sun, 07 Aug 2016 20:51:34 +0200
parent 7539:366964dbddb1
child 7542:0f92dc8e8b88
child 7662:946871f6e3c8
comparison
equal deleted inserted replaced
7539:366964dbddb1 7540:e69df8093387
292 return (hosts[session.host] or prosody).events.fire_event("c2s-read-timeout", { session = session }); 292 return (hosts[session.host] or prosody).events.fire_event("c2s-read-timeout", { session = session });
293 end 293 end
294 end 294 end
295 295
296 local function keepalive(event) 296 local function keepalive(event)
297 return event.session.send(' '); 297 local session = event.session;
298 if not session.notopen then
299 return event.session.send(' ');
300 end
298 end 301 end
299 302
300 function listener.associate_session(conn, session) 303 function listener.associate_session(conn, session)
301 sessions[conn] = session; 304 sessions[conn] = session;
302 end 305 end