Fixed a bug where AsynchronousCloseException causes IndexOutOfBoundsException during write
This commit is contained in:
parent
94a1633ec9
commit
e0bef12e2c
@ -539,7 +539,9 @@ class NioDatagramWorker implements Runnable {
|
||||
}
|
||||
} catch (final AsynchronousCloseException e) {
|
||||
// Doesn't need a user attention - ignore.
|
||||
channel.currentWriteEvent = evt;
|
||||
} catch (final Throwable t) {
|
||||
channel.currentWriteEvent = null;
|
||||
evt.getFuture().setFailure(t);
|
||||
evt = null;
|
||||
fireExceptionCaught(channel, t);
|
||||
|
@ -454,13 +454,17 @@ class NioWorker implements Runnable {
|
||||
}
|
||||
} catch (AsynchronousCloseException e) {
|
||||
// Doesn't need a user attention - ignore.
|
||||
channel.currentWriteEvent = evt;
|
||||
channel.currentWriteIndex = bufIdx;
|
||||
} catch (Throwable t) {
|
||||
channel.currentWriteEvent = null;
|
||||
evt.getFuture().setFailure(t);
|
||||
evt = null;
|
||||
fireExceptionCaught(channel, t);
|
||||
if (t instanceof IOException) {
|
||||
open = false;
|
||||
close(channel, succeededFuture(channel));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user