verse: Only fire the disconnected event if the stream and the connection are still associated (fixes smacks issue)

Sun, 10 Feb 2013 03:29:04 +0100

author
Kim Alvefur <zash@zash.se>
date
Sun, 10 Feb 2013 03:29:04 +0100
changeset 325
843fabce2fc7
parent 324
dbb3362c1ff3
child 326
f657ed8f464e

verse: Only fire the disconnected event if the stream and the connection are still associated (fixes smacks issue)

init.lua file | annotate | diff | comparison | revisions
--- a/init.lua	Sun Feb 10 02:54:01 2013 +0100
+++ b/init.lua	Sun Feb 10 03:29:04 2013 +0100
@@ -229,6 +229,7 @@
 	end
 	
 	function conn_listener.ondisconnect(conn, err)
+		if conn.conn ~= stream.conn then return end
 		stream.connected = false;
 		stream:event("disconnected", { reason = err });
 	end

mercurial