Comments (14)
Since you're using ICS, can you see if you can reproduce this bug without using this library?Just comment out the line that says: com.integralblue.httpresponsecache.HttpResponseCache.install(httpCacheDir, httpCacheSize)
from httpresponsecache.
I think that I must replace
com.integralblue.httpresponsecache.HttpResponseCache.install(httpCacheDir, httpCacheSize)
by
android.net.http.HttpResponseCache.install(httpCacheDir, httpCacheSize);
Not only comment out first one.
I will try it.
from httpresponsecache.
I think that this problem exist also on official implementation and I think that it happen when I use debugging more intensive and often kill and start the application. Maybe file cache implementation is not safe if application is killed.
from httpresponsecache.
I'm also seeing this issue. I'm going to look into a patch. This issue exists both in the officially released version and your compatibility version. See http://code.google.com/p/android/issues/detail?id=7787
from httpresponsecache.
I haven't seen this problem. All I did was close InputStream and disconnect URLConnection.
from httpresponsecache.
ResponseHeaders#combine
is where the status line is lost because result does not have a status line set.
result.setStatusLine(headers.getStatusLine());
Fixes the issue just after the creation of the new RawHeaders object. Is that the right implementation, @candrews?
from httpresponsecache.
I'm thinking the status line should probably be of the network's status line (304 Not Modified) instead of the cached (200 OK)
result.setStatusLine(network.headers.getStatusLine());
from httpresponsecache.
See pull request (#10)
from httpresponsecache.
The fix makes sense to me. It seems to me that since this bug also affects ICS's HttpResponseCache implementation, that the same fix should be made there - could you create an issue in the Android bug tracker, and submit this fix to them?
I also asked the original author of this code in the Android project for his thoughts on the fix.
Thanks for you help - I look forward to having this fixed in this compatibility project and in Android itself soon!
from httpresponsecache.
Nevermind - Android already has this fix! See 5d7e0fc1af3141aa41e9c21d74da3c36b933517f in Android libcore
Thanks Jesse!
I'm currently copying all the changes from when I last updated this library, which was android-4.0.1_r1, to now (which is currently android-4.1.1_r3). This fix will be included.
from httpresponsecache.
I think upstream already has a fix:
http://omapzoom.org/?p=platform/libcore.git;a=blob;f=luni/src/main/java/libcore/net/http/ResponseHeaders.java;h=003b4457b95036c3b52136df493366fb527db568;hb=HEAD
update ... and now I read that you've seen that too. Sweet.
from httpresponsecache.
Thanks for looking into it and getting back to me. I saw an issue in the bug tracker that I thought was it but it looked like it was targeted for a much earlier version. I guess it was targeted, but not fixed until recently.
from httpresponsecache.
I finished merging in the Android changes up to version android-4.1.1_r3, and this fix is included. Please test and let me know if this issue occurs again. Thank you!
from httpresponsecache.
Is this failed test related to this issue?
Failed tests: testConditionalHitUpdatesCache(com.integralblue.httpresponsecache.compat.libcore.net.http.HttpResponseCacheTest): null expected:<[A]> but was:<[B]>
from httpresponsecache.
Related Issues (20)
- Cache size surpassing limit HOT 1
- setDefaultHostnameVerifier in install()
- java.lang.NoSuchMethodError: Llibcore/net/http/HttpResponseCache.getCache HOT 3
- Add support for non-shared cache? HOT 4
- Allow pages not ending in newline HOT 3
- gzip Header disappers after a requests with "max-age=0"
- Ability to override uriToKey?
- Responses are not cached HOT 2
- Data not cached when gzip content-encoding is combined with chunked transfer-encoding. HOT 5
- Not respecting max-age: 0 for Cache-Control HOT 1
- NameConstraints use incorrect signature
- java.net.SocketException: sendto failed: EPIPE (Broken pipe)
- DiskLruCache version dependency out of date...
- com.integralblue.httpresponsecache.compat.libcore.net.http.ResponseHeaders.chooseResponseSource(long, RequestHeaders) does not honor only-if-cached cache control directive
- Cache not updated
- incorrect content-length causes problems on ssl connection HOT 1
- PUT request method are not caching HOT 1
- How to avoid installing and closing 'HttpResponseCache' on every Activity and Service?
- can it work with volley? HOT 1
- POST method request throws ProtocolException("POST does not support writing") when use it in Java
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from httpresponsecache.