X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/085c36723242f7bd1e0fd9bf49b950da6cb96039..0c097ef3435d2a45c1ee4ac80f8bd3f254fb8df5:/projects/sgauth/web.h diff --git a/projects/sgauth/web.h b/projects/sgauth/web.h index d086125c..a5ec8e6a 100644 --- a/projects/sgauth/web.h +++ b/projects/sgauth/web.h @@ -28,9 +28,12 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#include +#pragma GCC diagnostic pop #ifndef WIN32 -#include #include #include #include @@ -55,7 +58,6 @@ class WEB { public: WEB(); - void Run(); void SetDirName(const std::string & dn, int n); void SetRefreshPagePeriod(int p); void SetListenAddr(uint32_t ip); @@ -63,6 +65,7 @@ class WEB void UpdateStat(const LOADSTAT & ls); void Start(); private: + void Run(std::stop_token token) noexcept; void PrepareNet(); int SendReply(); int SendCSS(); @@ -70,10 +73,10 @@ class WEB #ifdef WIN32 WSADATA m_wsaData; - #else - pthread_t m_thread; #endif + std::jthread m_thread; + std::string m_dirName[DIR_NUM]; int m_res; int m_listenSocket;