Permalink
Browse files

mythmusic: Fix streaming radio not being able to connect to some streams

This fixes a couple of errors with creating the stream GET request header.
If the path part of the the URI is empty the HTTP/1.1 spec says it should be
specified as "/" and not be empty and the Host request-header field should
contain the port if it is non standard.

Fixes #11214

Signed-off-by: Stuart Morgan <smorgan@mythtv.org>
  • Loading branch information...
Paul Harrison authored and stuartm committed Nov 1, 2012
1 parent f070528 commit fe22adc5c485b8b19969b0e1804a84f652227577
Showing with 18 additions and 2 deletions.
  1. +18 −2 mythplugins/mythmusic/mythmusic/shoutcast.cpp
@@ -77,11 +77,19 @@ class ShoutCastRequest
"Accept: */*\r\n");
QString path = url.path();
QString host = url.host();
if (path.isEmpty())
path = "/";
if (url.hasQuery())
path += '?' + url.encodedQuery();
if (url.port() != -1)
host += QString(":%1").arg(url.port());
hdr.replace("%PATH%", path);
hdr.replace("%HOST%", url.host());
hdr.replace("%HOST%", host);
hdr.replace("%VERSION%", MYTH_BINARY_VERSION);
if (!url.userName().isEmpty() && !url.password().isEmpty())
@@ -123,11 +131,19 @@ class IceCastRequest
"Accept: */*\r\n");
QString path = url.path();
QString host = url.host();
if (path.isEmpty())
path = "/";
if (url.hasQuery())
path += '?' + url.encodedQuery();
if (url.port() != -1)
host += QString(":%1").arg(url.port());
hdr.replace("%PATH%", path);
hdr.replace("%HOST%", url.host());
hdr.replace("%HOST%", host);
hdr.replace("%VERSION%", MYTH_BINARY_VERSION);
if (!url.userName().isEmpty() && !url.password().isEmpty())

0 comments on commit fe22adc

Please sign in to comment.