HttpServerExchange terminateResponse ( ) { int oldVal = state ; if ( allAreSet ( oldVal , FLAG_RESPONSE_TERMINATED ) ) { // idempotent return this ; } if ( responseChannel != null ) { responseChannel . responseDone ( ) ; } this . state = oldVal | FLAG_RESPONSE_TERMINATED ; if ( anyAreSet ( oldVal , FLAG_REQUEST_TERMINATED ) ) { invokeExchangeCompleteListeners ( ) ; } return this ; }
Force the codec to treat the response as fully written . Should only be invoked by handlers which downgrade the socket or implement a transfer coding .