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 — BrotliEncoder: Prevent duplicate close scheduling (#17175) (#17193) · netty/netty@f4f1b9d

File tree

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

‎codec/src/main/java/io/netty/handler/codec/compression/BrotliEncoder.java‎

Copy file name to clipboardExpand all lines: codec/src/main/java/io/netty/handler/codec/compression/BrotliEncoder.java
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ private static final class Writer implements WritableByteChannel {
187187
private ByteBuf writableBuffer;
188188
private final BrotliEncoderChannel brotliEncoderChannel;
189189
private final ChannelHandlerContext ctx;
190+
private boolean closeInitiated;
190191
private boolean isClosed;
191192

192193
private Writer(Encoder.Parameters parameters, ChannelHandlerContext ctx) throws IOException {
@@ -240,8 +241,11 @@ public boolean isOpen() {
240241

241242
@Override
242243
public void close() {
244+
if (closeInitiated) {
245+
return;
246+
}
247+
closeInitiated = true;
243248
final ChannelPromise promise = ctx.newPromise();
244-
245249
ctx.executor().execute(new Runnable() {
246250
@Override
247251
public void run() {

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.