Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to understand http_test.go #11

Open
chrislusf opened this issue Sep 16, 2015 · 1 comment
Open

failed to understand http_test.go #11

chrislusf opened this issue Sep 16, 2015 · 1 comment

Comments

@chrislusf
Copy link

I failed to understand this http download example:

https://github.com/Redundancy/go-sync/blob/master/http_test.go#L68

It is using the to-be-downloaded reference data to calculate the referenceFileIndex and checksumLookup, on the client side, to fetch the reference data from the server side?

@Redundancy
Copy link
Owner

In this case, the example is generating the index data that it will need to know what blocks to download, rather than downloading it at the start. I should probably not take that shortcut (or make it clearer).

In some ways, partially because it's leaving out the server side (that the example needs to have a fully working self-contained example) https://github.com/Redundancy/go-sync/blob/master/gosync/patch.go is easier to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants