mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-01 11:17:51 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -2749,7 +2749,7 @@ static json DefaultUCentralSchema = R"(
|
|||||||
if(std::regex_match(value,host_regex))
|
if(std::regex_match(value,host_regex))
|
||||||
return;
|
return;
|
||||||
throw std::invalid_argument(value + " is not a proper FQDN.");
|
throw std::invalid_argument(value + " is not a proper FQDN.");
|
||||||
} else if(format == "fqdn") {
|
} else if(format == "fqdn" || format=="uc-fqdn") {
|
||||||
if(std::regex_match(value,host_regex))
|
if(std::regex_match(value,host_regex))
|
||||||
return;
|
return;
|
||||||
throw std::invalid_argument(value + " is not a proper FQDN.");
|
throw std::invalid_argument(value + " is not a proper FQDN.");
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool UI_WebSocketClientServer::SendToUser(const std::string &UserName, std::uint64_t id, const std::string &Payload) {
|
bool UI_WebSocketClientServer::SendToUser(const std::string &UserName, std::uint64_t id, const std::string &Payload) {
|
||||||
std::lock_guard G(Mutex_);
|
std::lock_guard G(LocalMutex_);
|
||||||
|
|
||||||
for(const auto &Client:Clients_) {
|
for(const auto &Client:Clients_) {
|
||||||
if(Client.second->UserName_ == UserName) {
|
if(Client.second->UserName_ == UserName) {
|
||||||
@@ -139,7 +139,7 @@ namespace OpenWifi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UI_WebSocketClientServer::SendToAll(std::uint64_t id, const std::string &Payload) {
|
void UI_WebSocketClientServer::SendToAll(std::uint64_t id, const std::string &Payload) {
|
||||||
std::lock_guard G(Mutex_);
|
std::lock_guard G(LocalMutex_);
|
||||||
|
|
||||||
for(const auto &Client:Clients_) {
|
for(const auto &Client:Clients_) {
|
||||||
try {
|
try {
|
||||||
@@ -189,7 +189,6 @@ namespace OpenWifi {
|
|||||||
void UI_WebSocketClientServer::OnSocketReadable([[maybe_unused]] const Poco::AutoPtr<Poco::Net::ReadableNotification> &pNf) {
|
void UI_WebSocketClientServer::OnSocketReadable([[maybe_unused]] const Poco::AutoPtr<Poco::Net::ReadableNotification> &pNf) {
|
||||||
|
|
||||||
UI_WebSocketClientServer::ClientList::iterator Client;
|
UI_WebSocketClientServer::ClientList::iterator Client;
|
||||||
|
|
||||||
std::lock_guard G(LocalMutex_);
|
std::lock_guard G(LocalMutex_);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -295,6 +294,7 @@ namespace OpenWifi {
|
|||||||
|
|
||||||
void UI_WebSocketClientServer::OnSocketShutdown([[maybe_unused]] const Poco::AutoPtr<Poco::Net::ShutdownNotification> &pNf) {
|
void UI_WebSocketClientServer::OnSocketShutdown([[maybe_unused]] const Poco::AutoPtr<Poco::Net::ShutdownNotification> &pNf) {
|
||||||
try {
|
try {
|
||||||
|
std::lock_guard G(LocalMutex_);
|
||||||
auto Client = Clients_.find(pNf->socket().impl()->sockfd());
|
auto Client = Clients_.find(pNf->socket().impl()->sockfd());
|
||||||
if (Client == end(Clients_))
|
if (Client == end(Clients_))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user