Rename Unsafe.directOutboundContext to headContext
This commit is contained in:
parent
3a2b099e4b
commit
8bb6d5b303
|
@ -544,7 +544,7 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||
}
|
||||
|
||||
@Override
|
||||
public final ChannelHandlerContext directOutboundContext() {
|
||||
public final ChannelHandlerContext headContext() {
|
||||
return pipeline.head;
|
||||
}
|
||||
|
||||
|
@ -849,7 +849,7 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||
|
||||
private int outboundBufSize() {
|
||||
final int bufSize;
|
||||
final ChannelHandlerContext ctx = directOutboundContext();
|
||||
final ChannelHandlerContext ctx = headContext();
|
||||
if (metadata().bufferType() == BufType.BYTE) {
|
||||
bufSize = ctx.outboundByteBuffer().readableBytes();
|
||||
} else {
|
||||
|
@ -895,7 +895,7 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
|||
}
|
||||
|
||||
inFlushNow = true;
|
||||
ChannelHandlerContext ctx = directOutboundContext();
|
||||
ChannelHandlerContext ctx = headContext();
|
||||
Throwable cause = null;
|
||||
try {
|
||||
if (metadata().bufferType() == BufType.BYTE) {
|
||||
|
|
|
@ -173,10 +173,9 @@ public interface Channel extends AttributeMap, ChannelOutboundInvoker, ChannelPr
|
|||
*/
|
||||
interface Unsafe {
|
||||
/**
|
||||
* Return the {@link ChannelHandlerContext} which is directly connected to the outbound of the
|
||||
* underlying transport.
|
||||
* Return the internal {@link ChannelHandlerContext} that is placed before all user handlers.
|
||||
*/
|
||||
ChannelHandlerContext directOutboundContext();
|
||||
ChannelHandlerContext headContext();
|
||||
|
||||
/**
|
||||
* Return a {@link VoidChannelPromise}. This method always return the same instance.
|
||||
|
@ -247,7 +246,7 @@ public interface Channel extends AttributeMap, ChannelOutboundInvoker, ChannelPr
|
|||
void beginRead();
|
||||
|
||||
/**
|
||||
* Flush out all data that was buffered in the buffer of the {@link #directOutboundContext()} and was not
|
||||
* Flush out all data that was buffered in the buffer of the {@link #headContext()} and was not
|
||||
* flushed out yet. After that is done the {@link ChannelFuture} will get notified
|
||||
*/
|
||||
void flush(ChannelPromise promise);
|
||||
|
|
|
@ -382,7 +382,7 @@ public class AioSocketChannel extends AbstractAioChannel implements SocketChanne
|
|||
protected void completed0(T result, AioSocketChannel channel) {
|
||||
channel.writeInProgress = NO_WRITE_IN_PROGRESS;
|
||||
|
||||
ByteBuf buf = channel.unsafe().directOutboundContext().outboundByteBuffer();
|
||||
ByteBuf buf = channel.unsafe().headContext().outboundByteBuffer();
|
||||
if (buf.refCnt() == 0) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user