Issue #2970 ensure onComplete is called (#2971)

* Issue #2970 ensure onComplete is called
* Cleanup after review - single try

Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
Greg Wilkins 2018-10-20 10:15:05 +11:00 committed by GitHub
parent edc47818e2
commit efdf3c2473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 20 deletions

View File

@ -480,6 +480,8 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
}
case COMPLETE:
{
try
{
if (!_response.isCommitted() && !_request.isHandled())
{
@ -503,11 +505,14 @@ public class HttpChannel implements Runnable, HttpOutput.Interceptor
}
}
_response.closeOutput();
}
finally
{
_request.setHandled(true);
_state.onComplete();
onCompleted();
}
break loop;
}