HTTPCLIENT-1299: (regression) cache incorrectly disposes of the underlying cache resource when storing variant entry (follow-up)
Contributed by James Leigh <james at 3roundstones.com> git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1468823 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5769675b15
commit
456461b1c6
|
@ -1,6 +1,10 @@
|
|||
Changes since release 4.3 BETA1
|
||||
-------------------
|
||||
|
||||
* [HTTPCLIENT-1299] (regression) cache incorrectly disposes of the underlying cache resource
|
||||
when storing variant entry.
|
||||
Contributed by James Leigh <james at 3roundstones.com>
|
||||
|
||||
* [HTTPCLIENT-1342] Redirects with underscore character in the location hostname cause
|
||||
"java.lang.IllegalArgumentException: Host name may not be null".
|
||||
Contributed by Oleg Kalnichevski <olegk at apache.org>
|
||||
|
|
|
@ -199,10 +199,9 @@ class BasicHttpCache implements HttpCache {
|
|||
src = entry;
|
||||
}
|
||||
|
||||
final Resource oldResource = entry.getResource();
|
||||
Resource resource = null;
|
||||
if (oldResource != null) {
|
||||
resource = resourceFactory.copy(requestId, entry.getResource());
|
||||
if (src.getResource() != null) {
|
||||
resource = resourceFactory.copy(requestId, src.getResource());
|
||||
}
|
||||
final Map<String,String> variantMap = new HashMap<String,String>(src.getVariantMap());
|
||||
variantMap.put(variantKey, variantCacheKey);
|
||||
|
|
|
@ -87,11 +87,9 @@ class CacheEntryUpdater {
|
|||
Args.check(response.getStatusLine().getStatusCode() == HttpStatus.SC_NOT_MODIFIED,
|
||||
"Response must have 304 status code");
|
||||
final Header[] mergedHeaders = mergeHeaders(entry, response);
|
||||
final Resource oldResource = entry.getResource();
|
||||
Resource resource = null;
|
||||
if (oldResource != null) {
|
||||
if (entry.getResource() != null) {
|
||||
resource = resourceFactory.copy(requestId, entry.getResource());
|
||||
oldResource.dispose();
|
||||
}
|
||||
return new HttpCacheEntry(
|
||||
requestDate,
|
||||
|
|
Loading…
Reference in New Issue