diff --git a/include/zenoh-pico/net/session.h b/include/zenoh-pico/net/session.h index 1bc988e07..62ebb543c 100644 --- a/include/zenoh-pico/net/session.h +++ b/include/zenoh-pico/net/session.h @@ -94,7 +94,7 @@ typedef struct _z_session_t { _z_pending_query_list_t *_pending_queries; #endif -#if Z_FEATURE_INTEREST == 1 +#if Z_FEATURE_MATCHING == 1 _z_matching_listener_intmap_t _matching_listeners; #endif diff --git a/src/api/api.c b/src/api/api.c index 124d43579..8f115c677 100644 --- a/src/api/api.c +++ b/src/api/api.c @@ -1133,7 +1133,8 @@ z_result_t z_publisher_declare_matching_listener(const z_loaned_publisher_t *pub z_result_t z_publisher_get_matching_status(const z_loaned_publisher_t *publisher, z_matching_status_t *matching_status) { - // TODO(sashacmc): check implementation + // Ideally this should be implemented as a real request to the router, but this works much faster. + // And it works as long as filtering is enabled along with interest matching_status->matching = publisher->_filter.ctx->state != WRITE_FILTER_ACTIVE; return _Z_RES_OK; } diff --git a/src/net/matching.c b/src/net/matching.c index 401d2f3c6..a7969506b 100644 --- a/src/net/matching.c +++ b/src/net/matching.c @@ -53,8 +53,8 @@ static void _z_matching_listener_callback(const _z_interest_msg_t *msg, void *ar _z_matching_listener_t _z_matching_listener_declare(_z_session_rc_t *zn, const _z_keyexpr_t *key, _z_zint_t entity_id, _z_closure_matching_status_t callback) { - uint8_t flags = _Z_INTEREST_FLAG_KEYEXPRS | _Z_INTEREST_FLAG_SUBSCRIBERS | _Z_INTEREST_FLAG_RESTRICTED | - _Z_INTEREST_FLAG_CURRENT | _Z_INTEREST_FLAG_FUTURE | _Z_INTEREST_FLAG_AGGREGATE; + uint8_t flags = _Z_INTEREST_FLAG_SUBSCRIBERS | _Z_INTEREST_FLAG_RESTRICTED | _Z_INTEREST_FLAG_FUTURE | + _Z_INTEREST_FLAG_AGGREGATE; _z_matching_listener_t ret = _z_matching_listener_null(); _z_matching_listener_ctx_t *ctx = _z_matching_listener_ctx_new(callback);