[sr-dev] git:master:3c48266d: lwsc: added loaded field to intermodule api strucure

Daniel-Constantin Mierla miconda at gmail.com
Wed Mar 24 17:42:38 CET 2021


Module: kamailio
Branch: master
Commit: 3c48266d56b58d3c1de44f630a88df2092d6d0d5
URL: https://github.com/kamailio/kamailio/commit/3c48266d56b58d3c1de44f630a88df2092d6d0d5

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-03-24T17:42:26+01:00

lwsc: added loaded field to intermodule api strucure

- mark when the structure is filled

---

Modified: src/modules/lwsc/api.h

---

Diff:  https://github.com/kamailio/kamailio/commit/3c48266d56b58d3c1de44f630a88df2092d6d0d5.diff
Patch: https://github.com/kamailio/kamailio/commit/3c48266d56b58d3c1de44f630a88df2092d6d0d5.patch

---

diff --git a/src/modules/lwsc/api.h b/src/modules/lwsc/api.h
index c76fb8c6b1..87bf0ea87e 100644
--- a/src/modules/lwsc/api.h
+++ b/src/modules/lwsc/api.h
@@ -37,6 +37,7 @@ typedef int (*lwsc_api_request_f)(str *wsurl, str *wsproto, str *sdata,
  * @brief Stateless (sl) API structure
  */
 typedef struct lwsc_api {
+	int loaded;
 	lwsc_api_request_f  request; /* send and receice data */
 } lwsc_api_t;
 
@@ -54,11 +55,12 @@ static inline int lwsc_load_api(lwsc_api_t *lwscb)
 		LM_ERR("cannot find bind_lwsc exported function\n");
 		return -1;
 	}
-	if (bindlwsc(lwscb)==-1)
-	{
+	if (bindlwsc(lwscb)==-1) {
 		LM_ERR("cannot bind lwsc api\n");
 		return -1;
 	}
+	lwscb->loaded = 1;
+
 	return 0;
 }
 




More information about the sr-dev mailing list