upgrade core add header check and incrace upload speed

This commit is contained in:
UnknownObject
2026-08-05 17:35:27 +08:00
parent 45af94e535
commit 1f11a9d348
76 changed files with 2059 additions and 642 deletions
+7 -2
View File
@@ -91,7 +91,7 @@ void ServerProcessor::AppenedBlockedIP(DateTime::Span block_time, std::string ip
IPList li{ ip };
pimpl->BlockedIPs->Appened(expr_time, li);
pimpl->BlockedIPs->Update();
SCLOG_INFO("IP: [%s] has been blocked untill {%s}", ip.c_str(), std::string(expr_time).c_str());
SCLOGF_INFO("IP: [{}] has been blocked untill {{{}}}", ip, std::string(expr_time));
return;
}
@@ -136,13 +136,18 @@ bool ServerProcessor::IsPathSafe(const std::string& raw_path)
return false;
}
bool ServerProcessor::IsHeaderValid(uns::RequestPtr request)
{
return true;
}
uns::ResponsePtr ServerProcessor::Handle(uns::RequestPtr request)
{
std::string x_real_ip;
if(request->GetImpl()->webcc_req->HasHeader("X-Real-IP"))
x_real_ip = request->GetImpl()->webcc_req->GetHeader("X-Real-IP");
std::string req_ip = (x_real_ip.empty() ? request->GetImpl()->webcc_req->address() : x_real_ip);
SCLOGF_INFO("Request recived by {{{0}}}, ip: [{}], method: {}, URL: {}", RTTISubClassName(typeid(*this)), req_ip, request->GetImpl()->webcc_req->method(), request->GetImpl()->webcc_req->url().path());
SCLOGF_INFO("Request recived by {{{}}}, ip: [{}], method: {}, URL: {}", RTTISubClassName(typeid(*this)), req_ip, request->GetImpl()->webcc_req->method(), request->GetImpl()->webcc_req->url().path());
if (pimpl->IPCheck && (pimpl->BlockedIPs != nullptr))
{
pimpl->BlockedIPs->Update();