summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-10 14:48:22 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-10 14:48:22 +0200
commit8707b38c4863f1e8765116064071ee6774e541b3 (patch)
tree60928057c86675094183c96c1c385c04e058fc5e
parent7af041ac016e5a5ccb380c531688ab7db4a291c7 (diff)
downloadnncmpp-8707b38c4863f1e8765116064071ee6774e541b3.tar.gz
nncmpp-8707b38c4863f1e8765116064071ee6774e541b3.tar.xz
nncmpp-8707b38c4863f1e8765116064071ee6774e541b3.zip
Make direct SHOUTcast streams work again
Might be an issue specific to my bbc-on-ice, since we're not asking for SHOUTcast by including "Icy-MetaData: 1" in request headers but the proxy always outputs an "ICY 200 OK" header.
-rw-r--r--nncmpp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nncmpp.c b/nncmpp.c
index aa1daac..0c95fef 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -2970,6 +2970,8 @@ streams_tab_process (const char *uri, bool replace, struct error **e)
task.replace = replace;
bool result = false;
+ struct curl_slist *ok_headers = curl_slist_append (NULL, "ICY 200 OK");
+
CURLcode res;
if ((res = curl_easy_setopt (easy, CURLOPT_FOLLOWLOCATION, 1L))
|| (res = curl_easy_setopt (easy, CURLOPT_NOPROGRESS, 1L))
@@ -2979,6 +2981,7 @@ streams_tab_process (const char *uri, bool replace, struct error **e)
|| (res = curl_easy_setopt (easy, CURLOPT_SSL_VERIFYPEER, 0L))
|| (res = curl_easy_setopt (easy, CURLOPT_SSL_VERIFYHOST, 0L))
|| (res = curl_easy_setopt (easy, CURLOPT_URL, uri))
+ || (res = curl_easy_setopt (easy, CURLOPT_HTTP200ALIASES, ok_headers))
|| (res = curl_easy_setopt (easy, CURLOPT_VERBOSE, (long) g_debug_mode))
|| (res = curl_easy_setopt (easy, CURLOPT_DEBUGFUNCTION, print_curl_debug))
@@ -3002,6 +3005,7 @@ streams_tab_process (const char *uri, bool replace, struct error **e)
error:
curl_easy_cleanup (task.curl.easy);
+ curl_slist_free_all (ok_headers);
str_free (&task.data);
poller_curl_free (&pc);