projects
/
cumulus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add some further documentation on the sftp backend
[cumulus.git]
/
subfile.cc
diff --git
a/subfile.cc
b/subfile.cc
index
f365c4b
..
4f8d0fe
100644
(file)
--- a/
subfile.cc
+++ b/
subfile.cc
@@
-23,6
+23,7
@@
* referenced from the new metadata log. */
#include <stdlib.h>
* referenced from the new metadata log. */
#include <stdlib.h>
+#include <string.h>
#include <assert.h>
#include <arpa/inet.h>
#include <assert.h>
#include <arpa/inet.h>
@@
-194,6
+195,12
@@
void Subfile::store_block_signatures(ObjectReference ref, block_summary summary)
free(packed);
}
free(packed);
}
+void Subfile::store_analyzed_signatures(ObjectReference ref)
+{
+ if (analyzed_len >= 16384)
+ store_block_signatures(ref, new_block_summary);
+}
+
/* Compute an incremental representation of the most recent block analyzed. */
enum subfile_item_type { SUBFILE_COPY, SUBFILE_NEW };
/* Compute an incremental representation of the most recent block analyzed. */
enum subfile_item_type { SUBFILE_COPY, SUBFILE_NEW };
@@
-264,7
+271,8
@@
list<ObjectReference> Subfile::create_incremental(TarSegmentStore *tss,
o->write(tss);
ObjectReference ref = o->get_ref();
db->StoreObject(ref, block_csum, analyzed_len, block_age);
o->write(tss);
ObjectReference ref = o->get_ref();
db->StoreObject(ref, block_csum, analyzed_len, block_age);
- store_block_signatures(ref, new_block_summary);
+ store_analyzed_signatures(ref);
+ ref.set_range(0, analyzed_len, true);
refs.push_back(ref);
delete o;
return refs;
refs.push_back(ref);
delete o;
return refs;