Fix bug in AsyncTcpSocketImpl with multiple write calls
@@ -386,7 +386,6 @@ public final class AsyncTcpSocketImpl implements AsyncTcpSocket, NioChannelEvent
return Promise.ofException(CLOSE_EXCEPTION);
}
writeEndOfStream |= buf == null;
- if (write != null) return write;
if (writeBuf == null) {
writeBuf = buf;
@@ -398,6 +397,8 @@ public final class AsyncTcpSocketImpl implements AsyncTcpSocket, NioChannelEvent
}
}
+ if (write != null) return write;
+
try {
doWrite();
} catch (IOException e) {
