Mercurial > prosody-hg
comparison plugins/mod_c2s.lua @ 9910:7a703af90c9c
mod_c2s: Fire an event when outgoing buffers have been emptied
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 24 Mar 2019 18:30:51 +0100 |
| parents | 7fa273f8869e |
| children | 994cccebb597 |
comparison
equal
deleted
inserted
replaced
| 9909:3229be01a08a | 9910:7a703af90c9c |
|---|---|
| 330 if session then | 330 if session then |
| 331 return (hosts[session.host] or prosody).events.fire_event("c2s-read-timeout", { session = session }); | 331 return (hosts[session.host] or prosody).events.fire_event("c2s-read-timeout", { session = session }); |
| 332 end | 332 end |
| 333 end | 333 end |
| 334 | 334 |
| 335 function listener.ondrain(conn) | |
| 336 local session = sessions[conn]; | |
| 337 if session then | |
| 338 return (hosts[session.host] or prosody).events.fire_event("c2s-ondrain", { session = session }); | |
| 339 end | |
| 340 end | |
| 341 | |
| 335 local function keepalive(event) | 342 local function keepalive(event) |
| 336 local session = event.session; | 343 local session = event.session; |
| 337 if not session.notopen then | 344 if not session.notopen then |
| 338 return event.session.send(' '); | 345 return event.session.send(' '); |
| 339 end | 346 end |
