Skip to content
Browse files

Fixed race condition with on_open and session.close()

  • Loading branch information...
1 parent 04705be commit 9b9d4a4a5be12a08ab535bd932b4f3fcd17e6900 @mrjoes committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 tornadio2/session.py
View
8 tornadio2/session.py
@@ -107,10 +107,6 @@ def __init__(self, conn, server, request, expiry=None):
# If everything is fine - continue
self.send_message(proto.connect())
- result = self.conn.on_open(info)
- if result is not None and not result:
- raise HTTPError(401)
-
# Heartbeat related stuff
self._heartbeat_timer = None
self._heartbeat_interval = self.server.settings['heartbeat_interval'] * 1000
@@ -119,6 +115,10 @@ def __init__(self, conn, server, request, expiry=None):
# Endpoints
self.endpoints = dict()
+ result = self.conn.on_open(info)
+ if result is not None and not result:
+ raise HTTPError(401)
+
# Session callbacks
def on_delete(self, forced):
"""Session expiration callback

0 comments on commit 9b9d4a4

Please sign in to comment.
Something went wrong with that request. Please try again.