Commit Graph

49 Commits

Author SHA1 Message Date
ejurgensen
dbc798da4f [-] Workaround for mxml 2.10 memleak
2.10's mxmlDelete memleaks, and mxml is used in many parts of forked-daapd. So
to avoid that we ship upstream's fixed version of mxmlDelete and use that.
2020-04-04 21:07:16 +02:00
ejurgensen
4f5966c9ff [db] Speed up Q_PL query used by e.g. '/databases/1/containers' request
The previous solution would use subqueries to count the number of items and
streams in each playlist, which means that response time gets pretty slow if
there are many playlists.

This commit also includes a number of lesser db code changes.
2019-05-30 21:19:40 +02:00
ejurgensen
3ba92aa860 [httpd] Better logging of unauthorized requests 2018-09-07 17:01:32 +02:00
ejurgensen
fde0a28142 Support for skip_count and time_skipped file metadata 2018-08-18 22:56:27 +02:00
ejurgensen
ea6fd1476a [db] Improve speed of browse queries (issue #478)
Before, we returned either unordered (for RSP, meaning client had to
sort) or ordered by a client selected sort_clause[]. The latter are
multi-purpose and therefore not optimised for browse queries.

To speed up, we predefine the entire set of browse queries, including
order, with matching indices. The predefined queries are used except
if the client explicitly requests a non-default order or query.

As a special bonus, the commit also allows queries with I_SUB that
have an offset but no limit.
2018-03-02 21:11:31 +01:00
ejurgensen
a6fab4ac0d [httpd/mpd] Adjustments to commit #69ff42f 2017-11-15 23:13:20 +01:00
ejurgensen
3d5aeda7aa [httpd] Implement "trusted_networks" option
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.
2017-11-12 21:29:57 +01:00
ejurgensen
473a29ef8a [httpd] More refactoring, reduce code duplication in the httpd_xxx modules 2017-11-11 22:20:09 +01:00
ejurgensen
709d99d4c4 [httpd] Major refactor of the httpd request handling
Make it easier to add new parameters later, get rid of redundant code, clean
up, align between httpd_xxx modules and introduce new bugs. Yes, the refactor
got a bit out of hand.
2017-11-11 22:20:09 +01:00
ejurgensen
eff9e6ebeb [httpd] Add promiscuous mode option, i.e. no auth requirements
For people who want to avoid the web login, or want to get around pairing
problems. This is also added because commit #e59a1a1 means that all
Remotes are now subject to auth, not just those with a user-agent name that
starts with "Remote".
2017-11-11 22:20:09 +01:00
ejurgensen
c44f4310b7 [httpd] Replace evhttp_send_error with the httpd_send_error wrapper 2016-10-18 22:45:22 +02:00
ejurgensen
40c49f1fde [httpd] Use httpd_send_reply() wrapper in httpd_*, dmap_common and mpd 2016-10-17 22:25:31 +02:00
ejurgensen
249d923af2 [httpd] Allow caller of httpd_send_reply to avoid gzipping 2016-10-17 14:18:13 +02:00
chme
c1dcc0a937 [db] Make loading of playlistitem count optional 2016-02-21 18:05:11 +01:00
ejurgensen
55104015e0 Full removal of libevent 1 legacy code. Also drop pipe() in FreeBSD, since pipe2 is available now. 2015-10-19 21:15:29 +02:00
ejurgensen
cf091e8d8b Adjust daapcache so it serves User-Agent to httpd_daap's reply handlers 2014-08-23 00:02:01 +02:00
ejurgensen
5b4ef31758 Migrate all evhttp to non-deprecated libevent2
- well except a troublemaker in httpd_daap.c (req->flags &= ~EVHTTP_PROXY_REQUEST)
2014-05-29 23:22:00 +02:00
ejurgensen
687f349927 Let configure check libevent version and include according to version 2014-03-13 23:33:35 +01:00
Julien BLACHE
cc0555d986 Replace AVL tree in RSP query by a static hash using gperf 2011-04-02 09:52:19 +02:00
Julien BLACHE
b1e57f8f6a Factor out common code in RSP 2010-09-10 18:47:43 +02:00
Julien BLACHE
535d691a4a Fix full_uri memory leak in error path 2010-09-10 18:47:42 +02:00
Julien BLACHE
8e31fd6672 Kill extra semi-colon 2010-06-21 19:19:13 +02:00
Julien BLACHE
548cd2a150 Use httpd_send_reply() instead of evhttp_send_reply() where pertinent
gzip replies where useful; artwork should not be compressed, as PNGs are
already compressed and that would be a waste of time.
2010-05-03 19:11:55 +02:00
Julien BLACHE
dc95a04562 Add optional sorting clause to Q_ITEMS 2010-05-02 11:44:43 +02:00
Julien BLACHE
b7ec65963d Constify data tables where possible 2010-03-25 21:40:17 +01:00
Julien BLACHE
19b6780a3c Remove provisions for multi-library support
It is now clear that multi-library support will not happen, so remove whatever
provisions were in the code for that.

It comes with a small change to the configuration file, too.

With this, DB schema version went to 9.
2010-03-19 19:09:18 +01:00
Julien BLACHE
641e5462cc Rename pl_id member of struct query_params 2010-03-07 15:23:40 +01:00
Julien BLACHE
58faeaceca Integer types cleanup
Try to be a bit more strict about integer types, use off_t or int64_t for
file size and file offsets.

Replace safe_ato*() by safe_atoi32() and safe_atoi64(), fix integer types
at call sites to match.
2010-02-02 21:09:56 +01:00
Julien BLACHE
974a74a833 Update copyright notices for 2010 2010-01-05 19:34:00 +01:00
Julien BLACHE
e1c0b6d4b7 Move *_offsetof() macro definitions to db.h 2009-06-11 23:17:17 +02:00
Julien BLACHE
3b7ff30c1b Remove useless force_update field in media file info 2009-06-11 19:15:22 +02:00
Julien BLACHE
c589d92b14 Use db_get_count() wherever applicable; simplify db_{pl,files}_get_count() prototypes 2009-06-11 18:41:50 +02:00
Julien BLACHE
a200703393 Switch to the new database code 2009-06-10 19:04:18 +02:00
Julien BLACHE
52d3fd1064 Clear evkeyvalq structs before use; fix crasher 2009-06-07 19:06:59 +02:00
Julien BLACHE
64cd2ee383 Factor out RSP query parameters handling 2009-06-07 19:06:59 +02:00
Julien BLACHE
91e34a77c8 Use the new ANTLR parser for RSP queries 2009-06-07 19:06:58 +02:00
Julien BLACHE
f9d9964914 Add new ANTLR parser for RSP queries
This parser actually supports way more than is needed for RSP proper,
as mt-daapd was piggybacking on the RSP queries for its smart playlists.

As I don't have (yet?) the RSP specs, better safe than sorry here. This
will be revisited at some point. Or not.
2009-06-07 19:06:51 +02:00
Julien BLACHE
272d8bca04 Fix error message 2009-06-07 19:06:51 +02:00
Julien BLACHE
68c74e6a88 Replace the mxml RSP root element hack by a better one
There's no proper way to add attributes to the root XML element in mxml;
the best way to do that is to create the root element like we would
create any other element and put the whole "? ... ?" stuff in there.
2009-06-07 19:06:51 +02:00
Julien BLACHE
977afbbc5e Add workaround for empty XML tags in RSP replies
The SoundBridge does not support empty XML tags (<foo/>) and treats anything
containing such tags as invalid. Adding an empty string to the element works
around that, in that mxml won't produce empty tags in this case.

Hackish, but dealing with a hackish implementation on the other side :)
2009-06-07 19:06:51 +02:00
Julien BLACHE
11fd038d16 Use new logger facility 2009-05-09 17:14:06 +02:00
Julien BLACHE
10bb9dec57 Remove useless daapd.h 2009-05-05 16:22:11 +02:00
Julien BLACHE
e4fe084619 Use embedded evhttp 2009-05-03 11:16:57 +02:00
Julien BLACHE
c9868175fd Implement URI encoding quirk for iTunes and Roku
iTunes and Roku devices do not encode + as %2B in the query string and
do not encode space as + either in the query string (though at least the
Roku encode space as %20 everywhere). This needs to be worked around or
browse queries fail to parse because + was decoded as space when the query
really needs a + character.
2009-05-03 11:16:57 +02:00
Julien BLACHE
09ef188d90 Add authentication to web interface, RSP and DAAP 2009-05-03 11:16:57 +02:00
Julien BLACHE
7a601d7daa Enable streaming of transcoded content 2009-05-03 11:16:57 +02:00
Julien BLACHE
0a1c4545dc Move safe_ato[il]() to misc.[ch] 2009-04-30 14:46:37 +02:00
Julien BLACHE
651d946cc2 Implement RSP streaming. 2009-04-28 18:00:27 +02:00
Julien BLACHE
718631bab5 Introduce RSP protocol implementation
Lacks a couple of things:
 - actual streaming
 - transcoding
 - authentication
2009-04-25 23:02:15 +02:00