@miconda commented on this pull request.


> @@ -261,6 +262,24 @@ int wsconn_add(struct receive_info *rcv, unsigned int 
> sub_protocol)
        return 0;
 }
 
+static void wsconn_run_close_callback(ws_connection_t *wsc)
+{
+       sip_msg_t *fmsg;
+       sr_event_param_t evp = {0};
+       if(faked_msg_init() < 0) {
+               LM_ERR("faked_msg_init() failed\n");
+               return;
+       }
+       fmsg = faked_msg_next();
+       wsc->rcv.proto_reserved1 = wsc->id;
+       fmsg->rcv = wsc->rcv;
+

Changes to fmsg content should be avoided, because the structure content is 
reused for following execution cycles, and that can also happen in another 
module.

There is evp.rcv field for the purpose of passing the received info via 
callback, any reason not using it?

The alternative is to backup fmsg->rcv to a local variable and restore after 
the sr_event_exec.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2397#pullrequestreview-447861724
_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to