Skip to content

Commit

Permalink
ctl: reset log prefix on reading ctl traffic
Browse files Browse the repository at this point in the history
- it may be previously set in process by some event route

(cherry picked from commit 5b8b271)
  • Loading branch information
miconda committed Mar 6, 2024
1 parent 42282a2 commit d45c78e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/modules/ctl/fifo_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
Expand Down
3 changes: 3 additions & 0 deletions src/modules/ctl/io_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d45c78e

Please sign in to comment.