.BANCHO. .FIX. Don't time out tourney clients

This commit is contained in:
Nyo
2016-10-09 19:12:18 +02:00
parent e7b7dc932a
commit 90dfb2c705
6 changed files with 44 additions and 12 deletions

25
handlers/heavyHandler.py Normal file
View File

@@ -0,0 +1,25 @@
import tornado.gen
import tornado.web
from common.web import requestsManager
from objects import glob
import time
class handler(requestsManager.asyncRequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
def asyncGet(self):
if not glob.debug:
self.write("Nope")
return
time.sleep(0.5)
self.write("meemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeemmeem")
self.set_status(200)
self.add_header("cho-token", "tua madre")
self.add_header("cho-protocol", "19")
self.add_header("Connection", "keep-alive")
self.add_header("Keep-Alive", "timeout=5, max=100")
self.add_header("Content-Type", "text/html; charset=UTF-8")
#glob.db.fetchAll("SELECT SQL_NO_CACHE * FROM beatmaps")
#glob.db.fetchAll("SELECT SQL_NO_CACHE * FROM users")
#glob.db.fetchAll("SELECT SQL_NO_CACHE * FROM scores")
#self.write("ibmd")

View File

@@ -195,9 +195,6 @@ class handler(SentryMixin, requestsManager.asyncRequestHandler):
responseTokenString = userToken.token
responseData = userToken.queue
userToken.resetQueue()
# Update ping time for timeout
userToken.updatePingTime()
except exceptions.tokenNotFoundException:
# Token not found. Disconnect that user
responseData = serverPackets.loginError()
@@ -207,6 +204,9 @@ class handler(SentryMixin, requestsManager.asyncRequestHandler):
finally:
# Unlock token
if userToken is not None:
# Update ping time for timeout
userToken.updatePingTime()
# Release token lock
userToken.lock.release()
if glob.outputRequestTime: