Revert "Add doOnDiscard hook for streaming mode"

This reverts commit 77a562dfee.

As per findings under
https://github.com/reactor/reactor-netty/issues/1746 it looks this
wasn't the issue and isn't required.
This commit is contained in:
Rossen Stoyanchev 2021-09-02 20:12:41 +01:00
parent 434cbab6a7
commit bec0bb0c53
1 changed files with 5 additions and 7 deletions

View File

@ -141,18 +141,16 @@ public class EncoderHttpMessageWriter<T> implements HttpMessageWriter<T> {
}
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