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 — save some casts · netty/netty@43316cd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • handler/src/main/java/io/netty/handler/stream
    • ChunkedWriteHandler.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎handler/src/main/java/io/netty/handler/stream/ChunkedWriteHandler.java‎

Copy file name to clipboardExpand all lines: handler/src/main/java/io/netty/handler/stream/ChunkedWriteHandler.java
+6-8Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ private void doFlush(final ChannelHandlerContext ctx) {
286286
ChannelFuture f = ctx.writeAndFlush(message);
287287
if (endOfInput) {
288288
if (f.isDone()) {
289-
handleEndOfInputFuture(f, currentWrite);
289+
handleEndOfInputFuture(f, chunks, currentWrite);
290290
} else {
291291
// Register a listener which will close the input once the write is complete.
292292
// This is needed because the Chunk may have some resource bound that can not
@@ -296,19 +296,19 @@ private void doFlush(final ChannelHandlerContext ctx) {
296296
f.addListener(new ChannelFutureListener() {
297297
@Override
298298
public void operationComplete(ChannelFuture future) {
299-
handleEndOfInputFuture(future, currentWrite);
299+
handleEndOfInputFuture(future, chunks, currentWrite);
300300
}
301301
});
302302
}
303303
} else {
304304
final boolean resume = !channel.isWritable();
305305
if (f.isDone()) {
306-
handleFuture(f, currentWrite, resume);
306+
handleFuture(f, chunks, currentWrite, resume);
307307
} else {
308308
f.addListener(new ChannelFutureListener() {
309309
@Override
310310
public void operationComplete(ChannelFuture future) {
311-
handleFuture(future, currentWrite, resume);
311+
handleFuture(future, chunks, currentWrite, resume);
312312
}
313313
});
314314
}
@@ -331,8 +331,7 @@ public void operationComplete(ChannelFuture future) {
331331
}
332332
}
333333

334-
private static void handleEndOfInputFuture(ChannelFuture future, PendingWrite currentWrite) {
335-
ChunkedInput<?> input = (ChunkedInput<?>) currentWrite.msg;
334+
private static void handleEndOfInputFuture(ChannelFuture future, ChunkedInput<?> input, PendingWrite currentWrite) {
336335
if (!future.isSuccess()) {
337336
closeInput(input);
338337
currentWrite.fail(future.cause());
@@ -346,8 +345,7 @@ private static void handleEndOfInputFuture(ChannelFuture future, PendingWrite cu
346345
}
347346
}
348347

349-
private void handleFuture(ChannelFuture future, PendingWrite currentWrite, boolean resume) {
350-
ChunkedInput<?> input = (ChunkedInput<?>) currentWrite.msg;
348+
private void handleFuture(ChannelFuture future, ChunkedInput<?> input, PendingWrite currentWrite, boolean resume) {
351349
if (!future.isSuccess()) {
352350
closeInput(input);
353351
currentWrite.fail(future.cause());

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.