You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2019/11/27 08:00:38 UTC

[olingo-odata4] branch master updated: OLINGO-999 | Ensuring that payloadManager is closing PipedInputStream in case that http client leaked that.

This is an automated email from the ASF dual-hosted git repository.

mibo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/olingo-odata4.git


The following commit(s) were added to refs/heads/master by this push:
     new cb50f9b  OLINGO-999 | Ensuring that payloadManager is closing PipedInputStream in case that http client leaked that.
cb50f9b is described below

commit cb50f9b769f87ab83549ce20fdc7cf9560b1b732
Author: Bogdan Ilies <bo...@mulesoft.com>
AuthorDate: Tue Apr 3 09:49:37 2018 +0300

    OLINGO-999 | Ensuring that payloadManager is closing PipedInputStream in case that http client leaked that.
    
    Signed-off-by: Bogdan Ilies <bo...@mulesoft.com>
---
 .../request/streamed/AbstractODataStreamedRequest.java      | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/AbstractODataStreamedRequest.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/AbstractODataStreamedRequest.java
index e3f5624..7465a2a 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/AbstractODataStreamedRequest.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/streamed/AbstractODataStreamedRequest.java
@@ -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();
+          }
         }
       }));
     }