Commit Graph

94 Commits

Author SHA1 Message Date
Stein Magnus Jodal
a4f38e2018 zeroconf: Make stype argument required 2015-09-15 11:25:54 +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
5b614e95d6 Update to Mopidy.js 0.5.0 2015-01-31 22:15:40 +01:00
Thomas Adamcik
9a2f8a3e4f http: Log errors instead of dying for HTTP startup. 2014-12-20 21:32:08 +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
4c6c7ce016 http: Update Mopidy.js to v0.4.1 2014-09-11 21:50:11 +02:00
Stein Magnus Jodal
83e779eaaf http: Guard against double close of WebSocket 2014-08-30 00:25:43 +02:00
dz0ny
711caa9417 avahi: Service hostname must contain, resolvable fqdn with .local appended to it. 2014-07-26 14:54:21 +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
1ebe1151fc http: Make event emitting testable 2014-07-17 01:14:06 +02:00
Stein Magnus Jodal
3fac0cb8de http: Split socket and server creation 2014-07-17 01:13:48 +02:00
Stein Magnus Jodal
215dd777f6 http: Move Mopidy request handlers to helper method 2014-07-17 00:58:10 +02:00
Stein Magnus Jodal
2cf37679a6 Merge branch 'develop' into feature/http-startup
Conflicts:
	mopidy/http/actor.py
2014-07-17 00:27:50 +02:00
Stein Magnus Jodal
ece59f5deb http: Simplify Zeroconf publishing 2014-07-17 00:21:59 +02:00
Stein Magnus Jodal
e9243357ae http: Format "server running" log msg like MPD
By removing the http://... URL in the log output, we hopefully remove the
dubious connection between hostname/port configuration and the URL you'll
actually use to browse the Mopidy web server.

Example log output with this change:

    ...
    INFO     Starting Mopidy frontends: HttpFrontend, MpdFrontend
    INFO     HTTP server running at [::ffff:127.0.0.1]:6680
    INFO     MPD server running at [::ffff:127.0.0.1]:6600
2014-07-16 22:36:03 +02:00
Stein Magnus Jodal
f9755b562c http: Raise FrontendError if socket creation fails
This removes the stacktraces when two Mopidy instances are started with the
same hostname/port configuration.
2014-07-16 22:36:03 +02:00
Stein Magnus Jodal
2177550649 http: Prettify HTTP router list in debug log 2014-07-15 01:42:37 +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
8041f921ad http: Style tweaks 2014-07-01 23:22:52 +02:00
Stein Magnus Jodal
b3bd10017a Merge branch 'ZenithDK/fix/check_static_dir' into develop 2014-07-01 23:20:41 +02:00
Lasse Bigum
cca029eb67 Check configured static_dir and fall back to default if non-existing
Signed-off-by: Lasse Bigum <lasse@bigum.org>
2014-06-28 00:51:51 +02:00
Lasse Bigum
20de648f18 Tornado redefines '::' to IPv6 only, so set '::' to None to get expected behaviour
Signed-off-by: Lasse Bigum <lasse@bigum.org>
2014-06-28 00:44:18 +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
24f9a2ac3b js: Release v0.4.0 2014-06-24 00:44:47 +02:00
Stein Magnus Jodal
aed8670797 http: Fix flake8 warnings 2014-06-22 09:53:03 +02:00
Stein Magnus Jodal
9f925570d2 http: Redirect from root to /mopidy/ if no static_dir app 2014-06-22 01:24:57 +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
0e2b396be4 web: Strip down CSS 2014-06-21 23:34:45 +02:00
Stein Magnus Jodal
97efcdc019 web: Remove focus on 'HTTP frontend' 2014-06-21 23:30:13 +02:00
Stein Magnus Jodal
005cb028e7 web: Use font similar to mopidy.com 2014-06-21 23:30:00 +02:00
Stein Magnus Jodal
603da5673e web: Make pages fill mobile viewports 2014-06-21 23:27:42 +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
Stein Magnus Jodal
49644dfd99 http: Use same string interpolation style as elsewhere 2014-06-21 15:13:44 +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