summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeddy <[email protected]>2013-09-01 11:51:36 +0800
committerTeddy <[email protected]>2013-09-01 11:51:36 +0800
commit99a1b057ead83443ceeb80d17581a041bf56d248 (patch)
treecc7fab9b640e80ff3ba7497c259827ee919e2a96
parent2f3d03524da427faf407903b5764ab745613313d (diff)
fixed a severe bug, close possible opened tunnel when a user is logging in
-rw-r--r--server/piztor/server.py5
1 files changed, 5 insertions, 0 deletions
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()