diff --git a/common/src/main/java/org/wildfly/httpclient/common/WildflyClientOutputStream.java b/common/src/main/java/org/wildfly/httpclient/common/WildflyClientOutputStream.java index 2dd3376e..1899225f 100644 --- a/common/src/main/java/org/wildfly/httpclient/common/WildflyClientOutputStream.java +++ b/common/src/main/java/org/wildfly/httpclient/common/WildflyClientOutputStream.java @@ -94,16 +94,17 @@ public void handleEvent(StreamSinkChannel streamSinkChannel) { return; } } - lock.notifyAll(); - streamSinkChannel.suspendWrites(); - state &= ~FLAG_WRITING; pooledBuffer.close(); pooledBuffer = null; + if (closed && !streamSinkChannel.flush()) { + return; + } if (closed) { - if (streamSinkChannel.flush()) { - state |= FLAG_DONE; - } + state |= FLAG_DONE; } + streamSinkChannel.suspendWrites(); + state &= ~FLAG_WRITING; + lock.notifyAll(); } } catch (IOException e) { if (pooledBuffer != null) { diff --git a/pom.xml b/pom.xml index 88499327..664db831 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,7 @@ wildfly-http-client-${project.version} 2.3.18.Final + 3.4.3.Final 3.0.4.Final 4.13.2 3.27.3 @@ -407,6 +408,29 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.jboss.logging + jboss-logging + ${version.org.jboss.logging} + + + org.jboss.logging + jboss-logging-annotations + ${version.org.jboss.logging-tools} + + + org.jboss.logging + jboss-logging-processor + ${version.org.jboss.logging-tools} + + + + org.apache.maven.plugins maven-surefire-plugin