Fix local file playback on remote MPD when MPD's curl is using IPv6

Issue #907
This commit is contained in:
Craig Drummond
2016-11-02 22:24:00 +00:00
committed by Craig Drummond
parent 65d7e28e9c
commit 84ca06c2a5
2 changed files with 5 additions and 1 deletions

View File

@@ -273,9 +273,12 @@ void HttpSocket::readClient()
return;
}
static const QLatin1String constIpV6Prefix("::ffff:");
QString peer=socket->peerAddress().toString();
QString ifaceAddress=serverAddress().toString();
bool hostOk=peer==ifaceAddress || peer==mpdAddr || peer==QLatin1String("127.0.0.1") || peer==QLatin1String("::ffff:127.0.0.1");
bool hostOk=peer==ifaceAddress || peer==mpdAddr || peer==(constIpV6Prefix+mpdAddr) ||
peer==QLatin1String("127.0.0.1") || peer==(constIpV6Prefix+QLatin1String("127.0.0.1"));
DBUG << "peer:" << peer << "mpd:" << mpdAddr << "iface:" << ifaceAddress << "ok:" << hostOk;
if (!hostOk) {