int32_t n;
char Job[MAX_NAME_LENGTH];
char MsgType[20];
- int type, level;
+ int type;
+ utime_t mtime; /* message time */
JCR *jcr = bs->jcr();
char *msg;
for (;;) {
n = bs->recv();
- Dmsg2(300, "bget_dirmsg %d: %s\n", n, bs->msg);
+ Dmsg2(100, "bget_dirmsg %d: %s\n", n, bs->msg);
if (is_bnet_stop(bs)) {
return n; /* error or terminate */
/*
* Here we are expecting a message of the following format:
* Jmsg Job=nnn type=nnn level=nnn Message-string
+ * Note, level should really be mtime, but that changes
+ * the protocol.
*/
if (bs->msg[0] == 'J') { /* Job message */
- if (sscanf(bs->msg, "Jmsg Job=%127s type=%d level=%d",
- Job, &type, &level) != 3) {
+ if (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;
}
msg++; /* skip leading space */
}
Dmsg1(900, "Dispatch msg: %s", msg);
- dispatch_message(jcr, type, level, msg);
+ dispatch_message(jcr, type, mtime, msg);
continue;
}
/*
catalog_update(jcr, bs);
continue;
}
+ if (bs->msg[0] == 'B') { /* SD sending file spool attributes */
+ Dmsg2(100, "Blast attributes jcr 0x%x: %s", jcr, bs->msg);
+ char filename[256];
+ if (sscanf(bs->msg, "BlastAttr Job=%127s File=%255s",
+ Job, filename) != 2) {
+ Jmsg1(jcr, M_ERROR, 0, _("Malformed message: %s\n"), bs->msg);
+ continue;
+ }
+ unbash_spaces(filename);
+ if (despool_attributes_from_file(jcr, filename)) {
+ bs->fsend("1000 OK BlastAttr\n");
+ } else {
+ bs->fsend("1990 ERROR BlastAttr\n");
+ }
+ continue;
+ }
if (bs->msg[0] == 'M') { /* Mount request */
Dmsg1(900, "Mount req: %s", bs->msg);
mount_request(jcr, bs, msg);