Skip to content

Commit

Permalink
OLINGO-999 | Ensuring that payloadManager is closing PipedInputStream…
Browse files Browse the repository at this point in the history
… in case that http client leaked that.

Signed-off-by: Bogdan Ilies <[email protected]>
  • Loading branch information
Bogdan Ilies authored and mibo committed Nov 27, 2019
1 parent 68cfa45 commit cb50f9b
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ public T payloadManager() {
public HttpResponse call() throws Exception { //NOSONAR
((HttpEntityEnclosingRequestBase) request).setEntity(
URIUtils.buildInputStreamEntity(odataClient, payloadManager.getBody()));

return doExecute();
try {
return doExecute();
} finally {
payloadManager.finalizeBody();
}
}
}));
} else {
Expand All @@ -116,7 +119,11 @@ public HttpResponse call() throws Exception { //NOSONAR
futureWrapper.setWrapped(odataClient.getConfiguration().getExecutor().submit(new Callable<HttpResponse>() {
@Override
public HttpResponse call() throws Exception { //NOSONAR
return doExecute();
try {
return doExecute();
} finally {
payloadManager.finalizeBody();
}
}
}));
}
Expand Down

0 comments on commit cb50f9b

Please sign in to comment.