From 0f7779adf84f72673762e381e9b44e187f25f932 Mon Sep 17 00:00:00 2001 From: Jean-Roland Gosse Date: Thu, 22 Feb 2024 11:33:55 +0100 Subject: [PATCH] feat: remove subscription ke limitation (#343) --- src/session/subscription.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/session/subscription.c b/src/session/subscription.c index 0cd1050d9..e85ae2420 100644 --- a/src/session/subscription.c +++ b/src/session/subscription.c @@ -132,16 +132,13 @@ _z_subscription_rc_t *_z_register_subscription(_z_session_t *zn, uint8_t is_loca zp_mutex_lock(&zn->_mutex_inner); #endif // Z_FEATURE_MULTI_THREAD == 1 - _z_subscription_rc_list_t *subs = __unsafe_z_get_subscriptions_by_key(zn, is_local, s->_key); - if (subs == NULL) { // A subscription for this name does not yet exists - ret = (_z_subscription_rc_t *)zp_malloc(sizeof(_z_subscription_rc_t)); - if (ret != NULL) { - *ret = _z_subscription_rc_new_from_val(*s); - if (is_local == _Z_RESOURCE_IS_LOCAL) { - zn->_local_subscriptions = _z_subscription_rc_list_push(zn->_local_subscriptions, ret); - } else { - zn->_remote_subscriptions = _z_subscription_rc_list_push(zn->_remote_subscriptions, ret); - } + ret = (_z_subscription_rc_t *)zp_malloc(sizeof(_z_subscription_rc_t)); + if (ret != NULL) { + *ret = _z_subscription_rc_new_from_val(*s); + if (is_local == _Z_RESOURCE_IS_LOCAL) { + zn->_local_subscriptions = _z_subscription_rc_list_push(zn->_local_subscriptions, ret); + } else { + zn->_remote_subscriptions = _z_subscription_rc_list_push(zn->_remote_subscriptions, ret); } }