mirror of
https://github.com/moonlight-stream/moonlight-chrome.git
synced 2025-08-17 08:36:42 +00:00
Fixed issue with context being lost, causing invalid mDNS discoveries
This commit is contained in:
parent
1c647c0327
commit
b215f19f6a
@ -63,18 +63,18 @@ function restoreUiAfterNaClLoad() {
|
|||||||
var ip = ips[i];
|
var ip = ips[i];
|
||||||
if (finder.byService_['_nvstream._tcp'][ip]) {
|
if (finder.byService_['_nvstream._tcp'][ip]) {
|
||||||
var mDnsDiscoveredHost = new NvHTTP(ip, myUniqueid);
|
var mDnsDiscoveredHost = new NvHTTP(ip, myUniqueid);
|
||||||
mDnsDiscoveredHost.pollServer(function() {
|
mDnsDiscoveredHost.pollServer(function(returneMdnsDiscoveredHost) {
|
||||||
// Just drop this if the host doesn't respond
|
// Just drop this if the host doesn't respond
|
||||||
if (!mDnsDiscoveredHost.online) {
|
if (!returneMdnsDiscoveredHost.online) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hosts[mDnsDiscoveredHost.serverUid] != null) {
|
if (hosts[returneMdnsDiscoveredHost.serverUid] != null) {
|
||||||
// if we're seeing a host we've already seen before, update it for the current local IP.
|
// if we're seeing a host we've already seen before, update it for the current local IP.
|
||||||
hosts[mDnsDiscoveredHost.serverUid].address = mDnsDiscoveredHost.address;
|
hosts[returneMdnsDiscoveredHost.serverUid].address = returneMdnsDiscoveredHost.address;
|
||||||
} else {
|
} else {
|
||||||
beginBackgroundPollingOfHost(mDnsDiscoveredHost);
|
beginBackgroundPollingOfHost(returneMdnsDiscoveredHost);
|
||||||
addHostToGrid(mDnsDiscoveredHost, true);
|
addHostToGrid(returneMdnsDiscoveredHost, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -119,13 +119,13 @@ NvHTTP.prototype = {
|
|||||||
this._consecutivePollFailures = 0;
|
this._consecutivePollFailures = 0;
|
||||||
this.online = true;
|
this.online = true;
|
||||||
|
|
||||||
onComplete();
|
onComplete(this);
|
||||||
}.bind(this), function() {
|
}.bind(this), function() {
|
||||||
if (++this._consecutivePollFailures >= 3) {
|
if (++this._consecutivePollFailures >= 3) {
|
||||||
this.online = false;
|
this.online = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
onComplete();
|
onComplete(this);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user