Software /
code /
prosody
Comparison
plugins/mod_csi_simple.lua @ 10025:4498f601516d
mod_csi_simple: Disable optimizations on disconnect (fixes #1358)
The connection becomes invalid here, regardless of 3rd party modules
that might keep the session alive.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 26 May 2019 15:04:16 +0200 |
parent | 9923:e83dfcdeab59 |
child | 10277:45a58127a3e5 |
comparison
equal
deleted
inserted
replaced
10024:4a0d990253a0 | 10025:4498f601516d |
---|---|
106 module:hook("csi-client-active", function (event) | 106 module:hook("csi-client-active", function (event) |
107 local session = event.origin; | 107 local session = event.origin; |
108 disable_optimizations(session); | 108 disable_optimizations(session); |
109 end); | 109 end); |
110 | 110 |
111 module:hook("pre-resource-unbind", function (event) | |
112 local session = event.session; | |
113 disable_optimizations(session); | |
114 end); | |
111 | 115 |
112 module:hook("c2s-ondrain", function (event) | 116 module:hook("c2s-ondrain", function (event) |
113 local session = event.session; | 117 local session = event.session; |
114 if session.state == "inactive" and session.conn and session.conn and session.conn.pause_writes then | 118 if session.state == "inactive" and session.conn and session.conn and session.conn.pause_writes then |
115 session.conn:pause_writes(); | 119 session.conn:pause_writes(); |