/*
Bacula(R) - The Network Backup Solution
- Copyright (C) 2000-2015 Kern Sibbald
+ Copyright (C) 2000-2018 Kern Sibbald
The original author of Bacula is Kern Sibbald, with contributions
from many others, a complete list can be found in the file AUTHORS.
Public License, v3.0 ("AGPLv3") and some additional permissions and
terms pursuant to its AGPLv3 Section 7.
- This notice must be preserved when any source code is
+ This notice must be preserved when any source code is
conveyed and/or propagated.
Bacula(R) is a registered trademark of Kern Sibbald.
int bget_dirmsg(BSOCK *bs)
{
int32_t n = BNET_TERMINATE;
+ char Job[MAX_NAME_LENGTH];
JobId_t JobId = 0;
char MsgType[20];
int type;
for ( ; !bs->is_stop() && !bs->is_timed_out(); ) {
n = bs->recv();
- Dmsg2(200, "bget_dirmsg %d: %s\n", n, bs->msg);
+ Dmsg4(200, "bget_dirmsg n=%d msglen=%ld is_stop=%d: %s\n", n, bs->msglen, bs->is_stop(), bs->msg);
if (bs->is_stop() || bs->is_timed_out()) {
return n; /* error or terminate */
* Try to fulfill it.
*/
if ((sscanf(bs->msg, "%020s JobId=%ld ", MsgType, &JobId) != 2) &&
+ (sscanf(bs->msg, "%020s Job=%127s ", MsgType, Job) != 2) &&
(sscanf(bs->msg, "%020s Job=x", MsgType) != 1)) {
if (is_msgid(strchr(bs->msg, '['))) {
return n;
* the protocol.
*/
if (bs->msg[0] == 'J') { /* Job message */
- if (sscanf(bs->msg, "Jmsg JobId=%ld type=%d level=%lld",
- &JobId, &type, &mtime) != 3) {
+ if ((sscanf(bs->msg, "Jmsg JobId=%ld type=%d level=%lld",
+ &JobId, &type, &mtime) != 3) &&
+ (sscanf(bs->msg, "Jmsg Job=%127s type=%d level=%lld",
+ Job, &type, &mtime) != 3)) {
Jmsg1(jcr, M_ERROR, 0, _("Malformed message: %s\n"), bs->msg);
continue;
}
uint64_t bytes;
if ((sscanf(bs->msg, "Progress JobId=%ld files=%ld bytes=%lld bps=%ld\n",
&JobId, &files, &bytes, &bps) == 4) ||
+ (sscanf(bs->msg, "Progress JobId=x files=%ld bytes=%lld bps=%ld\n",
+ &files, &bytes, &bps) == 3) ||
(sscanf(bs->msg, "Progress Job=x files=%ld bytes=%lld bps=%ld\n",
&files, &bytes, &bps) == 3)) {
Dmsg2(900, "JobId=%d %s", jcr->JobId, bs->msg);