mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Rearchitected state sync with hpfs. (#96)
This commit is contained in:
@@ -196,17 +196,24 @@ namespace comm
|
||||
{
|
||||
// New client connected.
|
||||
const std::string ip = get_cgi_ip(client_fd);
|
||||
|
||||
if (corebill::is_banned(ip))
|
||||
if (!ip.empty())
|
||||
{
|
||||
LOG_DBG << "Dropping connection for banned host " << ip;
|
||||
close(client_fd);
|
||||
if (corebill::is_banned(ip))
|
||||
{
|
||||
LOG_DBG << "Dropping connection for banned host " << ip;
|
||||
close(client_fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
comm_session session(ip, client_fd, client_fd, session_type, is_binary, true, metric_thresholds);
|
||||
if (session.on_connect() == 0)
|
||||
sessions.try_emplace(client_fd, std::move(session));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
comm_session session(ip, client_fd, client_fd, session_type, is_binary, true, metric_thresholds);
|
||||
if (session.on_connect() == 0)
|
||||
sessions.try_emplace(client_fd, std::move(session));
|
||||
close(client_fd);
|
||||
LOG_ERR << "Closed bad client socket: " << client_fd;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,6 +299,8 @@ namespace comm
|
||||
else if (pid == 0)
|
||||
{
|
||||
// Websocketd process.
|
||||
util::unmask_signal();
|
||||
|
||||
// We are using websocketd forked repo: https://github.com/codetsunami/websocketd
|
||||
|
||||
if (firewall_out > 0)
|
||||
@@ -303,9 +312,9 @@ namespace comm
|
||||
}
|
||||
|
||||
std::string max_frame = std::string("--maxframe=")
|
||||
.append(use_size_header
|
||||
? "4294967296" // 4GB
|
||||
: std::to_string(max_msg_size));
|
||||
.append(use_size_header
|
||||
? "4294967296" // 4GB
|
||||
: std::to_string(max_msg_size));
|
||||
|
||||
// Fill process args.
|
||||
char *execv_args[] = {
|
||||
|
||||
Reference in New Issue
Block a user