Code Monkey home page Code Monkey logo

Comments (14)

candrews avatar candrews commented on June 21, 2024

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.

tprochazka avatar tprochazka commented on June 21, 2024

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.

tprochazka avatar tprochazka commented on June 21, 2024

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.

dallasgutauckis avatar dallasgutauckis commented on June 21, 2024

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.

iNoles avatar iNoles commented on June 21, 2024

I haven't seen this problem. All I did was close InputStream and disconnect URLConnection.

from httpresponsecache.

dallasgutauckis avatar dallasgutauckis commented on June 21, 2024

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.

dallasgutauckis avatar dallasgutauckis commented on June 21, 2024

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.

dallasgutauckis avatar dallasgutauckis commented on June 21, 2024

See pull request (#10)

from httpresponsecache.

candrews avatar candrews commented on June 21, 2024

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.

candrews avatar candrews commented on June 21, 2024

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.

swankjesse avatar swankjesse commented on June 21, 2024

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.

dallasgutauckis avatar dallasgutauckis commented on June 21, 2024

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.

candrews avatar candrews commented on June 21, 2024

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.

tprochazka avatar tprochazka commented on June 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.