]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/getmsg.c
Cleanup new timeout code for bconsole
[bacula/bacula] / bacula / src / dird / getmsg.c
index c0237489b46547dd164df760b67b97770829c7ed..60e7aed439ae9c23daa3b4c5539e7996c9372381 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -135,7 +135,7 @@ int bget_dirmsg(BSOCK *bs)
 
    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 */
@@ -236,6 +236,22 @@ int bget_dirmsg(BSOCK *bs)
          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);