Skip to content

Commit

Permalink
Fix local file playback on remote MPD when MPD's curl is using IPv6
Browse files Browse the repository at this point in the history
  • Loading branch information
CDrummond committed Nov 2, 2016
1 parent b573c7c commit d721fab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
33. Fix scrobbling when Album is empty.
34. Fix duration of last track for split CUE files.
35. Move stream listings to github.
36. Fix local file playback on remote MPD when MPD's curl is using IPv6.

2.0.1
-----
Expand Down
5 changes: 4 additions & 1 deletion http/httpsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d721fab

Please sign in to comment.