OLINGO-999 | Ensuring that payloadManager is closing PipedInputStream in case that http client leaked that.
Signed-off-by: Bogdan Ilies <bogdan.ilies@mulesoft.com>
This commit is contained in:
parent
68cfa4546d
commit
cb50f9b769
|
@ -105,8 +105,11 @@ public abstract class AbstractODataStreamedRequest<V extends ODataResponse, T ex
|
|||
public HttpResponse call() throws Exception { //NOSONAR
|
||||
((HttpEntityEnclosingRequestBase) request).setEntity(
|
||||
URIUtils.buildInputStreamEntity(odataClient, payloadManager.getBody()));
|
||||
|
||||
return doExecute();
|
||||
try {
|
||||
return doExecute();
|
||||
} finally {
|
||||
payloadManager.finalizeBody();
|
||||
}
|
||||
}
|
||||
}));
|
||||
} else {
|
||||
|
@ -116,7 +119,11 @@ public abstract class AbstractODataStreamedRequest<V extends ODataResponse, T ex
|
|||
futureWrapper.setWrapped(odataClient.getConfiguration().getExecutor().submit(new Callable<HttpResponse>() {
|
||||
@Override
|
||||
public HttpResponse call() throws Exception { //NOSONAR
|
||||
return doExecute();
|
||||
try {
|
||||
return doExecute();
|
||||
} finally {
|
||||
payloadManager.finalizeBody();
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue