fffy2366 / android-query

Automatically exported from code.google.com/p/android-query
0 stars 0 forks source link

Cache incomplete content when network error during httpDo #134

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Make a ajax call which generating file cache, eg. aq.ajax(url, File.class, 
cb);
2. If there is network error during httpDo/copy(entity.getContent(), os, 
getEncoding(entity), (int) entity.getContentLength()), there will be cached 
file with incomplete content.
3. Make another ajax call with same url and cache, eg. aq.ajax(url, File.class, 
expire, cb), AQuery will return success with incomplete content file.

Suggestion:

in httpDo shuold catch exception and remove incomplete cache file

Original issue reported on code.google.com by gebing1...@gmail.com on 7 May 2013 at 8:39