chore: Set ColumnLimit to 120 in clang-format (#6288)

This change updates the ColumnLimit from 80 to 120, and applies clang-format to reformat the code.
This commit is contained in:
Ayaz Salikhov
2026-01-28 18:09:50 +00:00
committed by GitHub
parent 92046785d1
commit 5f638f5553
1016 changed files with 26918 additions and 66660 deletions

View File

@@ -49,8 +49,7 @@ class WSClientImpl : public WSClient
continue;
using namespace boost::asio::ip;
if (pp.ip && pp.ip->is_unspecified())
*pp.ip = pp.ip->is_v6() ? address{address_v6::loopback()}
: address{address_v4::loopback()};
*pp.ip = pp.ip->is_v6() ? address{address_v6::loopback()} : address{address_v4::loopback()};
if (!pp.port)
Throw<std::runtime_error>("Use fixConfigPorts with auto ports");
@@ -74,9 +73,7 @@ class WSClientImpl : public WSClient
}
boost::asio::io_context ios_;
std::optional<boost::asio::executor_work_guard<
boost::asio::io_context::executor_type>>
work_;
std::optional<boost::asio::executor_work_guard<boost::asio::io_context::executor_type>> work_;
boost::asio::strand<boost::asio::io_context::executor_type> strand_;
std::thread thread_;
boost::asio::ip::tcp::socket stream_;
@@ -100,24 +97,21 @@ class WSClientImpl : public WSClient
void
cleanup()
{
boost::asio::post(
ios_, boost::asio::bind_executor(strand_, [this] {
if (!peerClosed_)
{
ws_.async_close(
{},
boost::asio::bind_executor(strand_, [&](error_code) {
try
{
stream_.cancel();
}
catch (boost::system::system_error const&)
{
// ignored
}
}));
}
}));
boost::asio::post(ios_, boost::asio::bind_executor(strand_, [this] {
if (!peerClosed_)
{
ws_.async_close({}, boost::asio::bind_executor(strand_, [&](error_code) {
try
{
stream_.cancel();
}
catch (boost::system::system_error const&)
{
// ignored
}
}));
}
}));
work_ = std::nullopt;
thread_.join();
}
@@ -139,22 +133,16 @@ public:
{
auto const ep = getEndpoint(cfg, v2);
stream_.connect(ep);
ws_.set_option(boost::beast::websocket::stream_base::decorator(
[&](boost::beast::websocket::request_type& req) {
ws_.set_option(
boost::beast::websocket::stream_base::decorator([&](boost::beast::websocket::request_type& req) {
for (auto const& h : headers)
req.set(h.first, h.second);
}));
ws_.handshake(
ep.address().to_string() + ":" + std::to_string(ep.port()),
"/");
ws_.handshake(ep.address().to_string() + ":" + std::to_string(ep.port()), "/");
ws_.async_read(
rb_,
boost::asio::bind_executor(
strand_,
std::bind(
&WSClientImpl::on_read_msg,
this,
std::placeholders::_1)));
strand_, std::bind(&WSClientImpl::on_read_msg, this, std::placeholders::_1)));
}
catch (std::exception&)
{
@@ -191,9 +179,7 @@ public:
ws_.write_some(true, buffer(s));
}
auto jv = findMsg(5s, [&](Json::Value const& jval) {
return jval[jss::type] == jss::response;
});
auto jv = findMsg(5s, [&](Json::Value const& jval) { return jval[jss::type] == jss::response; });
if (jv)
{
// Normalize JSON output
@@ -229,9 +215,7 @@ public:
}
std::optional<Json::Value>
findMsg(
std::chrono::milliseconds const& timeout,
std::function<bool(Json::Value const&)> pred) override
findMsg(std::chrono::milliseconds const& timeout, std::function<bool(Json::Value const&)> pred) override
{
std::shared_ptr<msg> m;
{
@@ -284,10 +268,7 @@ private:
}
ws_.async_read(
rb_,
boost::asio::bind_executor(
strand_,
std::bind(
&WSClientImpl::on_read_msg, this, std::placeholders::_1)));
boost::asio::bind_executor(strand_, std::bind(&WSClientImpl::on_read_msg, this, std::placeholders::_1)));
}
// Called when the read op terminates