I provide the whole file (not only diffs) because I think it is easier to understand.
I'm especially interested in:
Do the comments added really reflect the original intention of the commented functionality? In the course of understanding rhizome sync I had to deduce from the source code. I'm in no way an expert in rhizome sync.
Is the general scheduling mechanism chosen acceptable?
The alarm for rhizome_sync_announce is now running all the time, only the interval is changed depending on neighbours available or not.
Additional stati are added for announcements and broken payloads. This was necessary as updates on bundles did not lead to a new announcement, the same for broken/ missing payloads.
Are the renamed function names acceptable? To help me to better understand the functions I tried to give them names that reflect their function and/or associate them to the data structures the function is working on. I only renamed static functions, so no change in the interface.
Is rhizome_exists(&m->filehash) really sufficient to check for a missing or broken payload? See line 713 in rhizome_sync.c.
Does a comparison of two BARs to be done by bcmp(&bar1, &bar2, ..) or is there are better way to compare whether two BARs reference the same bundle? See line 144 in rhizome_sync.c.
What else do I have to make to make my variant of rhizome_sync.c acceptable to the serval project?
As noted by @lakeman in #117 annouce_cli_bundle add "... is not doing it's job when the rhizome store was empty; https://github.com/servalproject/serval-dna/blob/30aa1c16b85a8c8362403d92d9d62b698e461333/rhizome_sync.c#L255"
To make this work I changed rhizome_sync.c to work in my usage scenario. It now passes my own tests and also all of rhizomeprotocol.
Please give comments on the changed file: rhizome_sync.c.txt
I provide the whole file (not only diffs) because I think it is easier to understand.
I'm especially interested in:
Do the comments added really reflect the original intention of the commented functionality? In the course of understanding rhizome sync I had to deduce from the source code. I'm in no way an expert in rhizome sync.
Is the general scheduling mechanism chosen acceptable?
Are the renamed function names acceptable? To help me to better understand the functions I tried to give them names that reflect their function and/or associate them to the data structures the function is working on. I only renamed static functions, so no change in the interface.
Is rhizome_exists(&m->filehash) really sufficient to check for a missing or broken payload? See line 713 in rhizome_sync.c.
Does a comparison of two BARs to be done by bcmp(&bar1, &bar2, ..) or is there are better way to compare whether two BARs reference the same bundle? See line 144 in rhizome_sync.c.
What else do I have to make to make my variant of rhizome_sync.c acceptable to the serval project?
Happy new year Bobby