gianm commented on a change in pull request #12032:
URL: https://github.com/apache/druid/pull/12032#discussion_r764228382
##########
File path:
core/src/main/java/org/apache/druid/java/util/http/client/response/SequenceInputStreamResponseHandler.java
##########
@@ -102,14 +100,14 @@ public InputStream nextElement()
@Override
public ClientResponse<InputStream> handleChunk(
ClientResponse<InputStream> clientResponse,
- HttpChunk chunk,
+ HttpContent chunk,
long chunkNum
)
{
- final ChannelBuffer channelBuffer = chunk.getContent();
- final int bytes = channelBuffer.readableBytes();
+ final ByteBuf byteBuf = chunk.content();
+ final int bytes = byteBuf.readableBytes();
if (bytes > 0) {
- try (ChannelBufferInputStream channelStream = new
ChannelBufferInputStream(channelBuffer)) {
+ try (ByteBufInputStream channelStream = new ByteBufInputStream(byteBuf))
{
Review comment:
It looks like ChannelBufferInputStream.close does nothing, so it didn't
used to matter. But yeah, this code doesn't look right. It hands off the input
stream and then closes it, which is poor form.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]