]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/fd_plugins.c
Turn off plugin debug
[bacula/bacula] / bacula / src / filed / fd_plugins.c
index beefdef0c6fedd11519a2940b86de64a8a690d4c..ca7aad1f2d922a8cf9b9b451c868d1e4e9a129d9 100644 (file)
@@ -293,11 +293,15 @@ int plugin_save(JCR *jcr, FF_PKT *ff_pkt, bool top_level)
          ff_pkt->link = link.c_str();
          ff_pkt->type = sp.type;
          ff_pkt->object = sp.object;
+         ff_pkt->object_len = sp.object_len;
          if (sp.type == FT_RESTORE_FIRST) {
             ff_pkt->LinkFI = sp.index;     /* restore object index */
          }
          memcpy(&ff_pkt->statp, &sp.statp, sizeof(ff_pkt->statp));
-         Dmsg1(dbglvl, "Save_file: file=%s\n", fname.c_str());
+         Dmsg2(dbglvl, "startBackup returned type=%d, fname=%s\n", sp.type, sp.fname);
+         if (sp.object) {
+            Dmsg2(dbglvl, "index=%d object=%s\n", sp.index, sp.object);
+         }   
          save_file(jcr, ff_pkt, true);
          bRC rc = plug_func(plugin)->endBackupFile(jcr->plugin_ctx);
          if (rc == bRC_More || rc == bRC_OK) {
@@ -346,7 +350,7 @@ bool send_plugin_name(JCR *jcr, BSOCK *sd, bool start)
            sd->bstrerror());
      return false;
    }
-   Dmsg1(50, "send: %s\n", sd->msg);
+   Dmsg1(50, "send plugin name hdr: %s\n", sd->msg);
 
    if (start) {
       /* Send data -- not much */
@@ -360,7 +364,7 @@ bool send_plugin_name(JCR *jcr, BSOCK *sd, bool start)
             sd->bstrerror());
          return false;
    }
-   Dmsg1(dbglvl, "send: %s\n", sd->msg);
+   Dmsg1(dbglvl, "send plugin start/end: %s\n", sd->msg);
    sd->signal(BNET_EOD);            /* indicate end of plugin name data */
    return true;
 }
@@ -493,7 +497,11 @@ int plugin_create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
    rp.RegexWhere = jcr->RegexWhere;
    rp.replace = jcr->replace;
    rp.create_status = CF_ERROR;
-   Dmsg1(dbglvl, "call plugin createFile=%s\n", rp.ofname);
+   Dmsg4(dbglvl, "call plugin createFile stream=%d type=%d LinkFI=%d File=%s\n", 
+         rp.stream, rp.type, rp.LinkFI, rp.ofname);
+   if (rp.attrEx) {
+      Dmsg1(dbglvl, "attrEx=\"%s\"\n", rp.attrEx);
+   }
    rc = plug_func(plugin)->createFile(plugin_ctx, &rp);
    if (rc != bRC_OK) {
       Qmsg2(jcr, M_ERROR, 0, _("Plugin createFile call failed. Stat=%d file=%s\n"),
@@ -509,6 +517,9 @@ int plugin_create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
    if (rp.create_status == CF_CREATED) {
       return rp.create_status;        /* yes, no need to bopen */
    }
+   if (rp.type == FT_RESTORE_FIRST) {
+      return CF_CREATED;
+   }
 
    flags =  O_WRONLY | O_CREAT | O_TRUNC | O_BINARY;
    Dmsg0(dbglvl, "call bopen\n");
@@ -660,7 +671,7 @@ void new_plugins(JCR *jcr)
       Dmsg0(dbglvl, "plugin list is NULL\n");
       return;
    }
-   if (jcr->is_job_canceled()) {
+   if (jcr->is_job_canceled() || jcr->JobId == 0) {
       return;
    }
 
@@ -1034,7 +1045,7 @@ static bRC baculaAddExclude(bpContext *ctx, const char *file)
 {
    JCR *jcr;
    bacula_ctx *bctx;
-   if (ctx) {
+   if (!ctx) {
       return bRC_Error;
    }
    if (!file) {