Module: kamailio
Branch: master
Commit: fa83cbbbc9e3850b6c2890e59059925b16d38af0
URL:
https://github.com/kamailio/kamailio/commit/fa83cbbbc9e3850b6c2890e59059925…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-03-26T09:31:44+01:00
lwsc: handle LWS_CALLBACK_GET_THREAD_ID event
- logs for a few other events
---
Modified: src/modules/lwsc/lwsc_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/fa83cbbbc9e3850b6c2890e59059925…
Patch:
https://github.com/kamailio/kamailio/commit/fa83cbbbc9e3850b6c2890e59059925…
---
diff --git a/src/modules/lwsc/lwsc_mod.c b/src/modules/lwsc/lwsc_mod.c
index 28634beae3..9572d859fe 100644
--- a/src/modules/lwsc/lwsc_mod.c
+++ b/src/modules/lwsc/lwsc_mod.c
@@ -234,7 +234,19 @@ static int ksr_lwsc_callback(struct lws *wsi, enum
lws_callback_reasons reason,
switch (reason) {
case LWS_CALLBACK_PROTOCOL_INIT:
- LM_DBG("LWS_CALLBACK_PROTOCOL_INIT\n");
+ if(_lwsc_verbosity>0) {
+ LM_DBG("LWS_CALLBACK_PROTOCOL_INIT: %d\n", reason);
+ }
+ break;
+ case LWS_CALLBACK_PROTOCOL_DESTROY:
+ if(_lwsc_verbosity>0) {
+ LM_DBG("LWS_CALLBACK_PROTOCOL_DESTROY: %d\n", reason);
+ }
+ break;
+ case LWS_CALLBACK_EVENT_WAIT_CANCELLED:
+ if(_lwsc_verbosity>0) {
+ LM_DBG("LWS_CALLBACK_EVENT_WAIT_CANCELLED: %d\n", reason);
+ }
break;
case LWS_CALLBACK_CLIENT_CONNECTION_ERROR:
@@ -248,6 +260,12 @@ static int ksr_lwsc_callback(struct lws *wsi, enum
lws_callback_reasons reason,
ep->wsi = NULL;
break;
+ case LWS_CALLBACK_GET_THREAD_ID:
+ if(_lwsc_verbosity>0) {
+ LM_DBG("LWS_CALLBACK_GET_THREAD_ID: %d\n", reason);
+ }
+ return (long)pthread_self();
+
case LWS_CALLBACK_CLOSED:
LM_DBG("LWS_CALLBACK_CLOSED - wsi: %p\n", wsi);
ep = lwsc_get_endpoint_by_wsi(wsi);
@@ -310,7 +328,7 @@ static int ksr_lwsc_callback(struct lws *wsi, enum
lws_callback_reasons reason,
#if LWS_LIBRARY_VERSION_MAJOR >= 3
case LWS_CALLBACK_TIMER:
if(_lwsc_verbosity>0) {
- LM_DBG("LWS_CALLBACK_TIMER - wsi: %p\n", wsi);
+ LM_DBG("LWS_CALLBACK_TIMER: %d - wsi: %p\n", reason, wsi);
}
// lws_callback_on_writable(wsi);
break;