@Override
    protected ChannelFuture write(HttpObject obj, ChannelPromise promise) {
        // Use FQCN for Netty HttpResponse to avoid confusion with Armeria HttpResponse
        // We check if obj is an HttpResponse here because server-side writes both headers
        // and errors as an HttpResponse.
        //noinspection UnnecessaryFullyQualifiedName
        if (obj instanceof io.netty.handler.codec.http.HttpResponse) {
            final int currentId = currentId();
            if (lastResponseHeadersId >= currentId) {
                // Response headers were written already. This may occur Http1RequestDecoder sends an error
                // response while HttpResponseSubscriber writes a response headers and then waits for bodies.
                ReferenceCountUtil.release(obj);
                return writeReset(currentId, 1, Http2Error.PROTOCOL_ERROR);
            }
            if (webSocketUpgraded ||
                ((HttpResponse) obj).status().codeClass() != HttpStatusClass.INFORMATIONAL) {
                lastResponseHeadersId = currentId;
            }
        }

        return channel().write(obj, promise);
    }
The ID of the last request whose response headers is written.
core/src/main/java/com/linecorp/armeria/server/ServerHttp1ObjectEncoder.java