Bugzilla – Bug 17312
IP is cached on the server, changes to IP not respected
Last modified: 2011-07-15 14:41:27 UTC
Slim::Utils::IPDetect::IP only retrieves the IP upon the very first call, then it is cached. If the IP changes (not uncommon on computers that go to suspend and then later wake up), a changed IP is not detected. This leads to some trouble, i.e.: - the 'Information' Tab on the Web-Interface shows the wrong IP - Slim::Utils::Network::host_addr also returns a wrong IP - switching players via Web-UI between servers does not work, but disconnects players from any server When switching players via the WebUI, the 'disconnect playerID remoteServerID' request on the local server is used. This request is internally changed to a 'playerID connect host_addr' request that is sent to the remote server (see Slim::Control::Commands::disconnectCommand) As a wrong IP is used, this in turn makes the player switch to an IP with no server running -> the player is now disconnected to any server and not visible on any remote. As a simple solution I suggest to implement a cache-timeout in Slim::Utils::IPDetect::IP - so that the IP is not cached indefinitely but maybe only 5mins, reducing the probability of the bug.