Skip to content

Commit e138afb

Browse files
committed
[#3255] Added CA reuse logs
1 parent d542b04 commit e138afb

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

src/bin/agent/ca_messages.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ extern const isc::log::MessageID CTRL_AGENT_CONFIG_CHECK_FAIL = "CTRL_AGENT_CONF
1515
extern const isc::log::MessageID CTRL_AGENT_CONFIG_FAIL = "CTRL_AGENT_CONFIG_FAIL";
1616
extern const isc::log::MessageID CTRL_AGENT_CONFIG_SYNTAX_WARNING = "CTRL_AGENT_CONFIG_SYNTAX_WARNING";
1717
extern const isc::log::MessageID CTRL_AGENT_FAILED = "CTRL_AGENT_FAILED";
18+
extern const isc::log::MessageID CTRL_AGENT_HTTPS_SERVICE_REUSED = "CTRL_AGENT_HTTPS_SERVICE_REUSED";
1819
extern const isc::log::MessageID CTRL_AGENT_HTTPS_SERVICE_STARTED = "CTRL_AGENT_HTTPS_SERVICE_STARTED";
20+
extern const isc::log::MessageID CTRL_AGENT_HTTP_SERVICE_REUSED = "CTRL_AGENT_HTTP_SERVICE_REUSED";
1921
extern const isc::log::MessageID CTRL_AGENT_HTTP_SERVICE_STARTED = "CTRL_AGENT_HTTP_SERVICE_STARTED";
2022
extern const isc::log::MessageID CTRL_AGENT_RUN_EXIT = "CTRL_AGENT_RUN_EXIT";
2123
extern const isc::log::MessageID CTRL_AGENT_STARTED = "CTRL_AGENT_STARTED";
@@ -34,7 +36,9 @@ const char* values[] = {
3436
"CTRL_AGENT_CONFIG_FAIL", "Control Agent configuration failed: %1",
3537
"CTRL_AGENT_CONFIG_SYNTAX_WARNING", "Control Agent configuration syntax warning: %1",
3638
"CTRL_AGENT_FAILED", "application experienced a fatal error: %1",
39+
"CTRL_AGENT_HTTPS_SERVICE_REUSED", "reused HTTPS service bound to address %1:%2",
3740
"CTRL_AGENT_HTTPS_SERVICE_STARTED", "HTTPS service bound to address %1:%2",
41+
"CTRL_AGENT_HTTP_SERVICE_REUSED", "reused HTTP service bound to address %1:%2",
3842
"CTRL_AGENT_HTTP_SERVICE_STARTED", "HTTP service bound to address %1:%2",
3943
"CTRL_AGENT_RUN_EXIT", "application is exiting the event loop",
4044
"CTRL_AGENT_STARTED", "Kea Control Agent version %1 started",

src/bin/agent/ca_messages.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ extern const isc::log::MessageID CTRL_AGENT_CONFIG_CHECK_FAIL;
1616
extern const isc::log::MessageID CTRL_AGENT_CONFIG_FAIL;
1717
extern const isc::log::MessageID CTRL_AGENT_CONFIG_SYNTAX_WARNING;
1818
extern const isc::log::MessageID CTRL_AGENT_FAILED;
19+
extern const isc::log::MessageID CTRL_AGENT_HTTPS_SERVICE_REUSED;
1920
extern const isc::log::MessageID CTRL_AGENT_HTTPS_SERVICE_STARTED;
21+
extern const isc::log::MessageID CTRL_AGENT_HTTP_SERVICE_REUSED;
2022
extern const isc::log::MessageID CTRL_AGENT_HTTP_SERVICE_STARTED;
2123
extern const isc::log::MessageID CTRL_AGENT_RUN_EXIT;
2224
extern const isc::log::MessageID CTRL_AGENT_STARTED;

src/bin/agent/ca_messages.mes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,20 @@ error. The error was displayed and the configuration parsing resumed.
4343
This is a fatal error message issued when the Control Agent application
4444
encounters an unrecoverable error from within the event loop.
4545

46+
% CTRL_AGENT_HTTPS_SERVICE_REUSED reused HTTPS service bound to address %1:%2
47+
This informational message indicates that the server has reused existing
48+
HTTPS service on the specified address and port. Note that any change in
49+
the TLS setup was ignored.
50+
4651
% CTRL_AGENT_HTTPS_SERVICE_STARTED HTTPS service bound to address %1:%2
4752
This informational message indicates that the server has started HTTPS service
4853
on the specified address and port. All control commands should be sent to this
4954
address and port over a TLS channel.
5055

56+
% CTRL_AGENT_HTTP_SERVICE_REUSED reused HTTP service bound to address %1:%2
57+
This informational message indicates that the server has reused existing
58+
HTTPS service on the specified address and port.
59+
5160
% CTRL_AGENT_HTTP_SERVICE_STARTED HTTP service bound to address %1:%2
5261
This informational message indicates that the server has started HTTP service
5362
on the specified address and port. All control commands should be sent to this

src/bin/agent/ca_process.cc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,29 @@ CtrlAgentProcess::configure(isc::data::ConstElementPtr config_set,
181181
// active listeners. The next step will be to remove all other
182182
// active listeners, but we do it inside the main process loop.
183183
http_listeners_.push_back(http_listener);
184+
} else if (!http_listeners_.empty()) {
185+
// Reconfig keeping the same address and port.
186+
if (http_listeners_.back()->getTlsContext()) {
187+
LOG_INFO(agent_logger, CTRL_AGENT_HTTPS_SERVICE_REUSED)
188+
.arg(server_address.toText())
189+
.arg(server_port);
190+
} else {
191+
LOG_INFO(agent_logger, CTRL_AGENT_HTTP_SERVICE_REUSED)
192+
.arg(server_address.toText())
193+
.arg(server_port);
194+
}
195+
return;
184196
}
185197

186198
// Ok, seems we're good to go.
187199
if (use_https) {
188200
LOG_INFO(agent_logger, CTRL_AGENT_HTTPS_SERVICE_STARTED)
189-
.arg(server_address.toText()).arg(server_port);
201+
.arg(server_address.toText())
202+
.arg(server_port);
190203
} else {
191204
LOG_INFO(agent_logger, CTRL_AGENT_HTTP_SERVICE_STARTED)
192-
.arg(server_address.toText()).arg(server_port);
205+
.arg(server_address.toText())
206+
.arg(server_port);
193207
}
194208
});
195209

0 commit comments

Comments
 (0)