void finishSuccessfully(ChannelPipeline pipeline, SessionProtocol protocol) {

        if (protocol == H1 || protocol == H1C) {
            addBeforeSessionHandler(pipeline, new Http1ResponseDecoder(pipeline.channel()));
        } else if (protocol == H2 || protocol == H2C) {
            final int initialWindow = clientFactory.http2InitialConnectionWindowSize();
            if (initialWindow > DEFAULT_WINDOW_SIZE) {
                incrementLocalWindowSize(pipeline, initialWindow - DEFAULT_WINDOW_SIZE);
            }
        }

        final long idleTimeoutMillis = clientFactory.idleTimeoutMillis();
        if (idleTimeoutMillis > 0) {
            pipeline.addFirst(new HttpClientIdleTimeoutHandler(idleTimeoutMillis));
        }

        pipeline.channel().eventLoop().execute(() -> pipeline.fireUserEventTriggered(protocol));
    }
void finishSuccessfully ( ChannelPipeline pipeline , SessionProtocol protocol ) { if ( protocol == H1 || protocol == H1C ) { addBeforeSessionHandler ( pipeline , new Http1ResponseDecoder ( pipeline . channel ( ) ) ) ; } else if ( protocol == H2 || protocol == H2C ) { final int initialWindow = clientFactory . http2InitialConnectionWindowSize ( ) ; if ( initialWindow > DEFAULT_WINDOW_SIZE ) { incrementLocalWindowSize ( pipeline , initialWindow - DEFAULT_WINDOW_SIZE ) ; } } final long idleTimeoutMillis = clientFactory . idleTimeoutMillis ( ) ; if ( idleTimeoutMillis > 0 ) { pipeline . addFirst ( new HttpClientIdleTimeoutHandler ( idleTimeoutMillis ) ) ; } pipeline . channel ( ) . eventLoop ( ) . execute ( ( ) -> pipeline . fireUserEventTriggered ( protocol ) ) ; }
FIXME: Ensure unnecessary handlers are all removed from the pipeline for all protocol types.