Changeset

14:1e927484c6ec

clix: Close connection after fatal error during login
author Matthew Wild <mwild1@gmail.com>
date Thu, 07 Jan 2010 02:36:34 +0000
parents 13:751db005032e
children 15:54314164a2a3
files clix.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/clix.lua	Thu Jan 07 02:35:04 2010 +0000
+++ b/clix.lua	Thu Jan 07 02:36:34 2010 +0000
@@ -65,10 +65,12 @@
 	conn.log.debug = opts.verbose;
 	conn:hook("authentication-failure", function (err)
 		conn:error("Authentication failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or ""));
+		conn:close();
 	end);
 	conn:hook("binding-success", function () conn:debug("Connected: "..tostring(conn)); return on_connect(conn); end);
 	conn:hook("binding-failure", function (err)
 		conn:error("Resource binding failure ("..(err.condition or "unknown error")..")"..(err.text and (": "..err.text) or ""));
+		conn:close();
 	end);
 	conn:hook("disconnected", function (info)
 		if info.reason then