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) {
|
} catch (final AsynchronousCloseException e) {
|
||||||
// Doesn't need a user attention - ignore.
|
// Doesn't need a user attention - ignore.
|
||||||
|
channel.currentWriteEvent = evt;
|
||||||
} catch (final Throwable t) {
|
} catch (final Throwable t) {
|
||||||
|
channel.currentWriteEvent = null;
|
||||||
evt.getFuture().setFailure(t);
|
evt.getFuture().setFailure(t);
|
||||||
evt = null;
|
evt = null;
|
||||||
fireExceptionCaught(channel, t);
|
fireExceptionCaught(channel, t);
|
||||||
|
@ -454,13 +454,17 @@ class NioWorker implements Runnable {
|
|||||||
}
|
}
|
||||||
} catch (AsynchronousCloseException e) {
|
} catch (AsynchronousCloseException e) {
|
||||||
// Doesn't need a user attention - ignore.
|
// Doesn't need a user attention - ignore.
|
||||||
|
channel.currentWriteEvent = evt;
|
||||||
|
channel.currentWriteIndex = bufIdx;
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
|
channel.currentWriteEvent = null;
|
||||||
evt.getFuture().setFailure(t);
|
evt.getFuture().setFailure(t);
|
||||||
evt = null;
|
evt = null;
|
||||||
fireExceptionCaught(channel, t);
|
fireExceptionCaught(channel, t);
|
||||||
if (t instanceof IOException) {
|
if (t instanceof IOException) {
|
||||||
open = false;
|
open = false;
|
||||||
close(channel, succeededFuture(channel));
|
close(channel, succeededFuture(channel));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user