Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f53969

Browse files
committed
Fixed Flash policy server startup error handling.
1 parent f81f129 commit 1f53969

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tornadio/server.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def __init__(self, application,
3939
flash_policy_file = settings.get('flash_policy_file', None)
4040
flash_policy_port = settings.get('flash_policy_port', None)
4141
socket_io_port = settings.get('socket_io_port', 8001)
42-
protocols = settings.get('enabled_protocols', dict())
4342

4443
HTTPServer.__init__(self,
4544
application,
@@ -53,14 +52,15 @@ def __init__(self, application,
5352

5453
self.listen(socket_io_port)
5554

56-
if (flash_policy_file is not None
57-
and flash_policy_port is not None
58-
and 'flashsocket' in protocols):
59-
logging.info('Starting Flash Policy Server on Port \'%s\'',
60-
flash_policy_port)
55+
if flash_policy_file is not None and flash_policy_port is not None:
56+
try:
57+
logging.info('Starting Flash policy server on port \'%d\'',
58+
flash_policy_port)
6159

62-
flash_policy = FlashPolicyServer(port=flash_policy_port,
63-
policy_file=flash_policy_file)
60+
flash_policy = FlashPolicyServer(port=flash_policy_port,
61+
policy_file=flash_policy_file)
62+
except Exception, ex:
63+
logging.error('Failed to start Flash policy server: %s', ex)
6464

6565
io_loop = io_loop or ioloop.IOLoop.instance()
6666
logging.info('Entering IOLoop...')

0 commit comments

Comments
 (0)