mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Websocket re-architecture with websocketd and websocat (#89)
- Replaced beast with websocketd and websocat. #79 #83 #84 - Implemented inbound/outbound peer connection merging. - Added graceful shutdown of hpcore with sigint. #87
This commit is contained in:
11
src/util.cpp
11
src/util.cpp
@@ -188,7 +188,7 @@ std::string_view getsv(const rapidjson::Value &v)
|
||||
return std::string_view(v.GetString(), v.GetStringLength());
|
||||
}
|
||||
|
||||
// provide a safe std::string overload for realpath
|
||||
// Provide a safe std::string overload for realpath
|
||||
std::string realpath(std::string path)
|
||||
{
|
||||
std::array<char, PATH_MAX> buffer;
|
||||
@@ -197,4 +197,13 @@ std::string realpath(std::string path)
|
||||
return buffer.data();
|
||||
}
|
||||
|
||||
// Applies signal mask to the calling thread.
|
||||
void mask_signal()
|
||||
{
|
||||
sigset_t mask;
|
||||
sigemptyset(&mask);
|
||||
sigaddset(&mask, SIGINT);
|
||||
pthread_sigmask(SIG_BLOCK, &mask, NULL);
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
|
||||
Reference in New Issue
Block a user