From 6d4f276911fea80ccc72f833e141509c0e11e547 Mon Sep 17 00:00:00 2001 From: Jeremy Unruh Date: Tue, 14 Jul 2015 22:26:20 -0700 Subject: [PATCH] Issue #411 --- .../storage/object/internal/BaseObjectStorageService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/BaseObjectStorageService.java b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/BaseObjectStorageService.java index b21bed162..174a782fe 100644 --- a/core/src/main/java/org/openstack4j/openstack/storage/object/internal/BaseObjectStorageService.java +++ b/core/src/main/java/org/openstack4j/openstack/storage/object/internal/BaseObjectStorageService.java @@ -1,5 +1,7 @@ package org.openstack4j.openstack.storage.object.internal; +import static org.openstack4j.core.transport.HttpEntityHandler.closeQuietly; + import org.openstack4j.api.types.ServiceType; import org.openstack4j.core.transport.HttpResponse; import org.openstack4j.openstack.internal.BaseOpenStackService; @@ -20,6 +22,10 @@ protected boolean isResponseSuccess(HttpResponse res, int status) { } protected boolean isResponseSuccess(HttpResponse res, int status, boolean closeResponse) { - return res.getStatus() == status; + boolean result = res.getStatus() == status; + if (closeResponse) { + closeQuietly(res); + } + return result; } }