Skip to content

Commit

Permalink
fix: correct the sub_ke and selector_ke in the querying_subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuYuan committed Oct 3, 2024
1 parent 4aef9e7 commit c386a3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,9 +1050,9 @@ rmw_create_subscription(
// '*' in place of the queryable_prefix of each PublicationCache
const std::string selector = "*/" +
sub_data->entity->topic_info()->topic_keyexpr_;
z_view_keyexpr_t ke;
z_view_keyexpr_from_str(&ke, selector.c_str());
sub_options.query_selector = z_loan(ke);
z_view_keyexpr_t selector_ke;
z_view_keyexpr_from_str(&selector_ke, selector.c_str());
sub_options.query_selector = z_loan(selector_ke);
// Tell the PublicationCache's Queryable that the query accepts any key expression as a reply.
// By default a query accepts only replies that matches its query selector.
// This allows us to selectively query certain PublicationCaches when defining the
Expand All @@ -1072,7 +1072,7 @@ rmw_create_subscription(

ze_owned_querying_subscriber_t sub;
if (ze_declare_querying_subscriber(
&sub, session, z_loan(ke), z_move(callback), &sub_options))
&sub, session, z_loan(sub_ke), z_move(callback), &sub_options))
{
RMW_SET_ERROR_MSG("unable to create zenoh subscription");
return nullptr;
Expand Down

0 comments on commit c386a3d

Please sign in to comment.