Module: kamailio
Branch: master
Commit: 5b8b2717ee2f57da932132683b27eb33cea3fd59
URL: 
https://github.com/kamailio/kamailio/commit/5b8b2717ee2f57da932132683b27eb33cea3fd59

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2024-03-04T13:58:35+01:00

ctl: reset log prefix on reading ctl traffic

- it may be previously set in process by some event route

---

Modified: src/modules/ctl/fifo_server.c
Modified: src/modules/ctl/io_listener.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/5b8b2717ee2f57da932132683b27eb33cea3fd59.diff
Patch: 
https://github.com/kamailio/kamailio/commit/5b8b2717ee2f57da932132683b27eb33cea3fd59.patch

---

diff --git a/src/modules/ctl/fifo_server.c b/src/modules/ctl/fifo_server.c
index 772441d31e4..94a700cf50e 100644
--- a/src/modules/ctl/fifo_server.c
+++ b/src/modules/ctl/fifo_server.c
@@ -736,6 +736,7 @@ int fifo_process(char *msg_buf, int size, int 
*bytes_needed, void *sh,
        static rpc_ctx_t context;
        unsigned int rdata;
 
+       log_prefix_set(NULL);
        DBG("process_fifo: called with %d bytes, offset %d: %.*s\n", size,
                        (int)(long)*saved_state, size, msg_buf);
        /* search for the end of the request (\n\r) */
diff --git a/src/modules/ctl/io_listener.c b/src/modules/ctl/io_listener.c
index ed584e4c7f9..3634b63acff 100644
--- a/src/modules/ctl/io_listener.c
+++ b/src/modules/ctl/io_listener.c
@@ -26,6 +26,7 @@
 #include "../../core/mem/mem.h"
 #include "../../core/rpc.h" /* who & ls rpcs */
 #include "../../core/ut.h"
+#include "../../core/action.h"
 #include "../../core/cfg/cfg_struct.h"
 
 #include "ctrl_socks.h"
@@ -346,6 +347,7 @@ static int handle_ctrl_dgram(struct ctrl_socket *cs)
        struct send_handle sh;
        void *saved_state;
 
+       log_prefix_set(NULL);
        saved_state = 0; /* we get always a new datagram */
        sh.fd = cs->fd;
        sh.type = S_DISCONNECTED;
@@ -486,6 +488,7 @@ static int handle_stream_read(struct stream_connection 
*s_c, int idx)
        sh.from_len = 0;
        r = &s_c->req;
        bytes_free = STREAM_BUF_SIZE - (int)(r->end - r->buf);
+       log_prefix_set(NULL);
        if(bytes_free == 0) {
                LOG(L_ERR, "ERROR: handle_stream_read: buffer overrun\n");
                goto close_connection;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to