mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-02 15:55:39 +00:00
Improve handling of IPv6-only cases
This commit is contained in:
parent
6f9c3fbc38
commit
897f6fdd3e
@ -662,14 +662,16 @@ private:
|
|||||||
if (m_Mdns) {
|
if (m_Mdns) {
|
||||||
newComputer->localAddress = m_Address;
|
newComputer->localAddress = m_Address;
|
||||||
|
|
||||||
// Get the WAN IP address using STUN if we're on mDNS
|
// Get the WAN IP address using STUN if we're on mDNS over IPv4
|
||||||
quint32 addr;
|
if (QHostAddress(newComputer->localAddress).protocol() == QAbstractSocket::IPv4Protocol) {
|
||||||
int err = LiFindExternalAddressIP4("stun.moonlight-stream.org", 3478, &addr);
|
quint32 addr;
|
||||||
if (err == 0) {
|
int err = LiFindExternalAddressIP4("stun.moonlight-stream.org", 3478, &addr);
|
||||||
newComputer->remoteAddress = QHostAddress(qFromBigEndian(addr)).toString();
|
if (err == 0) {
|
||||||
}
|
newComputer->remoteAddress = QHostAddress(qFromBigEndian(addr)).toString();
|
||||||
else {
|
}
|
||||||
qWarning() << "STUN failed to get WAN address:" << err;
|
else {
|
||||||
|
qWarning() << "STUN failed to get WAN address:" << err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_MdnsIpv6Address.isNull()) {
|
if (!m_MdnsIpv6Address.isNull()) {
|
||||||
|
@ -132,7 +132,12 @@ NvComputer::NvComputer(QString address, QString serverInfo, QSslCertificate serv
|
|||||||
mode2.width * mode2.height * mode2.refreshRate;
|
mode2.width * mode2.height * mode2.refreshRate;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// We can get an IPv4 loopback address if we're using the GS IPv6 Forwarder
|
||||||
this->localAddress = NvHTTP::getXmlString(serverInfo, "LocalIP");
|
this->localAddress = NvHTTP::getXmlString(serverInfo, "LocalIP");
|
||||||
|
if (this->localAddress.startsWith("127.")) {
|
||||||
|
this->localAddress = QString();
|
||||||
|
}
|
||||||
|
|
||||||
this->remoteAddress = NvHTTP::getXmlString(serverInfo, "ExternalIP");
|
this->remoteAddress = NvHTTP::getXmlString(serverInfo, "ExternalIP");
|
||||||
this->pairState = NvHTTP::getXmlString(serverInfo, "PairStatus") == "1" ?
|
this->pairState = NvHTTP::getXmlString(serverInfo, "PairStatus") == "1" ?
|
||||||
PS_PAIRED : PS_NOT_PAIRED;
|
PS_PAIRED : PS_NOT_PAIRED;
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 6245934462d9639680d7f6a007df25627b9b3719
|
Subproject commit 25dfbcfd41180573140b5f7d0b087e9330f2ba36
|
Loading…
x
Reference in New Issue
Block a user