Browse Source

Changed exception error message

pull/58/head
Sheng 6 years ago
parent
commit
b25fbd7b57
  1. 2
      tests/test_app.py
  2. 2
      webssh/handler.py
  3. 3
      webssh/settings.py

2
tests/test_app.py

@ -653,7 +653,7 @@ class TestAppWithTooManyConnections(OtherTestBase):
url = self.get_url('/')
response = yield self.async_post(url, self.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()
response = yield self.async_post(url, self.body)

2
webssh/handler.py

@ -368,7 +368,7 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
self.src_addr = self.get_client_addr()
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()

3
webssh/settings.py

@ -41,7 +41,8 @@ define('origin', default='same', help='''Origin policy,
separated by comma;
'*': wildcard policy, matches any domain, allowed in debug mode only.''')
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',
callback=print_version)

Loading…
Cancel
Save