mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-15 07:20:31 +02:00
http: Properly stop server on stop server.
This commit is contained in:
1 parent
429346bb94
commit
287d1967a5
3 files changed
+19
-4
No files matched your search
@@ -79,7 +79,7 @@ static void RegisterServer(int port) {
|
||||
static void ExecuteServer() {
|
||||
setCurrentThreadName("HTTPServer");
|
||||
|
||||
net::Init();
|
||||
net::AutoInit netInit;
|
||||
auto http = new http::Server(new threading::SameThreadExecutor());
|
||||
|
||||
std::map<std::string, std::string> paths;
|
||||
@@ -156,7 +156,11 @@ static void ExecuteServer() {
|
||||
}
|
||||
|
||||
if (!http->Listen(g_Config.iRemoteISOPort)) {
|
||||
http->Listen(0);
|
||||
if (!http->Listen(0)) {
|
||||
ERROR_LOG(COMMON, "Unable to listen on any port");
|
||||
UpdateStatus(ServerStatus::STOPPED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
UpdateStatus(ServerStatus::RUNNING);
|
||||
|
||||
@@ -173,7 +177,7 @@ static void ExecuteServer() {
|
||||
}
|
||||
}
|
||||
|
||||
net::Shutdown();
|
||||
http->Stop();
|
||||
|
||||
UpdateStatus(ServerStatus::STOPPED);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user