protected static boolean fireStartEvent(ChannelHandlerContext ctx, HttpRequest request) {
        // Only allow this method to run once per request.
        Channel channel = ctx.channel();
        Attribute<State> attr = channel.attr(ATTR_STATE);
        State state = attr.get();

        if (state == State.STARTED) {
            // This could potentially happen if a bad client sends a 2nd request on the same connection
            // without waiting for the response from the first. And we don't support HTTP Pipelining.
            logger.debug(
                    "Received a http request on connection where we already have a request being processed. Closing"
                            + " the connection now. channel = {}",
                    channel.id().asLongText());
            channel.attr(ATTR_HTTP_PIPELINE_REJECT).set(Boolean.TRUE);
            channel.close();
            return false;
        }

        channel.attr(ATTR_STATE).set(State.STARTED);
        channel.attr(ATTR_HTTP_REQ).set(request);
        ctx.pipeline().fireUserEventTriggered(new StartEvent(request));

        return true;
    }
User: michaels@netflix.com
Date: 5/24/16
Time: 4:09 PM
zuul-core/src/main/java/com/netflix/netty/common/HttpLifecycleChannelHandler.java