mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
If upnp is disabled, poll the check less aggressively. TODO: should wait for a cond instead.
This commit is contained in:
1 parent
2adbc231f0
commit
f690cb99a4
1 file changed
+3
-3
@@ -477,6 +477,9 @@ int upnpService(const unsigned int timeout)
|
||||
|
||||
// Service Loop
|
||||
while (upnpServiceRunning && coreState != CORE_POWERDOWN) {
|
||||
// Sleep for 1ms for faster response if active, otherwise sleep longer (TODO: Improve on this).
|
||||
sleep_ms(g_Config.bEnableUPnP ? 1 : 100);
|
||||
|
||||
// Attempts to reconnect if not connected yet or got disconnected
|
||||
if (g_Config.bEnableUPnP && g_PortManager.GetInitState() == UPNP_INITSTATE_NONE) {
|
||||
g_PortManager.Initialize(timeout);
|
||||
@@ -506,9 +509,6 @@ int upnpService(const unsigned int timeout)
|
||||
upnpLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
// Sleep for 1ms for faster response
|
||||
sleep_ms(1);
|
||||
}
|
||||
|
||||
// Cleaning up regardless of g_Config.bEnableUPnP to prevent lingering open ports on the router
|
||||
|
||||
Reference in new issue
Block a user