Skip to content

Commit 2fbc32a

Browse files
committed
Bug fix: async i/o sessions to not enqueue commands if the underlying channel has been closed
1 parent 9c7841f commit 2fbc32a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

httpcore5/src/main/java/org/apache/hc/core5/reactor/IOSessionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void enqueue(final Command command, final Command.Priority priority) {
111111
} else {
112112
commandQueue.add(command);
113113
}
114-
if (status.get() == Status.ACTIVE) {
114+
if (isOpen()) {
115115
setEvent(SelectionKey.OP_WRITE);
116116
} else {
117117
command.cancel();

httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ public void enqueue(final Command command, final Command.Priority priority) {
773773
this.session.getLock().lock();
774774
try {
775775
this.session.enqueue(command, priority);
776-
if (status == Status.ACTIVE) {
776+
if (isOpen()) {
777777
setEvent(SelectionKey.OP_WRITE);
778778
} else {
779779
command.cancel();

0 commit comments

Comments
 (0)