*/
if (!HttpServerResponse.class.isAssignableFrom(msg.getClass())) {
if (msg instanceof ByteBuf) {
ByteBuf content = (ByteBuf) msg;
long contentLength = headers.getContentLength(-1);
if (-1 != contentLength && contentLength == content.readableBytes()) {
if (headerWritten.compareAndSet(false, true)) {
// The passed object (to be written) is a ByteBuf instance and it's readable bytes are equal to the
// content-length header value set.
// So write full response instead of header, content & last HTTP content.
return writeFullResponse((ByteBuf) msg);