Changeset

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
parents 5277:8585f3cc4976
children 5279:e8f7962056f5
files plugins/mod_admin_telnet.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
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;