GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add comments · netty/netty@341d4e7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • codec-classes-quic/src/main/java/io/netty/handler/codec/quic
    • QuicheQuicStreamChannel.java
  • codec-http2/src/main/java/io/netty/handler/codec/http2
    • AbstractHttp2StreamChannel.java
  • codec-http3/src/main/java/io/netty/handler/codec/http3
    • Http3ControlStreamInboundHandler.java
    • Http3RequestStreamInboundHandler.java
  • testsuite/src/main/java/io/netty/testsuite/transport/socket
    • SocketShutdownOutputBySelfTest.java
  • transport/src/main/java/io/netty/channel
    • AbstractChannel.java
    • ChannelOutboundHandler.java
    • DefaultChannelPipeline.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicStreamChannel.java‎

Copy file name to clipboardExpand all lines: codec-classes-quic/src/main/java/io/netty/handler/codec/quic/QuicheQuicStreamChannel.java
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ public void shutdown(ChannelShutdownType type, ChannelPromise promise) {
398398
}
399399

400400
if (write) {
401+
if (outputShutdown) {
402+
promise.setSuccess();
403+
return;
404+
}
401405
ioTransport.writeWithoutCheckChannelState(QuicStreamFrame.EMPTY_FIN, newPromise()
402406
.addListener(f -> {
403407
if (f.isSuccess()) {
@@ -412,6 +416,10 @@ public void shutdown(ChannelShutdownType type, ChannelPromise promise) {
412416
}));
413417
ioTransport.flush();
414418
} else {
419+
if (inputShutdown) {
420+
promise.setSuccess();
421+
return;
422+
}
415423
int error;
416424
if (type.data() == null) {
417425
error = 0;
Collapse file

‎codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java‎

Copy file name to clipboardExpand all lines: codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ public boolean visit(Http2FrameStream stream) {
7171
};
7272

7373
static final Http2FrameStreamVisitor CHANNEL_INPUT_SHUTDOWN_READ_COMPLETE_VISITOR =
74-
new UserEventStreamVisitor(ChannelShutdownType.newInbound());
74+
new ShutdownEventVisitor(ChannelShutdownType.newInbound());
7575

7676
static final Http2FrameStreamVisitor CHANNEL_OUTPUT_SHUTDOWN_EVENT_VISITOR =
77-
new UserEventStreamVisitor(ChannelShutdownType.newOutbound());
77+
new ShutdownEventVisitor(ChannelShutdownType.newOutbound());
7878

7979
static final Http2FrameStreamVisitor SSL_CLOSE_COMPLETION_EVENT_VISITOR = new Http2FrameStreamVisitor() {
8080
@Override
@@ -97,11 +97,11 @@ public boolean visit(Http2FrameStream stream) {
9797
/**
9898
* {@link Http2FrameStreamVisitor} that fires the user event for every active stream pipeline.
9999
*/
100-
private static final class UserEventStreamVisitor implements Http2FrameStreamVisitor {
100+
private static final class ShutdownEventVisitor implements Http2FrameStreamVisitor {
101101

102102
private final ChannelShutdownType type;
103103

104-
UserEventStreamVisitor(ChannelShutdownType type) {
104+
ShutdownEventVisitor(ChannelShutdownType type) {
105105
this.type = checkNotNull(type, "type");
106106
}
107107

Collapse file

‎codec-http3/src/main/java/io/netty/handler/codec/http3/Http3ControlStreamInboundHandler.java‎

Copy file name to clipboardExpand all lines: codec-http3/src/main/java/io/netty/handler/codec/http3/Http3ControlStreamInboundHandler.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public final void channelActive(ChannelHandlerContext ctx) {
247247

248248
@Override
249249
public void channelShutdown(ChannelHandlerContext ctx, ChannelShutdownType type) {
250-
//streamClosed(ctx);
250+
streamClosed(ctx);
251251
if (type.direction() == ChannelShutdownDirection.Inbound) {
252252
// See https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#section-4.2
253253
criticalStreamClosed(ctx);
Collapse file

‎codec-http3/src/main/java/io/netty/handler/codec/http3/Http3RequestStreamInboundHandler.java‎

Copy file name to clipboardExpand all lines: codec-http3/src/main/java/io/netty/handler/codec/http3/Http3RequestStreamInboundHandler.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public void channelShutdown(ChannelHandlerContext ctx, ChannelShutdownType type)
5151
if (type.direction() == ChannelShutdownDirection.Inbound) {
5252
channelInputClosed(ctx);
5353
}
54+
ctx.fireChannelShutdown(type);
5455
}
5556

5657
@Override
Collapse file

‎testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketShutdownOutputBySelfTest.java‎

Copy file name to clipboardExpand all lines: testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketShutdownOutputBySelfTest.java
+3-22Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -228,25 +228,10 @@ public void run(Bootstrap bootstrap) throws Throwable {
228228
}
229229

230230
public void testShutdownOutputSoLingerNoAssertError(Bootstrap cb) throws Throwable {
231-
testShutdownSoLingerNoAssertError0(cb, true);
231+
testShutdownSoLingerNoAssertError0(cb);
232232
}
233233

234-
@Test
235-
@Timeout(value = 30000, unit = TimeUnit.MILLISECONDS)
236-
public void testShutdownSoLingerNoAssertError(TestInfo testInfo) throws Throwable {
237-
run(testInfo, new Runner<Bootstrap>() {
238-
@Override
239-
public void run(Bootstrap bootstrap) throws Throwable {
240-
testShutdownSoLingerNoAssertError(bootstrap);
241-
}
242-
});
243-
}
244-
245-
public void testShutdownSoLingerNoAssertError(Bootstrap cb) throws Throwable {
246-
testShutdownSoLingerNoAssertError0(cb, false);
247-
}
248-
249-
private void testShutdownSoLingerNoAssertError0(Bootstrap cb, boolean output) throws Throwable {
234+
private void testShutdownSoLingerNoAssertError0(Bootstrap cb) throws Throwable {
250235
ServerSocket ss = new ServerSocket();
251236
Socket s = null;
252237

@@ -259,11 +244,7 @@ private void testShutdownSoLingerNoAssertError0(Bootstrap cb, boolean output) th
259244

260245
cf.sync();
261246

262-
if (output) {
263-
cf.channel().shutdown(ChannelShutdownType.newOutbound()).sync();
264-
} else {
265-
cf.channel().shutdown(ChannelShutdownType.newOutbound()).sync();
266-
}
247+
cf.channel().shutdown(ChannelShutdownType.newOutbound()).sync();
267248
} finally {
268249
if (s != null) {
269250
s.close();
Collapse file

‎transport/src/main/java/io/netty/channel/AbstractChannel.java‎

Copy file name to clipboardExpand all lines: transport/src/main/java/io/netty/channel/AbstractChannel.java
-9Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ public void shutdown(ChannelShutdownType type, ChannelPromise promise) {
399399
}
400400
safeCascade(f, promise);
401401
if (f.isSuccess() && type.direction() == ChannelShutdownDirection.Outbound) {
402-
// TODO: IS this correct ?
403402
pipeline().fireChannelShutdown(ChannelShutdownType.newOutbound());
404403
}
405404
}));
@@ -751,13 +750,6 @@ public void run() {
751750
public void read() {
752751
assertEventLoop();
753752

754-
/*
755-
if (isShutdown(ChannelShutdownDirection.Inbound)) {
756-
// Input was shutdown so not try to read.
757-
return;
758-
}
759-
*/
760-
761753
try {
762754
doBeginRead();
763755
} catch (final Exception e) {
@@ -984,7 +976,6 @@ private void shutdownOutput(final ChannelPromise promise, Throwable cause) {
984976

985977
ioTransport.safeCascade(f, promise);
986978
outboundBuffer.failFlushedAndClose(shutdownCause, false, shutdownCause, true);
987-
// TODO: Is this correct ?
988979
pipeline().fireChannelShutdown(ChannelShutdownType.newOutbound());
989980
});
990981
doShutdown(ChannelShutdownType.newOutbound(), shutdownPromise);
Collapse file

‎transport/src/main/java/io/netty/channel/ChannelOutboundHandler.java‎

Copy file name to clipboardExpand all lines: transport/src/main/java/io/netty/channel/ChannelOutboundHandler.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ void connect(
100100
* @throws Exception thrown if an error occurs
101101
*/
102102
void flush(ChannelHandlerContext ctx);
103+
103104
/**
104105
* Called once a shutdown operation was requested and should be executed.
105106
*
Collapse file

‎transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java‎

Copy file name to clipboardExpand all lines: transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,9 +1206,8 @@ protected void onUnhandledInboundUserEventTriggered(Object evt) {
12061206
}
12071207

12081208
/**
1209-
* Called once an user event hit the end of the {@link ChannelPipeline} without been handled by the user
1209+
* Called once a shutdown event hit the end of the {@link ChannelPipeline} without been handled by the user
12101210
* in {@link ChannelInboundHandler#channelShutdown(ChannelHandlerContext, ChannelShutdownType)}.
1211-
* This method is responsible to call {@link ReferenceCountUtil#release(Object)} on the given event at some point.
12121211
*/
12131212
protected void onUnhandledInboundChannelShutdown(ChannelShutdownType type) {
12141213
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.