Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop redundant CpuBoundWork usages in lib/remote #9994

Merged
merged 3 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/remote/httpserverconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,6 @@ bool HandleAccessControl(
auto headerAllowOrigin (listener->GetAccessControlAllowOrigin());

if (headerAllowOrigin) {
CpuBoundWork allowOriginHeader (yc);

auto allowedOrigins (headerAllowOrigin->ToSet<String>());

if (!allowedOrigins.empty()) {
Expand All @@ -251,8 +249,6 @@ bool HandleAccessControl(
response.set(http::field::access_control_allow_origin, origin);
}

allowOriginHeader.Done();

response.set(http::field::access_control_allow_credentials, "true");

if (request.method() == http::verb::options && !request[http::field::access_control_request_method].empty()) {
Expand Down Expand Up @@ -537,8 +533,6 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc)
auto authenticatedUser (m_ApiUser);

if (!authenticatedUser) {
CpuBoundWork fetchingAuthenticatedUser (yc);

yhabteab marked this conversation as resolved.
Show resolved Hide resolved
authenticatedUser = ApiUser::GetByAuthHeader(std::string(request[http::field::authorization]));
}

Expand Down
6 changes: 2 additions & 4 deletions lib/remote/jsonrpcconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,15 @@ void JsonRpcConnection::HandleIncomingMessages(boost::asio::yield_context yc)
CpuBoundWork handleMessage (yc);

MessageHandler(message);

l_TaskStats.InsertValue(Utility::GetTime(), 1);
} catch (const std::exception& ex) {
Log(m_ShuttingDown ? LogDebug : LogWarning, "JsonRpcConnection")
<< "Error while processing JSON-RPC message for identity '" << m_Identity
<< "': " << DiagnosticInformation(ex);

break;
}

CpuBoundWork taskStats (yc);

l_TaskStats.InsertValue(Utility::GetTime(), 1);
}

Disconnect();
Expand Down
Loading