Made sure NioWorker.cleanUpWriteBuffer() is called even if the worker thread is not running.
This commit is contained in:
parent
b50cc2b025
commit
3a2a7a3a3c
@ -378,6 +378,11 @@ class NioWorker implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void write(final NioSocketChannel channel, boolean mightNeedWakeup) {
|
static void write(final NioSocketChannel channel, boolean mightNeedWakeup) {
|
||||||
|
if (!channel.isConnected()) {
|
||||||
|
cleanUpWriteBuffer(channel);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (mightNeedWakeup) {
|
if (mightNeedWakeup) {
|
||||||
NioWorker worker = channel.getWorker();
|
NioWorker worker = channel.getWorker();
|
||||||
if (worker != null) {
|
if (worker != null) {
|
||||||
@ -397,11 +402,6 @@ class NioWorker implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!channel.isConnected()) {
|
|
||||||
cleanUpWriteBuffer(channel);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final NioSocketChannelConfig cfg = channel.getConfig();
|
final NioSocketChannelConfig cfg = channel.getConfig();
|
||||||
final int writeSpinCount = cfg.getWriteSpinCount();
|
final int writeSpinCount = cfg.getWriteSpinCount();
|
||||||
final int maxWrittenBytes;
|
final int maxWrittenBytes;
|
||||||
|
Loading…
Reference in New Issue
Block a user