makew0rld / Forban

Forban is a p2p application for link-local and local area networks. Forban works independently from the Internet and uses only the local area capabilities to announce, discover, search or share files. Forban relies on HTTP and it is "opportunistic".
http://www.foo.be/forban/
1 stars 0 forks source link

File comparison when forbans are updated #1

Open makew0rld opened 5 years ago

makew0rld commented 5 years ago

As can be seen in this line and beyond, the only comparison made on a file basis is whether the local file is smaller or not. This is simplistic and will easily break apart in situations where a remote updated file stays the same size but changes in content, or reduces in size. This should be replaced by a hash per file system, or more eloquently, a full hash tree for each forban, so each file doesn't have to be analyzed.

makew0rld commented 5 years ago

Mentioned it in the original Forban repo here.

makew0rld commented 5 years ago

The hash tree would need to be versioned, to prevent out-of-date nodes from distributing old information. Of course, the versioning could still be faked, but it works within the frail trust everyone model.

How would it be versioned? It could just be that the Forban index file would contain a hash and a version number along with the filepath and size already listed in the index file. Then mirroring nodes would just ensure that the remote file version number is higher then the local one.