]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/accurate.c
update configure
[bacula/bacula] / bacula / src / filed / accurate.c
index 3f917e6173bb057db46922cf29eb89d04640fd30..3a043a399756e224281ecc5103f34dede3db3d10 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2011 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.
@@ -116,7 +116,7 @@ static bool accurate_send_base_file_list(JCR *jcr)
       if (elt->seen) {
          Dmsg2(dbglvl, "base file fname=%s seen=%i\n", elt->fname, elt->seen);
          /* TODO: skip the decode and use directly the lstat field */
-         decode_stat(elt->lstat, &statc, &LinkFIc); /* decode catalog stat */  
+         decode_stat(elt->lstat, &statc, sizeof(statc), &LinkFIc); /* decode catalog stat */  
          ff_pkt->fname = elt->fname;
          ff_pkt->statp = statc;
          encode_and_send_attributes(jcr, ff_pkt, stream);
@@ -158,7 +158,7 @@ static bool accurate_send_deleted_list(JCR *jcr)
       }
       Dmsg2(dbglvl, "deleted fname=%s seen=%i\n", elt->fname, elt->seen);
       /* TODO: skip the decode and use directly the lstat field */
-      decode_stat(elt->lstat, &statc, &LinkFIc); /* decode catalog stat */
+      decode_stat(elt->lstat, &statc, sizeof(statc), &LinkFIc); /* decode catalog stat */
       ff_pkt->fname = elt->fname;
       ff_pkt->statp.st_mtime = statc.st_mtime;
       ff_pkt->statp.st_ctime = statc.st_ctime;
@@ -182,17 +182,22 @@ void accurate_free(JCR *jcr)
 /* Send the deleted or the base file list and cleanup  */
 bool accurate_finish(JCR *jcr)
 {
-   bool ret=true;
+   bool ret = true;
+
+   if (jcr->is_canceled() || jcr->is_incomplete()) {
+      accurate_free(jcr);
+      return ret;
+   }
    if (jcr->accurate) {
-      if (!jcr->incomplete) {
-         if (jcr->is_JobLevel(L_FULL)) {
+      if (jcr->is_JobLevel(L_FULL)) {
+         if (!jcr->rerunning) {
             ret = accurate_send_base_file_list(jcr);
-         } else if (!jcr->incomplete) {
-            ret = accurate_send_deleted_list(jcr);
          }
+      } else {
+         ret = accurate_send_deleted_list(jcr);
       }
       accurate_free(jcr);
-      if (!jcr->incomplete && jcr->is_JobLevel(L_FULL)) {
+      if (jcr->is_JobLevel(L_FULL)) {
          Jmsg(jcr, M_INFO, 0, _("Space saved with Base jobs: %lld MB\n"), 
               jcr->base_size/(1024*1024));
       }
@@ -253,7 +258,7 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
 
    ff_pkt->delta_seq = 0;
 
-   if (!jcr->accurate && !jcr->incomplete) {
+   if (!jcr->accurate && !jcr->rerunning) {
       return true;
    }
 
@@ -278,9 +283,9 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
       goto bail_out;
    }
 
-   decode_stat(elt.lstat, &statc, &LinkFIc); /* decode catalog stat */
+   decode_stat(elt.lstat, &statc, sizeof(statc), &LinkFIc); /* decode catalog stat */
 
-   if (!jcr->incomplete && (jcr->getJobLevel() == L_FULL)) {
+   if (!jcr->rerunning && (jcr->getJobLevel() == L_FULL)) {
       opts = ff_pkt->BaseJobOpts;
    } else {
       opts = ff_pkt->AccurateOpts;
@@ -386,7 +391,7 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
               ff_pkt->flags & (FO_MD5|FO_SHA1|FO_SHA256|FO_SHA512))) 
          {
 
-            if (!*elt.chksum && !jcr->incomplete) {
+            if (!*elt.chksum && !jcr->rerunning) {
                Jmsg(jcr, M_WARNING, 0, _("Cannot verify checksum for %s\n"),
                     ff_pkt->fname);
                stat = true;
@@ -440,8 +445,9 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt)
                   bin_to_base64(digest_buf, BASE64_SIZE(size), md, size, true);
 
                   if (strcmp(digest_buf, elt.chksum)) {
-                     Dmsg3(dbglvl-1, "%s      chksum  diff. Cat: %s File: %s\n",
+                     Dmsg4(dbglvl,"%s      %s chksum  diff. Cat: %s File: %s\n",
                            fname,
+                           digest_name,
                            elt.chksum,
                            digest_buf);
                      stat = true;
@@ -488,7 +494,7 @@ int accurate_cmd(JCR *jcr)
    BSOCK *dir = jcr->dir_bsock;
    int lstat_pos, chksum_pos;
    int32_t nb;
-   uint16_t delta_seq;
+   uint32_t delta_seq;
 
    if (job_canceled(jcr)) {
       return true;