Commit Graph

39 Commits

Author SHA1 Message Date
ejurgensen
83b8a4eb3f [http] Use curl for URL parsing instead of depending on httpd
Makes it easier to make the httpd parsing internal.
2023-03-07 21:01:10 +01:00
chme
d277f7c7b3 [http/spotify] Add support for http sessions across multiple requests
This change allows to reuse curl handles for multiple requests.
Reusing a curl handle improves performance if more than one request is
made against a service (connection, session cache, dns cache are kept
between requests).
2022-05-01 09:01:23 +02:00
whatdoineed2do/Ray
8f9356ff11 [http,conf] allow user to request no ssl peer verification
This solves for the case where hosted RSS podcasts have self signed or
expired certs:  using default (verify peer) in these instances results
in 'SSL peer certificate or SSH remote key was not OK'
2021-12-18 17:00:05 +00:00
ejurgensen
c1db4d914f [http] Also allow remote playlists to have https streams (fixes #1251)
Fix it by adding net_is_http_or_https() utility function in misc.h and make
sure it used whenever a http protocol check is made.
2021-05-19 22:53:25 +02:00
Justin Wong
0f5393633a Check utf-8 in metadata_packet_get 2020-11-23 23:31:00 +08:00
ejurgensen
d0a7d5114b [http] Drop own Shoutcast metadata requestor, rely on ffmpeg now
ffmpeg/libav has been capable of this since approx 2016, so the fallback
functions can be dropped now.

Also means we don't add automatically add Icy-MetaData: 1 to request
headers any more.
2020-07-17 00:08:16 +02:00
ejurgensen
3e707c4060 [http] Make libcurl a hard requirement
Always using libcurl makes the code simpler, plus makes sure we always have a
https client
2020-07-16 23:30:05 +02:00
ejurgensen
8acb2a647d [http] Don't set ICY metadata if they are just empty strings
An empty string will mean that m3u tags won't get used (unless m3u_override is
configured), but they should be used, since they are probably better than an
empty string.
2020-05-19 23:06:36 +02:00
ejurgensen
d2ac216f47 [http] Change name of struct field for StreamUrl
Should not be called artwork_url, since it also can link to other ressources.

Also some fixup, e.g. use new macros.
2020-05-16 00:13:31 +02:00
whatdoineed2do/Ray
81f4834814 [http] leak fix for curl_slist_append() 2020-02-28 21:57:10 +00:00
ejurgensen
8261fb8e59 [http] Don't return zero-length ICY title metadata 2020-02-23 20:30:35 +01:00
ejurgensen
15b18e26b7 [http] Let the curl https client follow up to 5 redirects
Requests for artwork to Cover Art Archive require redirects. Perhaps there are
also some playlist requests that will benefit from this.
2020-02-23 20:30:35 +01:00
chme
9b8bff45ab [artwork/http] Check response code and content type
Extends the http_client_ctx to hold the response code for a request.
Also adds the content type header, if it was a https request (using
libcurl instead of libevent)
2019-02-09 08:35:20 +01:00
chme
0f4cbb3375 [http/jsonapi] Use strtok_r instead of strtok 2019-01-02 09:51:54 +01:00
chme
234ccc2899 [http] Prevent adding empty artwork urls into icy metadata
Some radio streams send empty strings as "StreamUrl", prevent these from
beeing added into the queue database.
2018-11-30 06:39:22 +01:00
ejurgensen
ab1ded35e4 [config] Make user_agent configurable + don't use ffmpeg default (ref issue #562) 2018-08-12 19:49:23 +02:00
ejurgensen
8d043dd9e9 [http] Temporary fix for bug in commit 8f899f2
See 8f899f2051 (commitcomment-26433079)
2018-01-02 21:20:28 +01:00
ejurgensen
617a0992d0 [http] Align indentation with the rest of the code 2017-11-27 17:53:59 +01:00
Wolfgang Scherer
8f899f2051 [http] .pls playlists (#447) 2017-11-27 09:48:17 +01:00
ejurgensen
41aa530fd3 [http] Add support for http post in the libevent client (required for scrobbling) 2017-01-25 22:52:11 +01:00
ejurgensen
1ab9151489 [http] Repair broken libevent 2.0 compability 2016-12-11 20:20:27 +01:00
ejurgensen
3921cf5732 Merge branch 'spwebapi2' 2016-11-27 22:54:06 +01:00
ejurgensen
8525c278ec [http] Fix crash with URLs without any "." chars in the path (issue #311, @credit acmay) 2016-11-17 19:24:55 +01:00
ejurgensen
8c0db10e67 [http] Move Curl https client from lastfm to http so it is available for other modules 2016-11-05 13:43:35 +01:00
ejurgensen
7a4ce2f68d [http] Title and artist were swapped when reading ICY packet metadata 2015-11-29 00:55:30 +01:00
ejurgensen
ec0ba2c5fa Fix problem where the http client would ignore the last line in a m3u because of missing CRLF (issue #169) 2015-06-18 23:03:11 +02:00
ejurgensen
a9437acc1a Rework pr #162 to avoid mem leaks and string termination problems 2015-06-05 23:55:57 +02:00
ejurgensen
3655e26703 Code style 2015-06-02 23:10:04 +02:00
stephan-01010011
32727bd296 Fixed bug that caused icy header metadata to be not correctly
encoded/converted. Characters above x7F were replaced by '?' character
although the rfc defines a ISO−8859−1 encoding for descriptive
field-content.

According to rfc2616 the field-content is defined as follows:
<the OCTETs making up the field-value and consisting of either *TEXT or
combinations of token, separators, and quoted-string>
The TEXT rule is only used for descriptive field contents and values
that are not intended to be interpreted by the message parser. Words of
*TEXT MAY contain characters from character sets other than ISO- 8859-1
only when encoded according to the rules of RFC 2047.

In the previous implementation the icy metadata was converted based on
fromcode "ascii".

Following incoming icy header field-values should be encoded as
"ISO−8859−1" before adding them to the metadata structure.

- misc.c unicode_fixup_string enhanced by an additional parameter to
define the fromcode
- misc.h unicode_fixup_string prototype updated
- filescanner.c function fixup_tags updated to stay compatible to the
previous implementation using fromcode "ascii"
- db.c function unicode_fixup_mfi updated to stay compatible to the
previous implementation using fromcode "ascii"
- http.c function metadata_header_get enhanced to encode the header
field-content as "ISO−8859−1" to comply with rfc2616
2015-05-31 14:05:31 +01:00
ejurgensen
b819fd800d Change log message showing http request path 2015-04-18 23:09:34 +02:00
chme
72416e3258 do not add port number to "Host" header if it was not explicitly passed 2015-04-18 13:49:14 +02:00
ejurgensen
ceae3222bf Downgrade some http client log severities 2015-04-13 21:41:53 +02:00
ejurgensen
7d756230c2 Make raop_metadata_free private again and change a comment in http.c 2015-04-11 20:53:09 +02:00
ejurgensen
19ba8fba67 Drop async mode from http client, not needed and probably not working 2015-03-31 23:27:18 +02:00
ejurgensen
e49c941a00 Add a worker thread to support async tasks from the player thread
(and maybe others later)
2015-03-31 23:05:24 +02:00
ejurgensen
96200eb808 Use own libevent http client for downloading artwork, ffmpeg seems a
bit too slow
2015-03-31 00:08:29 +02:00
ejurgensen
2b2883403e Fixup for libevent 2.0 2015-03-29 01:10:37 +01:00
ejurgensen
ea29a8d988 Remove filescanner_icy.c and consolidate in http.c.
Libav 9 does not support ICY metadata, so in that case we must be able to get it outselves.
2015-03-29 00:29:06 +01:00
ejurgensen
b8d8df132b Support for remote m3u playlists (ref pr #79) 2015-03-20 23:40:42 +01:00