From 8d9ee2e09c19031ba6bafd75a4aeaac21b296706 Mon Sep 17 00:00:00 2001 From: Jorge Gea Date: Fri, 23 Sep 2022 13:21:42 +0200 Subject: [PATCH] meta-plugin: Added extra debug about data size. Fixed hello plugin with latest parameters --- bacula/src/plugins/fd/pluginlib/ptcomm.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bacula/src/plugins/fd/pluginlib/ptcomm.cpp b/bacula/src/plugins/fd/pluginlib/ptcomm.cpp index 174e70e15..22a84e727 100644 --- a/bacula/src/plugins/fd/pluginlib/ptcomm.cpp +++ b/bacula/src/plugins/fd/pluginlib/ptcomm.cpp @@ -155,11 +155,13 @@ bool PTCOMM::recvbackend_data(bpContext *ctx, char *buf, int32_t nbytes) { int status; int rbytes = 0; + int ebytes = nbytes; struct timeval _timeout; _timeout.tv_sec = m_timeout > 0 ? m_timeout : PTCOMM_DEFAULT_TIMEOUT; _timeout.tv_usec = 0; + while (nbytes > 0) { fd_set rfds; @@ -228,6 +230,8 @@ bool PTCOMM::recvbackend_data(bpContext *ctx, char *buf, int32_t nbytes) } } + DMSG2(ctx, DDEBUG, "Data read. Expected=%d. Read=%d\n", ebytes, rbytes); + return true; } @@ -526,8 +530,8 @@ int32_t PTCOMM::handle_payload(bpContext *ctx, char *buf, int32_t nbytes) f_eod = f_error = f_fatal = true; return -1; } - char bindata[17]; - DMSG1(ctx, DDEBUG, "RECV> %s\n", asciidump(buf, nbytes, bindata, 17)); + char bindata[32]; + DMSG1(ctx, DDEBUG, "RECV> %s\n", asciidump(buf, nbytes, bindata, 32)); return nbytes; } -- 2.47.3