Only match ports if the PC is online

This commit is contained in:
Cameron Gutman
2022-11-21 23:00:51 -06:00
parent 33d484b7d1
commit dcc3dcdaba

View File

@@ -553,7 +553,8 @@ public class ComputerManagerService extends Service {
// If the current address's port number matches the active address's port number, we can also assume
// the HTTPS port will also match. This assumption is currently safe because Sunshine sets all ports
// 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;
boolean portMatchesActiveAddress = details.state == ComputerDetails.State.ONLINE &&
details.activeAddress != null && address.port == details.activeAddress.port;
NvHTTP http = new NvHTTP(address, portMatchesActiveAddress ? details.httpsPort : 0, idManager.getUniqueId(), details.serverCert,
PlatformBinding.getCryptoProvider(ComputerManagerService.this));