Skip to content

Commit

Permalink
Added feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
  • Loading branch information
ahcorde committed Dec 11, 2024
1 parent 8cd19bf commit 6877a48
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions rmw_zenoh_cpp/src/detail/rmw_client_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,12 @@ void ClientData::add_new_reply(std::unique_ptr<ZenohReply> reply)
reply_queue_.size() >= adapted_qos_profile.depth)
{
// Log warning if message is discarded due to hitting the queue depth
std::string keystr = std::string(keyexpr_.value().as_string_view());
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"Query queue depth of %ld reached, discarding oldest Query "
"for client for %.*s",
"for client for %s",
adapted_qos_profile.depth,
keystr.size(),
keystr.c_str());
keyexpr_.value().as_string_view());
reply_queue_.pop_front();
}
reply_queue_.emplace_back(std::move(reply));
Expand Down Expand Up @@ -407,10 +405,11 @@ rmw_ret_t ClientData::send_request(
parameters,
[client_data](const zenoh::Reply & reply) {
if (!reply.is_ok()) {
auto reply_err_str = reply.get_err().get_payload().as_string();
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"z_reply_is_ok returned False Reason: %s",
reply.get_err().get_payload().as_string())
reply_err_str.c_str())
return;
}
const zenoh::Sample & sample = reply.get_ok();
Expand All @@ -420,7 +419,7 @@ rmw_ret_t ClientData::send_request(
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"Unable to obtain ClientData from data for %s.",
std::string(sample.get_keyexpr().as_string_view()));
sample.get_keyexpr().as_string_view());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_service_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ std::shared_ptr<ServiceData> ServiceData::make(
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"Unable to obtain ServiceData from data for %s.",
std::string(query.get_keyexpr().as_string_view()));
query.get_keyexpr().as_string_view());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ bool SubscriptionData::init()
RMW_ZENOH_LOG_ERROR_NAMED(
"rmw_zenoh_cpp",
"Unable to obtain SubscriptionData from data for %s.",
std::string(sample.get_keyexpr().as_string_view()));
sample.get_keyexpr().as_string_view());
return;
}

Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/detail/zenoh_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ zenoh::Bytes create_map_and_set_sequence_num(
int64_t source_timestamp = now_ns.count();

rmw_zenoh_cpp::AttachmentData data(sequence_number, source_timestamp, gid);
return std::move(data.serialize_to_zbytes());
return data.serialize_to_zbytes();
}

///=============================================================================
Expand Down

0 comments on commit 6877a48

Please sign in to comment.