We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15e9de4 commit 5d96debCopy full SHA for 5d96deb
1 file changed
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/H2Stream.java
@@ -29,6 +29,7 @@
29
30
import java.io.IOException;
31
import java.nio.ByteBuffer;
32
+import java.nio.channels.CancelledKeyException;
33
import java.nio.charset.CharacterCodingException;
34
import java.util.List;
35
import java.util.concurrent.atomic.AtomicBoolean;
@@ -249,11 +250,13 @@ HandlerFactory<AsyncPushConsumer> getPushHandlerFactory() {
249
250
251
boolean abort() {
252
if (cancelled.compareAndSet(false, true)) {
- channel.requestOutput();
253
- return true;
254
- } else {
255
- return false;
+ try {
+ channel.requestOutput();
+ return true;
256
+ } catch (final CancelledKeyException ignore) {
257
+ }
258
}
259
+ return false;
260
261
262
boolean abortGracefully() throws IOException {
0 commit comments