Software /
code /
prosody
Comparison
plugins/mod_c2s.lua @ 7221:56e65b1e54e8
mod_c2s: Remove connection object from session object when connection disconnected to prevent accidental use (see #590)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 02 Mar 2016 16:28:11 +0100 |
parent | 7100:301d58705667 |
child | 7224:07a4c807a94a |
child | 7328:de76ded98b84 |
comparison
equal
deleted
inserted
replaced
7200:67ac4a0b6e50 | 7221:56e65b1e54e8 |
---|---|
256 function listener.ondisconnect(conn, err) | 256 function listener.ondisconnect(conn, err) |
257 local session = sessions[conn]; | 257 local session = sessions[conn]; |
258 if session then | 258 if session then |
259 (session.log or log)("info", "Client disconnected: %s", err or "connection closed"); | 259 (session.log or log)("info", "Client disconnected: %s", err or "connection closed"); |
260 sm_destroy_session(session, err); | 260 sm_destroy_session(session, err); |
261 session.conn = nil; | |
261 sessions[conn] = nil; | 262 sessions[conn] = nil; |
262 end | 263 end |
263 end | 264 end |
264 | 265 |
265 function listener.associate_session(conn, session) | 266 function listener.associate_session(conn, session) |