Skip to content

Commit 6316dae

Browse files
authored
main UPDATE support multiple subscriptions to streams (#1808)
Currently, the NETCONF server makes an assumption that it will be the only entity which manages this container. With our RESTCONF server, this is no longer the case. Unless there's a systemwide "notification daemon" which will be in charge of this, the only reasonable choice is, IMHO, to rely on the usual rules of data merging as provided by sysrepo.
1 parent 4714d28 commit 6316dae

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/main.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,12 @@ server_data_subscribe(void)
13201320
}
13211321

13221322
/* operational data */
1323-
SR_OPER_SUBSCR(mod_name, "/ietf-subscribed-notifications:streams", srsn_oper_data_streams_cb);
1323+
rc = sr_oper_get_subscribe(np2srv.sr_sess, mod_name, "/ietf-subscribed-notifications:streams",
1324+
srsn_oper_data_streams_cb, NULL, SR_SUBSCR_OPER_MERGE, &np2srv.sr_data_sub);
1325+
if (rc != SR_ERR_OK) {
1326+
ERR("Subscribing for providing \"%s\" state data failed (%s).", mod_name, sr_strerror(rc));
1327+
goto error;
1328+
}
13241329
rc = sr_oper_get_subscribe(np2srv.sr_sess, mod_name, "/ietf-subscribed-notifications:subscriptions",
13251330
np2srv_oper_sub_ntf_subscriptions_cb, NULL, SR_SUBSCR_OPER_MERGE, &np2srv.sr_data_sub);
13261331
if (rc != SR_ERR_OK) {

0 commit comments

Comments
 (0)