From 99a1b057ead83443ceeb80d17581a041bf56d248 Mon Sep 17 00:00:00 2001 From: Teddy Date: Sun, 1 Sep 2013 11:51:36 +0800 Subject: fixed a severe bug, close possible opened tunnel when a user is logging in --- server/piztor/server.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server') diff --git a/server/piztor/server.py b/server/piztor/server.py index 2b6acb0..38b74c9 100644 --- a/server/piztor/server.py +++ b/server/piztor/server.py @@ -319,6 +319,11 @@ class UserAuthHandler(RequestHandler): return self._failed_response() else: logger.info("Logged in sucessfully: {0}".format(username)) + pt = RequestHandler.push_tunnels + uid = uauth.uid + if pt.has_key(uid): # close the old push tunnel + pt[uid].close() + del pt[uid] uauth.regen_token() #logger.info("New token generated: " + get_hex(uauth.token)) self.session.commit() -- cgit v1.2.3-70-g09d2