Преглед изворни кода

ctl: reset log prefix on reading ctl traffic

- it may be previously set in process by some event route
Daniel-Constantin Mierla пре 1 година
родитељ
комит
5b8b2717ee
2 измењених фајлова са 4 додато и 0 уклоњено
  1. 1 0
      src/modules/ctl/fifo_server.c
  2. 3 0
      src/modules/ctl/io_listener.c

+ 1 - 0
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) */

+ 3 - 0
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;