Using worker threads instead of httpd threads means that we, not libevent,
decide which requests get handled by which threads. This means that we can
make sure blocking requests (e.g. volume changes) don't get in the way of
realtime(ish) stuff like mp3 streaming.
Includes refactor of httpd_stream_file() since it was a bit of a monster.
In path with an encoded '/' character, the parsing of the path into
parts was wrong.
E. g. an uri like
'/api/library/composers/Adam%20Gardner%2FDavid%20Schneider' would result
in the following parts:
- path_part[0] = "/api"
- path_part[1] = "library"
- path_part[2] = "composer"
- path_part[3] = "Adam Gardner"
- path_part[4] = "David Schneider"
Doing the decode after splitting the uri into parts fixes this and
results in:
- path_part[0] = "api"
- path_part[1] = "library"
- path_part[2] = "composer"
- path_part[3] = "Adam Gardner/David Schneider"
The tracks of a smart playlist might change between library rescans.
Allowing them to be cached based on the last rescan timestamp
("Last-Modified" header in the response) leads to potentially showing
incorrect track listing if a cached version is used. Thus the response
for playlist tracks should never be cached by the browser (this is
achieved with setting "Cache-Control" header to "no-store").
Setting Cache-Control to "no-cache" tells a client to always make a
request to check if the version in the client cache is still valid
(response code 403 not modified).
This change is preparation to use ffmpeg's resampling capabilities to keep local
audio in sync (by up/downsampling slightly). This requires that sample rates are
not fixed for a transcode profile.
Added benefit of this is that we don't need quite as many xcode profiles.
Adds utility functions to httpd.c for checking the request headers for
either an "If-None-Match" or an "If-Not-Modified-Since" headers. If the
header value is found and it matches the current value for the requested
resource, we return early with a http response code 403 (Not Modified).
If the request header value is not present or does not match we add the
current ETag/Last-Modified values to the response headers and process
the request normally.
Defaults to an index.html file instead of redirecting to admin.html. It
will not redirect to index.html, but instead serve the file (if exists)
directly. This allows nicer uris in the webinterface.
We will still redirect to admin.html if no index.html is found for
requests to http://ip:port/
Some clients aren't really capable of authenticating + some users probably
don't want to enter a password for the web interface. This option allows
clients on for instance the local network to connect without authentication.