X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b27841d687ec9e84983340b5581376dfb24010ea..16e9905f82947dd471c09382122d8150ba6fda1a:/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;