Skip to content

Commit 1752f15

Browse files
committed
Merge branch '1084-buffer-leak' into 4.x
[resolves #1084]
2 parents abf1a55 + c8805b8 commit 1752f15

File tree

1 file changed

+7
-0
lines changed
  • cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/util

1 file changed

+7
-0
lines changed

cloudfoundry-client-reactor/src/main/java/org/cloudfoundry/reactor/util/Operator.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ public ResponseReceiver addChannelHandler(Function<HttpClientResponse, ChannelHa
159159
public Mono<HttpClientResponse> get() {
160160
return this.responseReceiver.responseConnection((response, connection) -> Mono.just(HttpClientResponseWithConnection.of(connection, response)))
161161
.transform(this::processResponse)
162+
.flatMap(httpClientResponseWithConnection -> {
163+
Connection connection = httpClientResponseWithConnection.getConnection();
164+
return ByteBufFlux.fromInbound(connection.inbound().receive()
165+
.doFinally(signalType -> connection.dispose()))
166+
.then()
167+
.thenReturn(httpClientResponseWithConnection);
168+
})
162169
.map(HttpClientResponseWithConnection::getResponse)
163170
.singleOrEmpty();
164171
}

0 commit comments

Comments
 (0)