diff options
author | Koushik Dutta <koushd@gmail.com> | 2014-12-01 19:10:14 -0800 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2014-12-01 19:10:14 -0800 |
commit | 9bbb4bcd46390b492836c309a52abfe2b15ed718 (patch) | |
tree | 47fa15805f1ff119a8a8e1df9d550e6ed87b26a6 /AndroidAsync | |
parent | de52c3676ba1b07155c4a80ceccbf235df880bc1 (diff) | |
download | AndroidAsync-9bbb4bcd46390b492836c309a52abfe2b15ed718.tar.gz AndroidAsync-9bbb4bcd46390b492836c309a52abfe2b15ed718.tar.bz2 AndroidAsync-9bbb4bcd46390b492836c309a52abfe2b15ed718.zip |
Response cache close should clean up the cached stream.
This prevents noisy data coming through.
Diffstat (limited to 'AndroidAsync')
-rw-r--r-- | AndroidAsync/src/com/koushikdutta/async/http/cache/ResponseCacheMiddleware.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/AndroidAsync/src/com/koushikdutta/async/http/cache/ResponseCacheMiddleware.java b/AndroidAsync/src/com/koushikdutta/async/http/cache/ResponseCacheMiddleware.java index 007dcd7..614ba40 100644 --- a/AndroidAsync/src/com/koushikdutta/async/http/cache/ResponseCacheMiddleware.java +++ b/AndroidAsync/src/com/koushikdutta/async/http/cache/ResponseCacheMiddleware.java @@ -475,6 +475,12 @@ public class ResponseCacheMiddleware extends SimpleMiddleware { } @Override + public void close() { + StreamUtility.closeQuietly(cacheResponse.getBody()); + super.close(); + } + + @Override protected void report(Exception e) { // a 304 response will immediate call report/end since there is no body. // prevent this from happening by waiting for the actual body to be spit out. |