Diff

plugins/mod_admin_telnet.lua @ 5278:f79be67e5666

mod_admin_telnet: Stop processing lines when session is closed
author Kim Alvefur <zash@zash.se>
date Fri, 28 Dec 2012 14:32:22 +0100
parent 5270:20e14961f630
child 5520:75230be5be58
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Fri Dec 28 14:26:21 2012 +0100
+++ b/plugins/mod_admin_telnet.lua	Fri Dec 28 14:32:22 2012 +0100
@@ -149,6 +149,7 @@
 	end
 
 	for line in data:gmatch("[^\n]*[\n\004]") do
+		if session.closed then return end
 		console:process_line(session, line);
 		session.send(string.char(0));
 	end
@@ -168,6 +169,7 @@
 
 function commands.bye(session)
 	session.print("See you! :)");
+	session.closed = true;
 	session.disconnect();
 end
 commands.quit, commands.exit = commands.bye, commands.bye;