Commit Graph

35 Commits

Author SHA1 Message Date
Stein Magnus Jodal
95577206a0 Require tornado >= 4.4 2018-03-29 20:51:01 +02:00
Stein Magnus Jodal
bbeb5c03aa Require Tornado >= 3.2
Survey of version available in the oldest distros we care about:

- Debian 8, squeeze: 3.2.2
- Debian 8, squeeze-backports: 4.2.0
- Ubuntu 16.04 LTS: 4.2.1
- Arch Linux: 4.4.2
2016-10-26 00:39:42 +02:00
Stein Magnus Jodal
d8bcd7f273 Rename mopidy.utils to mopidy.internal 2015-05-07 23:15:56 +02:00
Stein Magnus Jodal
97c336200b Merge branch 'v1.0.x' into develop 2015-04-28 00:02:26 +02:00
Thomas Adamcik
83e54b090b http: Finally fix the old tornado broadcast bug. 2015-04-27 22:52:12 +02:00
Stein Magnus Jodal
6a97ffa012 Merge branch 'v1.0.x' into develop
Conflicts:
	docs/changelog.rst
2015-04-26 23:50:50 +02:00
Thomas Adamcik
a72c9c88c9 http: Handle getting correct IOLoop when running on tornado < 3.0 2015-04-24 23:53:13 +02:00
Stein Magnus Jodal
41eabbfd22 Merge branch 'v1.0.x' into develop 2015-04-22 22:50:09 +02:00
Thomas Adamcik
d545fd198e http: Fix threading issue causing duplicate WS messages
The problem presents itself when a JSON-RPC call triggers some event in core.
When this happens we have a thread outside of Tornado call `write_message`
interleaved with a potentially ongoing write if the JSON-RPC response.

To avoid this we now follow Tornado best practices and add callbacks to the
IOLoop to ensure that there isn't any interleaved access of Tornado state.
2015-04-14 21:55:26 +02:00
Stein Magnus Jodal
c4940cbea2 autopep8: Add space after class signature/docstring 2015-04-03 00:05:26 +02:00
Thomas Adamcik
6c5970ffc3 http: Make sure to decode exceptions for logging 2015-03-02 00:06:02 +01:00
Thomas Adamcik
4ee7dd73bd http: Make WS broadcast more robust against disconnect race
Adds some WebSocketHandler tests that actually connect using a WS client and
plugs a potential race condition.

Any call to write_message could fail, either due to WebSocketClosedError like
in the log below, or simply due to socket errors. To play it safe we catch all
errors and debug log that a broadcast failed.

2015-02-26 21:24:02,266 ERROR    [HttpServer] /home/adamcik/dev/mopidy/mopidy/http/handlers.py:116
  mopidy.http.handlers WebSocket request error: deque index out of range
2015-02-26 21:24:10,098 ERROR    [HttpFrontend-11] build/bdist.linux-x86_64/egg/pykka/actor.py:268
  pykka Unhandled exception in HttpFrontend (urn:uuid:e376bd95-c32e-4e17-ad20-7d0b3c0cf2b2):
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/pykka/actor.py", line 200, in _actor_loop
    response = self._handle_receive(message)
  File "build/bdist.linux-x86_64/egg/pykka/actor.py", line 294, in _handle_receive
    return callee(*message['args'], **message['kwargs'])
  File ".../dev/mopidy/mopidy/http/actor.py", line 77, in on_event
    on_event(name, **data)
  File ".../dev/mopidy/mopidy/http/actor.py", line 84, in on_event
    handlers.WebSocketHandler.broadcast(message)
  File ".../dev/mopidy/mopidy/http/handlers.py", line 78, in broadcast
    client.write_message(msg)
  File ".../dev/mopidy-virtualenv/local/lib/python2.7/site-packages/tornado/websocket.py", line 183, in write_message
    raise WebSocketClosedError()
WebSocketClosedError
2015-03-02 00:05:21 +01:00
Stein Magnus Jodal
42115c56f7 core: Add mixer controller (fixes: #962)
Deprecate volume and mute methods on playback controller.
2015-02-12 10:31:16 +01:00
Stein Magnus Jodal
496142c201 py3: Use absolute imports by default 2014-12-07 20:17:10 +01:00
Stein Magnus Jodal
542cd3a3bb http: Add history controller to JSON-RPC API 2014-09-23 19:02:58 +02:00
Stein Magnus Jodal
83e779eaaf http: Guard against double close of WebSocket 2014-08-30 00:25:43 +02:00
Stein Magnus Jodal
6ed8132f76 http: Allow WebSocket requests from other hosts
This makes Tornado 4.0 behavior consistent with previous Tornado versions.

Fixes #788
2014-07-25 10:52:39 +02:00
Stein Magnus Jodal
ae49c4d113 http: Add missing string interpolation placeholder 2014-07-23 17:35:55 +02:00
Stein Magnus Jodal
f55f3d75c1 http: Fix path to socket object 2014-07-22 14:01:22 +02:00
Stein Magnus Jodal
0c10199632 http: Only require Tornado >= 2.3 2014-07-22 13:43:42 +02:00
Stein Magnus Jodal
6e226326fd http: Explicitly define template path for this router
Fixes #774
2014-07-12 00:05:55 +02:00
Stein Magnus Jodal
dba6e9b817 http: Fix missing placeholder in log statement
Related to martijnboland/moped#5
2014-06-24 12:46:41 +02:00
Stein Magnus Jodal
5861071bb1 http: List installed web clients at /mopidy/ 2014-06-22 00:39:54 +02:00
Stein Magnus Jodal
3fb225233a http: Extract helper for setting common response headers 2014-06-22 00:29:01 +02:00
Stein Magnus Jodal
59760bb36c web: Remove WebSocket demo page 2014-06-21 23:27:35 +02:00
Stein Magnus Jodal
fbcc73004d http: Redirect from /app to /app/ 2014-06-21 16:36:16 +02:00
dz0ny
7c428ce8d2 Fix http router so it can handle /{ext_name} same as /{ext_name}/ 2014-06-21 15:05:13 +02:00
Stein Magnus Jodal
33228f2528 http: Simplify app registration 2014-06-04 21:32:19 +02:00
Stein Magnus Jodal
684a64405d http: Move MopidyHttpRouter into handlers module 2014-05-22 21:03:42 +02:00
Stein Magnus Jodal
4b383c1762 http: Move Mopidy request handlers to a MopidyHttpRouter 2014-05-20 23:49:22 +02:00
Stein Magnus Jodal
ea5a317b00 http: Avoid tornado import before extension is loaded, group all handlers 2014-05-20 22:36:15 +02:00
Stein Magnus Jodal
fabb357dc8 http: Formatting 2014-05-14 23:59:20 +02:00
dz0ny
031c7c8e93 Add: Tornado as required dependency
Fix: Remove draft76
Fix: Remove class attributes for ws handler
Revert: default to /ws/ for for mopidy.html
2014-05-12 16:16:08 +02:00
dz0ny
26833b4093 Fix: Import order for whole PR 2014-05-12 14:54:50 +02:00
dz0ny
f1d1a4713b Squashed commit of the following:
commit dbb7005aa866cdc337bde9c8169e9bf15e5c8042
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Sun May 11 22:12:58 2014 +0200

    Fix: Make PR mergable

commit 5bb27da72c4276a930bf33955e6583f6781d23f6
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Thu May 8 23:31:54 2014 +0200

    Add: helper method for extensin url

commit 8a348b26b65102084a606ff73384a478bb785cf1
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Thu May 8 00:35:50 2014 +0200

    Add: Refactor ws and rpc to handlers, reuse code

commit 677c809d2b39a6c982ab835368fdb8a3ad9d1a92
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Thu May 8 00:18:10 2014 +0200

    Fix: Return proper HTTP headers

commit fe5fea2fc2a0d28a39532d6d4cd2b21013d57d24
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Wed May 7 23:48:19 2014 +0200

    Add: RPC post handler
    Add: tests for http post handler

commit e77e60310853b368758b09b303a96a95ff1b9b93
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Sun May 4 22:15:04 2014 +0200

    Add: Documentation on how to extend http api

commit a3a14fb5d15f095e5bab23a590e0a8360a039f9a
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Sun May 4 19:48:34 2014 +0200

    Add: HTTP tests for default router and static handler

commit 0d9544256bcb8f048eaedb5cdd57b1de027d387b
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Sun May 4 15:44:32 2014 +0200

    Fix: Move StaticFileHandler to main http package

commit c83c9f661e658e4a843dc5c8c6ba5dc3f1ea9c1e
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Sun May 4 15:29:49 2014 +0200

    Add: default Router implementation

commit 258cb7210bdf13833884c04cfb7fb4fa704394a7
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Sun May 4 15:00:46 2014 +0200

    Add: Switch to registry for router registration

commit b7bfe7b814235b030d7ac30de90e2331e3d809d3
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Sat May 3 21:52:58 2014 +0200

    Fix: Private methods
    Fix: Point to mopidy.html instead main.html
    Fix: Less noise in console

commit 232abe3029e93f78ce25db0c1bd44743cc23ed2d
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Sat May 3 21:32:07 2014 +0200

    Fix: Start IOLoop in separate thread, so actor can stop it

commit d686892c2fa993cbedc99c8e8e7f9c961ac6f35a
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Sat May 3 19:30:49 2014 +0200

    Fix: Router load order
    Fix: JS helper library WSS default url
    Add: Handlers from extensions

commit a1b0f5673a6719f229df27feccb284324675e9d1
Author: dz0ny <dz0ny@ubuntu.si>
Date:   Sat May 3 14:53:30 2014 +0200

    Add: Switch to Tornado framework
2014-05-12 14:54:50 +02:00