[#4144] Address review

This commit is contained in:
Andrei Pavel
2025-11-14 13:01:12 +02:00
parent eaa5e79180
commit 768a1591eb
4 changed files with 10 additions and 6 deletions

View File

@@ -35,7 +35,7 @@ BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 100
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true

View File

@@ -56,7 +56,8 @@ public:
///
/// Deregisters all commands except 'list-commands'.
CtrlAgentCommandMgrTest()
: DControllerTest(CtrlAgentController::instance), mgr_(CtrlAgentCommandMgr::instance()),
: DControllerTest(CtrlAgentController::instance),
mgr_(CtrlAgentCommandMgr::instance()),
skipped_(false) {
mgr_.deregisterAll();
setSocketTestPath();

View File

@@ -42,7 +42,8 @@ public:
setSocketTestPath();
socket_name_too_long_ = SocketPath::isTooLong(SocketPath::unixSocketFilePath());
if (!socket_name_too_long_) {
test_socket_.reset(new TestServerUnixSocket(io_service_, SocketPath::unixSocketFilePath()));
test_socket_.reset(
new TestServerUnixSocket(io_service_, SocketPath::unixSocketFilePath()));
}
}

View File

@@ -29,8 +29,8 @@ struct SocketPath {
/// @return whether the socket name is too long
static bool isTooLong(std::string const& socket_name) {
try {
std::string const validated_socket_name(UnixCommandConfig::validatePath(socket_name));
isc::asiolink::UnixDomainSocketEndpoint endpoint(validated_socket_name);
std::string const validated(UnixCommandConfig::validatePath(socket_name));
isc::asiolink::UnixDomainSocketEndpoint endpoint(validated);
} catch (std::exception const& e) {
// Check if it starts with it.
std::string const search_for("name too long");
@@ -65,7 +65,9 @@ struct SocketPath {
for (ConstElementPtr control_socket : control_sockets->listValue()) {
ConstElementPtr socket_name(control_socket->get("socket-name"));
ConstElementPtr socket_type(control_socket->get("socket-type"));
if (socket_name && socket_name->getType() == Element::string && socket_type &&
if (socket_name &&
socket_name->getType() == Element::string &&
socket_type &&
socket_type->getType() == Element::string &&
socket_type->stringValue() == "unix") {
std::string const name(socket_name->stringValue());