40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
blob_zero(&uuid);
db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid);
if( blob_size(&uuid)!=UUID_SIZE ){
fossil_panic("not a valid rid: %d", rid);
}
content_get(rid, &content);
sha1sum_blob(&content, &hash);
blob_reset(&content);
if( blob_compare(&uuid, &hash) ){
fossil_panic("hash of rid %d does not match its uuid", rid);
}
blob_reset(&uuid);
blob_reset(&hash);
}
/*
**
|
|
>
|
>
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
blob_zero(&uuid);
db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d", rid);
if( blob_size(&uuid)!=UUID_SIZE ){
fossil_panic("not a valid rid: %d", rid);
}
content_get(rid, &content);
sha1sum_blob(&content, &hash);
/* blob_reset(&content); */
if( blob_compare(&uuid, &hash) ){
printf("content=[%s]\n", blob_str(&content));
fossil_panic("hash of rid %d (%b) does not match its uuid (%b)",
rid, &hash, &uuid);
}
blob_reset(&uuid);
blob_reset(&hash);
}
/*
**
|