Commit Graph

96 Commits

Author SHA1 Message Date
ejurgensen
bdd6bab982 [-] Lots of housekeeping thanks to scan-build and input from @acmay 2016-11-19 23:08:50 +01:00
ejurgensen
c0d07ae93b [httpd] Allow HEAD for evhttp requests just to be safe 2016-10-21 23:06:00 +02:00
ejurgensen
2ce1c8d28f [httpd] Enable OPTIONS for evhttp (if CORS headers are enabled) 2016-10-19 21:22:14 +02:00
ejurgensen
54a09fce63 [httpd] Add requirement for Access-Control-Request-Method for preflight CORS 2016-10-19 17:29:22 +02:00
ejurgensen
57945a592c [httpd] Reply to CORS preflight requests 2016-10-18 23:04:51 +02:00
ejurgensen
c44f4310b7 [httpd] Replace evhttp_send_error with the httpd_send_error wrapper 2016-10-18 22:45:22 +02:00
ejurgensen
fe7373e442 [httpd] Implement httpd_send_error, a modified evhttp_send_error, which
can include CORS headers (credit @bjoernricks and libevent)
2016-10-17 23:08:02 +02:00
ejurgensen
e1cfccbce7 [httpd] Exchange evhttp_send_reply with httpd_send_reply in httpd.c 2016-10-17 22:14:10 +02:00
ejurgensen
0b29b4368d [httpd] Enable CORS headers by default (Access-Control-Allow-Origin: *) 2016-10-17 22:03:32 +02:00
ejurgensen
7dc2a46261 [cache] Save daap replies gzipped - should improve performance 2016-10-17 19:40:25 +02:00
ejurgensen
249d923af2 [httpd] Allow caller of httpd_send_reply to avoid gzipping 2016-10-17 14:18:13 +02:00
ejurgensen
d8696e72ea [httpd] Don't gzip small messages 2016-10-17 14:09:16 +02:00
ejurgensen
f7185db035 [httpd] Reduce memcpy when gzipping a response 2016-10-16 23:36:27 +02:00
ejurgensen
d66a130064 [lastfm] Also scrobble after regular daap streaming
Ref https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=813940
2016-09-02 21:52:45 +02:00
Björn Ricks
6b6a1e65e1 Allow to add Access-Control-Allow-Origin header to responses
Add a new general config setting allow_origin that is included as
Access-Control-Allow-Origin header in http responses. This allows to make http
request against forked-daapd from browsers with enabled CORS
(https://www.w3.org/TR/cors/) via JavaScript XMLHttpRequest.

Per default the setting is not defined and no Access-Control-Allow-Origin header
is included in the response.
2016-06-02 13:32:41 +02:00
ejurgensen
9a56044c77 [misc] Explicitly check for pthread_setname_np/pthread_set_name_np
Seems there is no pthread_setname_np in OpenWrt
2016-05-05 19:39:15 +02:00
ejurgensen
c4713d8b39 [httpd] Improve log message 2016-03-21 19:26:54 +01:00
ejurgensen
b454a2fd60 [general] Put back support for platforms without pipe2(), see issue #239 2016-03-17 22:20:16 +01:00
chme
98d6db002f Set thread names to make it easier to identify threads during debugging 2016-03-12 14:01:08 +01:00
ejurgensen
6cabbc4ab7 [httpd] Add fallback to IPv4 if v6 fails 2015-12-21 21:52:21 +01:00
ejurgensen
3e80e5c517 [transcode] Don't pass error to player on eof + some comments and cleaning 2015-10-22 22:09:19 +02: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
2a610812a5 Refactor transcode.c so it can actually transcode + use new capability to support mp3 streaming.
Also includes the skeleton for perhaps supporting video in the future. Adds more fine-grained
ffmpeg/libav compability checks. Dependency on libavresample/libswresample exchanged with
dependency on libavfilter, which seems more versatile.
2015-10-09 23:58:27 +02:00
ejurgensen
a183fc3299 Fix #147 where forked-daapd would not listen on IPv6 when enabled 2015-05-07 22:53:37 +02:00
chme
659f9c09bb Use enum values for data_kind and media_kind 2015-04-23 11:34:44 +02:00
ejurgensen
dbfd034679 Downgrade log severity of "Found query string" in httpd.c 2015-04-13 21:33:00 +02:00
ejurgensen
99cda05dab Remove player metadata event timer (use the existing instead) 2015-04-11 20:30:31 +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
c740e6e3b0 Make compatible with libevent 2.0 by crippling streaming and ICY metadata (see issue #30) 2014-05-30 23:39:03 +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
ejurgensen
7ed6cc98c3 Add support for Spotify (squashed commit), and:
- Try to not return items which a client can't play
    - Remove inotify subscription to IN_MODIFY and IN_CREATE
    - Fix crash on unknown codec type in transcode.c
    - Probably added some new bugs...
2014-03-11 23:20:29 +01:00
ejurgensen
3c941ca0e1 iTunes will drop the connection if user seeks during playback, but
no reason to log that on default log level
2014-02-03 23:12:19 +01:00
ejurgensen
3064509f62 HTTP Range header may be in the form 'bytes=12345-' (no end offset) 2014-02-03 22:02:20 +01:00
Julien BLACHE
49a9ff64dc Use st->size instead of sb.st_size which is only valid for raw files 2011-04-24 19:03:47 +02:00
Julien BLACHE
69fe64c277 Honour IPv6 config option for HTTP services 2011-03-20 12:19:39 +01:00
Julien BLACHE
0cb62fdabf Bind IPv4 server first, to avoid v4compat 2010-09-10 18:47:43 +02:00
Julien BLACHE
e9b8fd8bd7 Check for both ip6-localhost and localhost 2010-09-10 18:47:42 +02:00
Julien BLACHE
053b8df4ba Factor out common code to increase playcount while streaming 2010-09-10 18:47:42 +02:00
Julien BLACHE
b0a8e879e4 Remove useless check 2010-09-10 18:47:42 +02:00
Julien BLACHE
71bf8390b0 Constify http_reply_401 2010-09-10 18:47:42 +02:00
Julien BLACHE
81d09ed234 Account for new evhttp behaviour on failed incoming connections
The evcon associated with a request is freed by evhttp when the connection
fails. Protect against a NULL evcon when handling the connection failure.
2010-07-23 18:28:29 +02:00
Julien BLACHE
588b328b45 IPv4 binding failure is fatal in all cases
IPv4 and IPv6 are bound separately; IPv6 may fail if unsupported, IPv4
must always succeed.
2010-05-14 17:36:58 +02:00
Julien BLACHE
13c9de3ed1 Introduce httpd_send_reply() with gzip capability 2010-05-03 19:11:55 +02:00
Julien BLACHE
8427707afc Create evbase_httpd before protocol handlers init
DACP needs the httpd event base at init time.
2010-05-02 11:44:43 +02:00
Julien BLACHE
9fb7ec8e5c Make the WAV header optional 2010-05-02 11:21:08 +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
affbae1c47 Make evbase_httpd non-static
Make the httpd event base available to httpd protocol handlers.
2010-03-06 10:27:39 +01:00
Julien BLACHE
18abda3a97 Use evhttp_connection's closecb instead of our fail_cb extension
The closecb callback of evhttp_connection does what we need, so no need
to use that extension anymore.
2010-02-14 09:34:29 +01:00