Module: kamailio
Branch: master
Commit: b3c8329cfbfa19613dfbadaea7f220443dbb7f55
URL:
https://github.com/kamailio/kamailio/commit/b3c8329cfbfa19613dfbadaea7f2204…
Author: Seven Du <dujinfang(a)x-y-t.cn>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2022-06-20T19:16:13+02:00
nats: fix the nats:connected event_route not being triggered on a successful connect
---
Modified: src/modules/nats/nats_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b3c8329cfbfa19613dfbadaea7f2204…
Patch:
https://github.com/kamailio/kamailio/commit/b3c8329cfbfa19613dfbadaea7f2204…
---
diff --git a/src/modules/nats/nats_mod.c b/src/modules/nats/nats_mod.c
index 2a53beda82f..6108d555e81 100644
--- a/src/modules/nats/nats_mod.c
+++ b/src/modules/nats/nats_mod.c
@@ -298,7 +298,10 @@ int _nats_pub_worker_proc(
!= NATS_OK) {
LM_ERR("could not connect to nats servers [%s]\n",
natsStatus_GetText(s));
+ } else {
+ connectedCB(worker->nc->conn, NULL);
}
+
s = natsOptions_SetEventLoop(worker->nc->opts, (void *)worker->uvLoop,
natsLibuv_Attach, natsLibuv_Read, natsLibuv_Write,
natsLibuv_Detach);