Software /
code /
verse
Comparison
init.lua @ 325:843fabce2fc7
verse: Only fire the disconnected event if the stream and the connection are still associated (fixes smacks issue)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 10 Feb 2013 03:29:04 +0100 |
parent | 322:819b35b8fcf6 |
child | 327:963d156a4b36 |
comparison
equal
deleted
inserted
replaced
324:dbb3362c1ff3 | 325:843fabce2fc7 |
---|---|
227 function conn_listener.onincoming(conn, data) | 227 function conn_listener.onincoming(conn, data) |
228 stream:event("incoming-raw", data); | 228 stream:event("incoming-raw", data); |
229 end | 229 end |
230 | 230 |
231 function conn_listener.ondisconnect(conn, err) | 231 function conn_listener.ondisconnect(conn, err) |
232 if conn.conn ~= stream.conn then return end | |
232 stream.connected = false; | 233 stream.connected = false; |
233 stream:event("disconnected", { reason = err }); | 234 stream:event("disconnected", { reason = err }); |
234 end | 235 end |
235 | 236 |
236 function conn_listener.ondrain(conn) | 237 function conn_listener.ondrain(conn) |