/* Must create it */
Mmsg(&mdb->cmd,
"INSERT INTO File (FileIndex, JobId, PathId, FilenameId, \
-LStat, MD5) VALUES (%d, %d, %d, %d, '%s', '0')",
- (int)ar->FileIndex, ar->JobId, ar->PathId, ar->FilenameId,
+LStat, MD5) VALUES (%u, %u, %u, %u, '%s', '0')",
+ ar->FileIndex, ar->JobId, ar->PathId, ar->FilenameId,
ar->attr);
if (!INSERT_DB(mdb, mdb->cmd)) {
fd = jcr->file_bsock;
jcr->jr.FirstIndex = 1;
memset(&ar, 0, sizeof(ar));
+ jcr->FileIndex = 0;
Dmsg0(120, "bdird: waiting to receive file attributes\n");
/* Pickup file attributes and signature */
if (stream == STREAM_UNIX_ATTRIBUTES) {
jcr->JobFiles++;
+ jcr->FileIndex = file_index;
ar.attr = attr;
ar.fname = jcr->fname;
- ar.FileIndex = 0; /* used as mark field during compare */
+ ar.FileIndex = file_index;
ar.Stream = stream;
ar.link = NULL;
ar.JobId = jcr->JobId;
jcr->JobStatus = JS_Error;
continue;
}
- jcr->FileIndex = file_index;
jcr->FileId = ar.FileId;
} else if (stream == STREAM_MD5_SIGNATURE) {
if (jcr->FileIndex != (uint32_t)file_index) {
- Jmsg0(jcr, M_ERROR, 0, _("Got MD5 but not same block as attributes\n"));
+ Jmsg2(jcr, M_ERROR, 0, _("MD5 index %d not same as attributes %d\n"),
+ file_index, jcr->FileIndex);
jcr->JobStatus = JS_Error;
continue;
}
char buf[MAXSTRING];
POOLMEM *fname = get_pool_memory(PM_MESSAGE);
int do_MD5 = FALSE;
- long file_index = 0, attr_file_index = 0;
+ long file_index = 0;
memset(&fdbr, 0, sizeof(FILE_DBR));
fd = jcr->file_bsock;
fdbr.JobId = JobId;
+ jcr->FileIndex = 0;
Dmsg0(20, "bdird: waiting to receive file attributes\n");
/*
if (stream == STREAM_UNIX_ATTRIBUTES) {
Dmsg2(400, "file_index=%d attr=%s\n", file_index, attr);
jcr->JobFiles++;
- attr_file_index = file_index; /* remember attribute file_index */
+ jcr->FileIndex = file_index; /* remember attribute file_index */
decode_stat(attr, &statf); /* decode file stat packet */
do_MD5 = FALSE;
jcr->fn_printed = FALSE;
* When ever we get an MD5 signature is MUST have been
* preceded by an attributes record, which sets attr_file_index
*/
- if (attr_file_index != file_index) {
+ if (jcr->FileIndex != (uint32_t)file_index) {
Jmsg2(jcr, M_FATAL, 0, _("MD5 index %d not same as attributes %d\n"),
- file_index, attr_file_index);
+ file_index, jcr->FileIndex);
goto bail_out;
}
if (do_MD5) {
}
/* Now find all the files that are missing -- i.e. all files in
- * the database where the FileIndex != current JobId
+ * the database where the MarkedId != current JobId
*/
jcr->fn_printed = FALSE;
sprintf(buf,
/* */
#define VERSION "1.25"
#define VSTRING "1"
-#define DATE "30 August 2002"
-#define LSMDATE "30Aug02"
+#define DATE "01 September 2002"
+#define LSMDATE "01Sep02"
/* Debug flags */
#define DEBUG 1