]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/match_bsr.c
Apply patch from Richard Mortimer to ensure that the number
[bacula/bacula] / bacula / src / stored / match_bsr.c
index b4aa6831c30ba403f32a1762c7fe46d1dccd9640..368ade0acc14221180184d08d6d1943680cb22d0 100755 (executable)
@@ -7,7 +7,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2002-2005 Kern Sibbald
+   Copyright (C) 2002-2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -241,15 +241,16 @@ static BSR *find_smallest_volfile(BSR *found_bsr, BSR *bsr)
 }
 
 /*
- * Called to tell the matcher that the end of
- *   the current file has been reached.
+ * Called after the signature record so that
+ *   we can see if the current bsr has been
+ *   fully processed (i.e. is done).
  *  The bsr argument is not used, but is included
  *    for consistency with the other match calls.
  *
  * Returns: true if we should reposition
  *        : false otherwise.
  */
-bool match_set_eof(BSR *bsr, DEV_RECORD *rec)
+bool is_this_bsr_done(BSR *bsr, DEV_RECORD *rec)
 {
    BSR *rbsr = rec->bsr;
    Dmsg1(300, "match_set %d\n", rbsr != NULL);
@@ -261,7 +262,7 @@ bool match_set_eof(BSR *bsr, DEV_RECORD *rec)
    if (rbsr->count && rbsr->found >= rbsr->count) {
       rbsr->done = true;
       rbsr->root->reposition = true;
-      Dmsg2(500, "match_set_eof reposition count=%d found=%d\n",
+      Dmsg2(500, "is_end_this_bsr set reposition=1 count=%d found=%d\n",
          rbsr->count, rbsr->found);
       return true;
    }
@@ -278,9 +279,12 @@ static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
                      SESSION_LABEL *sessrec, bool done)
 {
    if (bsr->done) {
+      Dmsg0(300, "bsr->done set\n");
       goto no_match;
    }
    if (!match_volume(bsr, bsr->volume, volrec, 1)) {
+      Dmsg2(300, "bsr fail vol=%s != rec vol=%s\n", bsr->volume->VolumeName,
+            volrec->VolumeName);
       goto no_match;
    }
    if (!match_volfile(bsr, bsr->volfile, rec, 1)) {
@@ -326,22 +330,28 @@ static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
     *   the rec->bsr = bsr optimization above.
     */
    if (!match_jobid(bsr, bsr->JobId, sessrec, 1)) {
+      Dmsg0(300, "fail on JobId\n");
       goto no_match;
 
    }
    if (!match_job(bsr, bsr->job, sessrec, 1)) {
+      Dmsg0(300, "fail on Job\n");
       goto no_match;
    }
    if (!match_client(bsr, bsr->client, sessrec, 1)) {
+      Dmsg0(300, "fail on Client\n");
       goto no_match;
    }
    if (!match_job_type(bsr, bsr->JobType, sessrec, 1)) {
+      Dmsg0(300, "fail on Job type\n");
       goto no_match;
    }
    if (!match_job_level(bsr, bsr->JobLevel, sessrec, 1)) {
+      Dmsg0(300, "fail on Job level\n");
       goto no_match;
    }
    if (!match_stream(bsr, bsr->stream, rec, 1)) {
+      Dmsg0(300, "fail on stream\n");
       goto no_match;
    }
    return 1;