mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-02 15:56:24 +00:00
Pass active HTTPS port if the HTTP port matches the active address
This commit is contained in:
parent
236d8b7030
commit
cbe602655c
@ -550,14 +550,18 @@ public class ComputerManagerService extends Service {
|
|||||||
|
|
||||||
private ComputerDetails tryPollIp(ComputerDetails details, ComputerDetails.AddressTuple address) {
|
private ComputerDetails tryPollIp(ComputerDetails details, ComputerDetails.AddressTuple address) {
|
||||||
try {
|
try {
|
||||||
// If this PC is currently online at this address, provide the known HTTPS port number
|
// If the current address's port number matches the active address's port number, we can also assume
|
||||||
// and extend the timeouts to allow more time for the PC to respond.
|
// the HTTPS port will also match. This assumption is currently safe because Sunshine sets all ports
|
||||||
boolean isActiveAddress = details.state == ComputerDetails.State.ONLINE && address.equals(details.activeAddress);
|
// as offsets from the base HTTP port and doesn't allow custom HttpsPort responses for WAN vs LAN.
|
||||||
|
boolean portMatchesActiveAddress = details.activeAddress != null && address.port == details.activeAddress.port;
|
||||||
|
|
||||||
NvHTTP http = new NvHTTP(address, isActiveAddress ? details.httpsPort : 0, idManager.getUniqueId(), details.serverCert,
|
NvHTTP http = new NvHTTP(address, portMatchesActiveAddress ? details.httpsPort : 0, idManager.getUniqueId(), details.serverCert,
|
||||||
PlatformBinding.getCryptoProvider(ComputerManagerService.this));
|
PlatformBinding.getCryptoProvider(ComputerManagerService.this));
|
||||||
|
|
||||||
ComputerDetails newDetails = http.getComputerDetails(isActiveAddress);
|
// If this PC is currently online at this address, extend the timeouts to allow more time for the PC to respond.
|
||||||
|
boolean isLikelyOnline = details.state == ComputerDetails.State.ONLINE && address.equals(details.activeAddress);
|
||||||
|
|
||||||
|
ComputerDetails newDetails = http.getComputerDetails(isLikelyOnline);
|
||||||
|
|
||||||
// Check if this is the PC we expected
|
// Check if this is the PC we expected
|
||||||
if (newDetails.uuid == null) {
|
if (newDetails.uuid == null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user