http: Save last-used port.

This is necessary for better caching, in case you share often.
This commit is contained in:
Unknown W. Brackets 2016-07-03 21:09:17 -07:00
parent 66479add92
commit c3e70c11f8
3 changed files with 10 additions and 2 deletions

View file

@ -155,9 +155,12 @@ static void ExecuteServer() {
http->RegisterHandler(pair.first.c_str(), handler);
}
http->Listen(0);
if (!http->Listen(g_Config.iRemoteISOPort)) {
http->Listen(0);
}
UpdateStatus(ServerStatus::RUNNING);
g_Config.iRemoteISOPort = http->Port();
RegisterServer(http->Port());
double lastRegister = real_time_now();
while (RetrieveStatus() == ServerStatus::RUNNING) {