Merge "Add emtpy rustfmt.toml to project root"
diff --git a/aos/network/message_bridge_client_lib.cc b/aos/network/message_bridge_client_lib.cc
index 8df81c6..e42eaa0 100644
--- a/aos/network/message_bridge_client_lib.cc
+++ b/aos/network/message_bridge_client_lib.cc
@@ -378,11 +378,15 @@
client_status_(event_loop_),
config_sha256_(std::move(config_sha256)),
refresh_key_timer_(event_loop->AddTimer([this]() { RequestAuthKey(); })),
- sctp_config_request_(event_loop_->MakeSender<SctpConfigRequest>("/aos")) {
+ sctp_config_request_(
+ event_loop_->TryMakeSender<SctpConfigRequest>("/aos")) {
std::string_view node_name = event_loop->node()->name()->string_view();
// Set up the SCTP configuration watcher and timer.
if (requested_authentication == SctpAuthMethod::kAuth && HasSctpAuth()) {
+ CHECK(sctp_config_request_.valid())
+ << ": Must have SctpConfig channel configured to use SCTP "
+ "authentication.";
event_loop->MakeWatcher("/aos", [this](const SctpConfig &config) {
if (config.has_key()) {
for (auto &conn : connections_) {
@@ -449,6 +453,7 @@
}
void MessageBridgeClient::RequestAuthKey() {
+ CHECK(sctp_config_request_.valid());
auto sender = sctp_config_request_.MakeBuilder();
auto builder = sender.MakeBuilder<SctpConfigRequest>();
builder.add_request_key(true);
diff --git a/aos/network/message_bridge_server_lib.cc b/aos/network/message_bridge_server_lib.cc
index 9ac062e..35c8afe 100644
--- a/aos/network/message_bridge_server_lib.cc
+++ b/aos/network/message_bridge_server_lib.cc
@@ -418,12 +418,16 @@
config_sha256_(std::move(config_sha256)),
allocator_(0),
refresh_key_timer_(event_loop->AddTimer([this]() { RequestAuthKey(); })),
- sctp_config_request_(event_loop_->MakeSender<SctpConfigRequest>("/aos")) {
+ sctp_config_request_(
+ event_loop_->TryMakeSender<SctpConfigRequest>("/aos")) {
CHECK_EQ(config_sha256_.size(), 64u) << ": Wrong length sha256sum";
CHECK(event_loop_->node() != nullptr) << ": No nodes configured.";
// Set up the SCTP configuration watcher and timer.
if (requested_authentication == SctpAuthMethod::kAuth && HasSctpAuth()) {
+ CHECK(sctp_config_request_.valid())
+ << ": Must have SctpConfig channel configured to use SCTP "
+ "authentication.";
event_loop_->MakeWatcher("/aos", [this](const SctpConfig &config) {
if (config.has_key()) {
server_.SetAuthKey(*config.key());
@@ -846,6 +850,7 @@
}
void MessageBridgeServer::RequestAuthKey() {
+ CHECK(sctp_config_request_.valid());
auto sender = sctp_config_request_.MakeBuilder();
auto builder = sender.MakeBuilder<SctpConfigRequest>();
builder.add_request_key(true);
diff --git a/aos/realtime.cc b/aos/realtime.cc
index 8b34ada..94dfa4e 100644
--- a/aos/realtime.cc
+++ b/aos/realtime.cc
@@ -331,7 +331,9 @@
if (FLAGS_die_on_malloc) {
// tcmalloc redefines __libc_malloc, so use this as a feature test.
if (&__libc_malloc == &tc_malloc) {
- RAW_LOG(INFO, "Hooking tcmalloc for die_on_malloc");
+ if (VLOG_IS_ON(1)) {
+ RAW_LOG(INFO, "Hooking tcmalloc for die_on_malloc");
+ }
if (&MallocHook_AddNewHook != nullptr) {
CHECK(MallocHook_AddNewHook(&NewHook));
} else {