From 8707b38c4863f1e8765116064071ee6774e541b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sat, 10 Oct 2020 14:48:22 +0200 Subject: [PATCH] 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. --- nncmpp.c | 4 ++++ 1 file changed, 4 insertions(+) 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);