src/main/java/com/linecorp/armeria/client/HttpConfigurator.java
// FIXME: Ensure unnecessary handlers are all removed from the pipeline for all protocol types.
Ensure unnecessary handlers are all removed from the pipeline for all protocol types.
Ensure unnecessary handlers are all removed from the pipeline for all protocol types .
void finishSuccessfully(ChannelPipeline pipeline, SessionProtocol protocol) {
        switch (protocol) {
        case H1:
        case H1C:
            addBeforeSessionHandler(pipeline, new HttpObjectAggregator(options.maxFrameLength()));
            break;
        case H2:
        case H2C:
            break;
        default:
            throw new Error();
        }
        final long idleTimeoutMillis = options.idleTimeoutMillis();
        if (idleTimeoutMillis > 0) {
            final HttpClientIdleTimeoutHandler timeoutHandler;
            if (protocol == H2 || protocol == H2C) {
                timeoutHandler = new Http2ClientIdleTimeoutHandler(idleTimeoutMillis);
            } else {
                timeoutHandler = new HttpClientIdleTimeoutHandler(idleTimeoutMillis);
            }
            addBeforeSessionHandler(pipeline, timeoutHandler);
        }
        pipeline.channel().eventLoop().execute(() -> pipeline.fireUserEventTriggered(protocol));
    }
void finishSuccessfully ( ChannelPipeline pipeline , SessionProtocol protocol ) { switch ( protocol ) { case H1 : case H1C : addBeforeSessionHandler ( pipeline , new HttpObjectAggregator ( options . maxFrameLength ( ) ) ) ; break ; case H2 : case H2C : break ; default : throw new Error ( ) ; } final long idleTimeoutMillis = options . idleTimeoutMillis ( ) ; if ( idleTimeoutMillis > 0 ) { final HttpClientIdleTimeoutHandler timeoutHandler ; if ( protocol == H2 || protocol == H2C ) { timeoutHandler = new Http2ClientIdleTimeoutHandler ( idleTimeoutMillis ) ; } else { timeoutHandler = new HttpClientIdleTimeoutHandler ( idleTimeoutMillis ) ; } addBeforeSessionHandler ( pipeline , timeoutHandler ) ; } pipeline . channel ( ) . eventLoop ( ) . execute ( ( ) -> pipeline . fireUserEventTriggered ( protocol ) ) ; }
FIXME: Ensure unnecessary handlers are all removed from the pipeline for all protocol types.
FIXME : Ensure unnecessary handlers are all removed from the pipeline for all protocol types .
// HTTP/2 does not require the aggregator because // InboundHttp2ToHttpAdapter always creates a FullHttpRequest. // Should never reach here. // Note: We should not use Http2ClientIdleTimeoutHandler for HTTP/1 connections, //       because we cannot tell if the headers defined in ExtensionHeaderNames such as //       'x-http2-stream-id' have been set by us or a malicious server.