Only drop BAR's from the sync if they are no longer interesting

This commit is contained in:
Jeremy Lakeman 2014-01-09 12:27:48 +10:30
parent 1d88df594b
commit 64fe96ebfa
4 changed files with 6 additions and 5 deletions

View File

@ -624,8 +624,8 @@ int rhizome_update_file_priority(const char *fileid);
enum rhizome_bundle_status rhizome_find_duplicate(const rhizome_manifest *m, rhizome_manifest **found);
int rhizome_manifest_to_bar(rhizome_manifest *m,unsigned char *bar);
uint64_t rhizome_bar_version(const unsigned char *bar);
uint64_t rhizome_bar_bidprefix_ll(unsigned char *bar);
int rhizome_is_bar_interesting(unsigned char *bar);
uint64_t rhizome_bar_bidprefix_ll(const unsigned char *bar);
int rhizome_is_bar_interesting(const unsigned char *bar);
int rhizome_is_manifest_interesting(rhizome_manifest *m);
int rhizome_retrieve_manifest(const rhizome_bid_t *bid, rhizome_manifest *m);
int rhizome_retrieve_manifest_by_prefix(const unsigned char *prefix, unsigned prefix_len, rhizome_manifest *m);

View File

@ -2089,7 +2089,7 @@ static int is_interesting(const char *id_hex, uint64_t version)
OUT();
}
int rhizome_is_bar_interesting(unsigned char *bar)
int rhizome_is_bar_interesting(const unsigned char *bar)
{
uint64_t version = rhizome_bar_version(bar);
char id_hex[RHIZOME_BAR_PREFIX_BYTES *2 + 2];

View File

@ -129,7 +129,7 @@ uint64_t rhizome_bar_version(const unsigned char *bar)
/* This function only displays the first 8 bytes, and should not be used
for comparison. */
uint64_t rhizome_bar_bidprefix_ll(unsigned char *bar)
uint64_t rhizome_bar_bidprefix_ll(const unsigned char *bar)
{
uint64_t bidprefix=0;
int i;

View File

@ -388,7 +388,8 @@ static void sync_send_response(struct subscriber *dest, int forwards, uint64_t t
if (rowid>max_token){
// a new bundle has been imported
rhizome_sync_bundle_inserted(bar);
if (!rhizome_is_bar_interesting(bar))
rhizome_sync_bundle_inserted(bar);
}
if (count < max_count){