forked from square/okhttp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug where the response cache could be corrupted.
When streaming a response, we copy data from our buffer to the cached file on disk. Unfortunately we were copying N bytes from the front of the buffer when we wanted N bytes from the back of the buffer. Typically these are the same, but certain access patterns can cause them to be different, corrpting the cached file on disk. This was uncovered by migrating the cache tests from operating on HttpURLConnection's API to our new API.
- Loading branch information
1 parent
c9cc836
commit f80b1f3
Showing
11 changed files
with
2,749 additions
and
845 deletions.
There are no files selected for viewing
1,537 changes: 774 additions & 763 deletions
1,537
okhttp-tests/src/test/java/com/squareup/okhttp/CacheTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.