Skip to content

Commit

Permalink
Improve logging when rejecting duplicate connections (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhaybd authored Nov 7, 2023
1 parent 6d59368 commit b8ff2a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/network/websocket/WebSocketServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ bool SingleClientWSServer::validate(connection_hdl hdl) {
if (!entry->second.client.has_value()) {
return true;
} else {
auto existingConn = server.get_con_from_hdl(entry->second.client.value());
log(LOG_INFO,
"Server=%s, Endpoint=%s : Rejected connection from %s - A client is already "
"connected!\n",
serverName.c_str(), path.c_str(), conn->get_remote_endpoint().c_str());
"connected: %s\n",
serverName.c_str(), path.c_str(), conn->get_remote_endpoint().c_str(),
existingConn->get_remote_endpoint().c_str());
return false;
}
} else {
Expand Down

0 comments on commit b8ff2a6

Please sign in to comment.