Skip to content

Commit

Permalink
Issue #4331 Close Complete
Browse files Browse the repository at this point in the history
Reworked order of ifs to match logic above in onWriteComplete

Signed-off-by: Greg Wilkins <[email protected]>
  • Loading branch information
gregw committed Dec 18, 2019
1 parent 6872c33 commit b7014a7
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,24 +321,22 @@ else if (_state == State.CLOSE)
LOG.debug("onWriteComplete({},{}) {}->{} c={} cb={} w={}",
last, failure, state, stateString(), BufferUtil.toDetailString(closeContent), closedCallback, wake);

if (failure != null)
_channel.abort(failure);

if (closeContent != null)
{
channelWrite(closeContent, true, new WriteCompleteCB());
return;
}

try
{
if (failure != null)
_channel.abort(failure);

if (closedCallback != null)
{
if (failure == null)
closedCallback.succeeded();
else
closedCallback.failed(failure);
}
else if (closeContent != null)
{
channelWrite(closeContent, true, new WriteCompleteCB());
}
}
finally
{
Expand Down

0 comments on commit b7014a7

Please sign in to comment.