Software /
code /
prosody
Comparison
plugins/mod_s2s/mod_s2s.lua @ 6848:32327c80710b
mod_s2s: Account for connections that time out in connection count measure
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 25 Sep 2015 15:16:25 +0200 |
parent | 6846:7eb166fa1f26 |
child | 6861:39789f1669cb |
child | 6901:ccc452767ec6 |
comparison
equal
deleted
inserted
replaced
6846:7eb166fa1f26 | 6848:32327c80710b |
---|---|
609 session:open_stream(session.from_host, session.to_host); | 609 session:open_stream(session.from_host, session.to_host); |
610 end | 610 end |
611 end | 611 end |
612 end | 612 end |
613 | 613 |
614 function listener.ontimeout(conn) | |
615 -- Called instead of onconnect when the connection times out | |
616 measure_connections(1); | |
617 end | |
618 | |
614 function listener.ondisconnect(conn, err) | 619 function listener.ondisconnect(conn, err) |
615 measure_connections(-1); | 620 measure_connections(-1); |
616 local session = sessions[conn]; | 621 local session = sessions[conn]; |
617 if session then | 622 if session then |
618 sessions[conn] = nil; | 623 sessions[conn] = nil; |