Comparison

plugins/mod_s2s.lua @ 11227:d36e44d00ef8

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 11 Dec 2020 15:37:35 +0100
parent 11226:plugins/mod_s2s/mod_s2s.lua@b3ae48362f78
parent 11200:plugins/mod_s2s/mod_s2s.lua@bf8f2da84007
child 11238:ec84194356d4
comparison
equal deleted inserted replaced
11225:8c17c08d100e 11227:d36e44d00ef8
175 connect(service.new(to_host, "xmpp-server", "tcp", s2s_service_options), listener, nil, { session = host_session }); 175 connect(service.new(to_host, "xmpp-server", "tcp", s2s_service_options), listener, nil, { session = host_session });
176 return true; 176 return true;
177 end 177 end
178 178
179 local function keepalive(event) 179 local function keepalive(event)
180 return event.session.sends2s(' '); 180 local session = event.session;
181 if not session.notopen then
182 return event.session.send(' ');
183 end
181 end 184 end
182 185
183 module:hook("s2s-read-timeout", keepalive, -1); 186 module:hook("s2s-read-timeout", keepalive, -1);
184 187
185 function module.add_host(module) 188 function module.add_host(module)