summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-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()