Fix various issues and crashes

This commit is contained in:
Lion Kortlepel
2021-12-06 12:28:52 +01:00
parent 279c93179c
commit 0f74eca2ee
9 changed files with 96 additions and 66 deletions

View File

@@ -3,12 +3,16 @@
#include <Common.h>
#include <IThreaded.h>
#include <filesystem>
#include <httplib.h>
#include <openssl/pem.h>
#include <openssl/x509.h>
#include <string>
#include <unordered_map>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#include <httplib.h>
#pragma GCC diagnostic pop
namespace fs = std::filesystem;
namespace Crypto {
@@ -36,12 +40,6 @@ namespace Server {
void operator()();
private:
/**
* the shared pointer is necessary because httplib is a blocking library and due lacking thread-safety
* will "forget" about its environment, when configured across multiple threads.
* So we need to able to start the server (make it "listen()") in a single Thread.
*/
std::shared_ptr<httplib::SSLServer> mHttpLibServerInstancePtr;
std::thread mThread;
};
// todo: all of these functions are likely unsafe,