Skip to content

Commit

Permalink
Revert "Add doOnDiscard hook for streaming mode"
Browse files Browse the repository at this point in the history
This reverts commit 77a562d.

As per findings under
reactor/reactor-netty#1746 it looks this
wasn't the issue and isn't required.
  • Loading branch information
rstoyanchev committed Sep 3, 2021
1 parent 434cbab commit bec0bb0
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,16 @@ public Mono<Void> write(Publisher<? extends T> inputStream, ResolvableType eleme
}

if (isStreamingMediaType(contentType)) {
return message
.writeAndFlushWith(body.map(buffer -> {
Hints.touchDataBuffer(buffer, hints, logger);
return Mono.just(buffer).doOnDiscard(PooledDataBuffer.class, DataBufferUtils::release);
}))
.doOnDiscard(PooledDataBuffer.class, DataBufferUtils::release);
return message.writeAndFlushWith(body.map(buffer -> {
Hints.touchDataBuffer(buffer, hints, logger);
return Mono.just(buffer).doOnDiscard(PooledDataBuffer.class, DataBufferUtils::release);
}));
}

if (logger.isDebugEnabled()) {
body = body.doOnNext(buffer -> Hints.touchDataBuffer(buffer, hints, logger));
}
return message.writeWith(body).doOnDiscard(PooledDataBuffer.class, DataBufferUtils::release);
return message.writeWith(body);
}

@Nullable
Expand Down

0 comments on commit bec0bb0

Please sign in to comment.