Changed exception error message

pull/58/head
Sheng 6 years ago
parent 4b27da5f38
commit b25fbd7b57

@ -653,7 +653,7 @@ class TestAppWithTooManyConnections(OtherTestBase):
url = self.get_url('/') url = self.get_url('/')
response = yield self.async_post(url, self.body) response = yield self.async_post(url, self.body)
data = json.loads(to_str(response.body)) data = json.loads(to_str(response.body))
self.assertEqual('Too many connections.', data['status']) self.assertEqual('Too many live connections.', data['status'])
clients['127.0.0.1'].clear() clients['127.0.0.1'].clear()
response = yield self.async_post(url, self.body) response = yield self.async_post(url, self.body)

@ -368,7 +368,7 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
self.src_addr = self.get_client_addr() self.src_addr = self.get_client_addr()
if len(clients.get(self.src_addr[0], {})) >= options.maxconn: if len(clients.get(self.src_addr[0], {})) >= options.maxconn:
raise tornado.web.HTTPError(403, 'Too many connections.') raise tornado.web.HTTPError(403, 'Too many live connections.')
self.check_origin() self.check_origin()

@ -41,7 +41,8 @@ define('origin', default='same', help='''Origin policy,
separated by comma; separated by comma;
'*': wildcard policy, matches any domain, allowed in debug mode only.''') '*': wildcard policy, matches any domain, allowed in debug mode only.''')
define('wpintvl', type=int, default=0, help='Websocket ping interval') define('wpintvl', type=int, default=0, help='Websocket ping interval')
define('maxconn', type=int, default=20, help='Maximum connections per client') define('maxconn', type=int, default=20,
help='Maximum live connections (ssh sessions) per client')
define('version', type=bool, help='Show version information', define('version', type=bool, help='Show version information',
callback=print_version) callback=print_version)

Loading…
Cancel
Save