From: Radosław Korzeniewski Date: Wed, 5 May 2021 12:29:31 +0000 (+0200) Subject: metaplugin: Fix regression in protocol handling. X-Git-Tag: Release-11.3.2~546 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45360083fcaf0a2ceeee5a485a776bad5243b3e4;p=thirdparty%2Fbacula.git metaplugin: Fix regression in protocol handling. --- diff --git a/bacula/src/plugins/fd/pluginlib/ptcomm.cpp b/bacula/src/plugins/fd/pluginlib/ptcomm.cpp index 88f1cad59..95011138d 100644 --- a/bacula/src/plugins/fd/pluginlib/ptcomm.cpp +++ b/bacula/src/plugins/fd/pluginlib/ptcomm.cpp @@ -387,8 +387,8 @@ int32_t PTCOMM::recvbackend_header(bpContext *ctx, char cmd) continue; default: - DMSG1(ctx, DERROR, "Protocol error. Unknown packet: %c got: %c\n", header.status); - JMSG1(ctx, M_FATAL, "Protocol error. Unknown packet: %c got: %c\n", header.status); + DMSG1(ctx, DERROR, "Protocol error. Unknown packet: %c\n", header.status); + JMSG1(ctx, M_FATAL, "Protocol error. Unknown packet: %c\n", header.status); return -1; } } @@ -582,10 +582,11 @@ int32_t PTCOMM::sendbackend(bpContext *ctx, char cmd, POOLMEM *buf, int32_t len) JMSG0(ctx, M_FATAL, "Problem rendering packet header for command.\n"); return -1; } - // header->length[6] = '\n'; + header->length[6] = '\n'; + char hlendata[17]; char bindata[17]; - DMSG3(ctx, DDEBUG, "SENT: %c %s %s\n", header->status, header->length, asciidump(buf, len, bindata, sizeof(bindata))); + DMSG2(ctx, DDEBUG, "SENT: %s %s\n", asciidump((char*)header, sizeof(PTHEADER), hlendata, sizeof(hlendata)), asciidump(buf, len, bindata, sizeof(bindata))); #ifdef NEED_REVIEW status = sendbackend_data(ctx, (char*)header, len + sizeof(PTHEADER));