]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
cloud: remove useless hash checks
authornorbert.bizet <norbert.bizet@baculasystems.com>
Mon, 28 Mar 2022 14:16:33 +0000 (10:16 -0400)
committerEric Bollengier <eric@baculasystems.com>
Tue, 29 Mar 2022 09:27:37 +0000 (11:27 +0200)
bacula/src/stored/cloud_dev.c
bacula/src/stored/dircmd.c

index c495ae3e548c96e8b7bd750cfded676b3a7ce9d8..155c9b47971576ce72adb17bdd47b778f18ac24e 100644 (file)
@@ -1807,11 +1807,7 @@ bool cloud_dev::truncate(DCR *dcr)
       part->index = tpkt->m_part;
       part->mtime = tpkt->m_res_mtime;
       part->size  = tpkt->m_res_size;
-      if (tpkt->m_hash64) {
-         memcpy(part->hash64, tpkt->m_hash64, 64);
-      } else {
-         bmemzero(part->hash64, 64);
-      }
+      memcpy(part->hash64, tpkt->m_hash64, 64);
       iuploads->put(part->index, part);
    }
    /* returns the list of items to truncate : cloud parts-uploads*/
index 8bd7e70e12467677dbeb1ddf38f846b2631b6657..c48b4f8ae09b3c721d357bb2b6a0e2b5080479e2 100644 (file)
@@ -849,11 +849,7 @@ static bool cloud_list_cmd(JCR *jcr)
       for (int i=1; i <= parts.last_index() ; i++) {
          cloud_part *p = (cloud_part *)parts.get(i);
          if (p) {
-            if (p->hash64) {
-               dir->fsend("part=%d size=%lld mtime=%lld hash=%s\n", i, p->size, p->mtime, p->hash64);
-            } else { 
-               dir->fsend("part=%d size=%lld mtime=%lld hash=%s\n", i, p->size, p->mtime);
-            }
+            dir->fsend("part=%d size=%lld mtime=%lld hash=%s\n", i, p->size, p->mtime, p->hash64);
             free(p);
          }
       }