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 — Merge pull request #637 from losipiuk/3 · netty/netty@4bca917

File tree

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

‎src/main/java/org/jboss/netty/handler/stream/ChunkedWriteHandler.java‎

Copy file name to clipboardExpand all lines: src/main/java/org/jboss/netty/handler/stream/ChunkedWriteHandler.java
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public class ChunkedWriteHandler
8484
private volatile ChannelHandlerContext ctx;
8585
private final AtomicBoolean flush = new AtomicBoolean(false);
8686
private MessageEvent currentEvent;
87+
private volatile boolean flushNeeded;
8788

8889
/**
8990
* Continues to fetch the chunks from the input.
@@ -187,9 +188,10 @@ private void flush(ChannelHandlerContext ctx, boolean fireNow) throws Exception
187188
boolean acquired = false;
188189
final Channel channel = ctx.getChannel();
189190
boolean suspend = false;
190-
191+
flushNeeded = true;
191192
// use CAS to see if the have flush already running, if so we don't need to take futher actions
192193
if (acquired = flush.compareAndSet(false, true)) {
194+
flushNeeded = false;
193195
try {
194196

195197
if (!channel.isConnected()) {
@@ -297,7 +299,7 @@ public void operationComplete(ChannelFuture future) throws Exception {
297299

298300
}
299301

300-
if (acquired && (!channel.isConnected() || channel.isWritable() && !queue.isEmpty() && !suspend)) {
302+
if (acquired && ((!channel.isConnected() || channel.isWritable() && !queue.isEmpty() && !suspend) || flushNeeded)) {
301303
flush(ctx, fireNow);
302304
}
303305
}

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.