Skip to content

Commit

Permalink
Simplify usage of PendingWriteQueue (java-native-access#210)
Browse files Browse the repository at this point in the history
Motivation:

We can simplify the usage of PendingWriteQueue by directly pass the Channel to the constructor

Modifications:

Change constructor usage

Result:

Cleanup
  • Loading branch information
normanmaurer authored Mar 9, 2021
1 parent f31908e commit 6d4a105
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelId;
import io.netty.channel.ChannelMetadata;
import io.netty.channel.ChannelOutboundBuffer;
Expand Down Expand Up @@ -85,11 +84,9 @@ final class QuicheQuicStreamChannel extends DefaultAttributeMap implements QuicS
// TODO: add some overrides maybe ?
};
config = new QuicheQuicStreamChannelConfig(this);
// Add a noop handler to the pipeline so we can construct the PendingWriteQueue.
this.pipeline.addLast(new ChannelHandlerAdapter() { });
queue = new PendingWriteQueue(pipeline.firstContext());
this.address = new QuicStreamAddress(streamId);
this.closePromise = newPromise();
queue = new PendingWriteQueue(this);
// Local created unidirectional streams have the input shutdown by spec. There will never be any data for
// these to be read.
if (parent.streamType(streamId) == QuicStreamType.UNIDIRECTIONAL && parent.isStreamLocalCreated(streamId)) {
Expand Down

0 comments on commit 6d4a105

Please sign in to comment.