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:
@@ -141,18 +141,16 @@ public class EncoderHttpMessageWriter<T> implements HttpMessageWriter<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isStreamingMediaType(contentType)) {
|
if (isStreamingMediaType(contentType)) {
|
||||||
return message
|
return message.writeAndFlushWith(body.map(buffer -> {
|
||||||
.writeAndFlushWith(body.map(buffer -> {
|
Hints.touchDataBuffer(buffer, hints, logger);
|
||||||
Hints.touchDataBuffer(buffer, hints, logger);
|
return Mono.just(buffer).doOnDiscard(PooledDataBuffer.class, DataBufferUtils::release);
|
||||||
return Mono.just(buffer).doOnDiscard(PooledDataBuffer.class, DataBufferUtils::release);
|
}));
|
||||||
}))
|
|
||||||
.doOnDiscard(PooledDataBuffer.class, DataBufferUtils::release);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
body = body.doOnNext(buffer -> Hints.touchDataBuffer(buffer, hints, logger));
|
body = body.doOnNext(buffer -> Hints.touchDataBuffer(buffer, hints, logger));
|
||||||
}
|
}
|
||||||
return message.writeWith(body).doOnDiscard(PooledDataBuffer.class, DataBufferUtils::release);
|
return message.writeWith(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
|||||||
Reference in New Issue
Block a user