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

Fix object size being 0 when retrying request (#14) #16

Merged
merged 1 commit into from
Jul 31, 2016

Conversation

robinst
Copy link
Contributor

@robinst robinst commented Jul 19, 2016

Because the code only put the hash in the cache and not the size, the
size that was sent in a retried request was 0.

Some server implementations check the size, so those requests may fail.

To fix it, also put the size in the cache and use it when creating a
request from the cache.

Because the code only put the hash in the cache and not the size, the
size that was sent in a retried request was 0.

Some server implementations check the size, so those requests may fail.

To fix it, also put the size in the cache and use it when creating a
request from the cache.
@@ -60,7 +60,7 @@ public GitConverter(@NotNull File cachePath, @NotNull File basePath, @NotNull St
.mmapFileEnable()
.cacheSoftRefEnable()
.make();
cacheSha256 = cache.getHashMap("sha256");
cacheMeta = cache.getHashMap("meta");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the name so that it works for old cache files too.

@bozaro bozaro merged commit 7bb943a into bozaro:master Jul 31, 2016
@bozaro
Copy link
Owner

bozaro commented Jul 31, 2016

It's really good change. Thanks a lot 👍

@bozaro
Copy link
Owner

bozaro commented Jul 31, 2016

Sorry for delay. I was offline for two weeks.

@robinst robinst deleted the fix-object-size-from-cache branch August 18, 2016 17:43
@robinst
Copy link
Contributor Author

robinst commented Aug 18, 2016

No worries, thanks! :)

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

Successfully merging this pull request may close these issues.

2 participants