Search in sources :

Example 96 with Http2Headers

use of io.netty.handler.codec.http2.Http2Headers in project rest.li by linkedin.

the class Http2StreamCodec method write.

@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
    if (!(msg instanceof RequestWithCallback)) {
        ctx.write(msg, promise);
        return;
    }
    Request request = ((RequestWithCallback) msg).request();
    Http2ConnectionEncoder encoder = encoder();
    int streamId = connection().local().incrementAndGetNextStreamId();
    final ChannelFuture headersFuture;
    if (request instanceof StreamRequest) {
        final StreamRequest streamRequest = (StreamRequest) request;
        final Http2Headers http2Headers = NettyRequestAdapter.toHttp2Headers(streamRequest);
        final BufferedReader bufferedReader = new BufferedReader(ctx, encoder, streamId, ((RequestWithCallback) msg).handle());
        final OrderedEntityStreamReader reader = new OrderedEntityStreamReader(ctx, bufferedReader);
        streamRequest.getEntityStream().setReader(reader);
        LOG.debug("Sent HTTP/2 HEADERS frame, stream={}, end={}, headers={}, padding={}bytes", new Object[] { streamId, NOT_END_STREAM, http2Headers.size(), NO_PADDING });
        headersFuture = encoder.writeHeaders(ctx, streamId, http2Headers, NO_PADDING, NOT_END_STREAM, promise);
        headersFuture.addListener(future -> {
            if (future.isSuccess()) {
                reader.request(BufferedReader.MAX_BUFFERED_CHUNKS);
            }
        });
    } else if (request instanceof RestRequest) {
        final RestRequest restRequest = (RestRequest) request;
        final Http2Headers headers = NettyRequestAdapter.toHttp2Headers(restRequest);
        LOG.debug("Sent HTTP/2 HEADERS frame, stream={}, end={}, headers={}, padding={}bytes", new Object[] { streamId, NOT_END_STREAM, headers.size(), NO_PADDING });
        headersFuture = encoder.writeHeaders(ctx, streamId, headers, NO_PADDING, NOT_END_STREAM, promise);
        headersFuture.addListener(future -> {
            if (future.isSuccess()) {
                final ByteBuf data = Unpooled.wrappedBuffer(restRequest.getEntity().asByteBuffer());
                LOG.debug("Sent HTTP/2 DATA frame, stream={}, end={}, data={}bytes, padding={}bytes", new Object[] { streamId, END_STREAM, data.readableBytes(), NO_PADDING });
                encoder.writeData(ctx, streamId, data, NO_PADDING, END_STREAM, ctx.newPromise());
                ctx.channel().flush();
            }
        });
    } else {
        // Release the handle to put the channel back to the pool
        ((RequestWithCallback) msg).handle().release();
        throw new IllegalArgumentException("Request is neither StreamRequest or RestRequest");
    }
    final TransportCallback<?> callback = ((RequestWithCallback) msg).callback();
    @SuppressWarnings("unchecked") final TimeoutAsyncPoolHandle<Channel> handle = (TimeoutAsyncPoolHandle<Channel>) ((RequestWithCallback) msg).handle();
    headersFuture.addListener(future -> {
        if (future.isSuccess()) {
            // Sets TransportCallback as a stream property to be retrieved later
            Http2PipelinePropertyUtil.set(ctx, connection(), streamId, Http2ClientPipelineInitializer.CALLBACK_ATTR_KEY, callback);
            // Sets AsyncPoolHandle as a stream property to be retrieved later
            Http2PipelinePropertyUtil.set(ctx, connection(), streamId, Http2ClientPipelineInitializer.CHANNEL_POOL_HANDLE_ATTR_KEY, handle);
            // Sets a timeout task to reset stream
            // Channel pool handle is also released at timeout
            handle.addTimeoutTask(() -> {
                LOG.debug("Reset stream upon timeout, stream={}", streamId);
                resetStream(ctx, streamId, Http2Error.CANCEL.code(), ctx.newPromise());
                ctx.flush();
            });
        } else {
            // Invokes callback onResponse with the error thrown during write header or data
            callback.onResponse(TransportResponseImpl.error(future.cause()));
            // Releases the handle to put the channel back to the pool
            handle.release();
            // Resets the stream if a stream is created after we sent header
            if (connection().stream(streamId) != null) {
                LOG.debug("Reset stream upon timeout, stream={}", streamId);
                resetStream(ctx, streamId, Http2Error.CANCEL.code(), ctx.newPromise());
                ctx.flush();
            }
        }
    });
}
Also used : ChannelFuture(io.netty.channel.ChannelFuture) AsyncPoolHandle(com.linkedin.r2.transport.http.client.AsyncPoolHandle) LoggerFactory(org.slf4j.LoggerFactory) Http2ConnectionEncoder(io.netty.handler.codec.http2.Http2ConnectionEncoder) Reader(com.linkedin.r2.message.stream.entitystream.Reader) StreamRequest(com.linkedin.r2.message.stream.StreamRequest) TransportCallback(com.linkedin.r2.transport.common.bridge.common.TransportCallback) Unpooled(io.netty.buffer.Unpooled) Http2ConnectionDecoder(io.netty.handler.codec.http2.Http2ConnectionDecoder) NettyRequestAdapter(com.linkedin.r2.netty.common.NettyRequestAdapter) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) Request(com.linkedin.r2.message.Request) ByteBuf(io.netty.buffer.ByteBuf) ChannelPromise(io.netty.channel.ChannelPromise) TimeoutAsyncPoolHandle(com.linkedin.r2.transport.http.client.TimeoutAsyncPoolHandle) ByteString(com.linkedin.data.ByteString) StreamResponse(com.linkedin.r2.message.stream.StreamResponse) Http2Exception(io.netty.handler.codec.http2.Http2Exception) RestRequest(com.linkedin.r2.message.rest.RestRequest) Logger(org.slf4j.Logger) RequestWithCallback(com.linkedin.r2.transport.common.bridge.common.RequestWithCallback) OrderedEntityStreamReader(com.linkedin.r2.transport.http.client.stream.OrderedEntityStreamReader) Http2ConnectionHandler(io.netty.handler.codec.http2.Http2ConnectionHandler) ChannelFuture(io.netty.channel.ChannelFuture) Channel(io.netty.channel.Channel) Http2Settings(io.netty.handler.codec.http2.Http2Settings) R2Constants(com.linkedin.r2.filter.R2Constants) TransportResponseImpl(com.linkedin.r2.transport.common.bridge.common.TransportResponseImpl) Http2Headers(io.netty.handler.codec.http2.Http2Headers) Http2Error(io.netty.handler.codec.http2.Http2Error) Optional(java.util.Optional) ReadHandle(com.linkedin.r2.message.stream.entitystream.ReadHandle) Collections(java.util.Collections) Channel(io.netty.channel.Channel) StreamRequest(com.linkedin.r2.message.stream.StreamRequest) Request(com.linkedin.r2.message.Request) RestRequest(com.linkedin.r2.message.rest.RestRequest) ByteBuf(io.netty.buffer.ByteBuf) StreamRequest(com.linkedin.r2.message.stream.StreamRequest) TimeoutAsyncPoolHandle(com.linkedin.r2.transport.http.client.TimeoutAsyncPoolHandle) RestRequest(com.linkedin.r2.message.rest.RestRequest) RequestWithCallback(com.linkedin.r2.transport.common.bridge.common.RequestWithCallback) OrderedEntityStreamReader(com.linkedin.r2.transport.http.client.stream.OrderedEntityStreamReader) Http2Headers(io.netty.handler.codec.http2.Http2Headers) Http2ConnectionEncoder(io.netty.handler.codec.http2.Http2ConnectionEncoder)

Example 97 with Http2Headers

use of io.netty.handler.codec.http2.Http2Headers in project ambry by linkedin.

the class AmbrySendToHttp2Adaptor method write.

/**
 * Handles conversion of {@link Send} to HTTP/2 frames.
 */
@Override
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) {
    if (!ctx.channel().isOpen()) {
        logger.debug("Channel closed when write. Channel: {}", ctx.channel());
        promise.setFailure(new ChannelException("Channel has been closed when write."));
    }
    if (!(msg instanceof Send)) {
        ctx.write(msg, promise);
        return;
    }
    Send send = (Send) msg;
    Http2Headers http2Headers;
    if (forServer) {
        logger.trace("Write content to channel as server {}", ctx.channel());
        http2Headers = new DefaultHttp2Headers().status(HttpResponseStatus.OK.codeAsText());
    } else {
        logger.trace("Write content to channel as client {}", ctx.channel());
        http2Headers = new DefaultHttp2Headers().method(HttpMethod.POST.asciiName()).scheme("https").path("/");
    }
    DefaultHttp2HeadersFrame headersFrame = new DefaultHttp2HeadersFrame(http2Headers, false);
    ctx.write(headersFrame);
    // Referencing counting for derived {@link ByteBuf}: https://netty.io/wiki/reference-counted-objects.html#derived-buffers
    try {
        while (send.content().isReadable(maxFrameSize)) {
            ByteBuf slice = send.content().readSlice(maxFrameSize);
            slice.retain();
            DefaultHttp2DataFrame dataFrame = new DefaultHttp2DataFrame(slice, false);
            ctx.write(dataFrame);
        }
        // The last slice
        ByteBuf slice = send.content().readSlice(send.content().readableBytes());
        slice.retain();
        DefaultHttp2DataFrame dataFrame = new DefaultHttp2DataFrame(slice, true);
        ctx.write(dataFrame, promise);
    } catch (Exception e) {
        logger.error("Error while processing frames. Channel: {}", ctx.channel(), e);
    } finally {
        send.content().release();
    }
}
Also used : DefaultHttp2HeadersFrame(io.netty.handler.codec.http2.DefaultHttp2HeadersFrame) DefaultHttp2DataFrame(io.netty.handler.codec.http2.DefaultHttp2DataFrame) Http2Headers(io.netty.handler.codec.http2.Http2Headers) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) ByteBuf(io.netty.buffer.ByteBuf) ChannelException(io.netty.channel.ChannelException) ChannelException(io.netty.channel.ChannelException) Send(com.github.ambry.network.Send)

Example 98 with Http2Headers

use of io.netty.handler.codec.http2.Http2Headers in project vert.x by eclipse.

the class Http2ServerTest method testURI.

@Test
public void testURI() throws Exception {
    server.requestHandler(req -> {
        assertEquals("/some/path", req.path());
        assertEquals("foo=foo_value&bar=bar_value_1&bar=bar_value_2", req.query());
        assertEquals("/some/path?foo=foo_value&bar=bar_value_1&bar=bar_value_2", req.uri());
        assertEquals("http://whatever.com/some/path?foo=foo_value&bar=bar_value_1&bar=bar_value_2", req.absoluteURI());
        assertEquals("/some/path?foo=foo_value&bar=bar_value_1&bar=bar_value_2", req.getHeader(":path"));
        assertEquals("whatever.com", req.host());
        MultiMap params = req.params();
        Set<String> names = params.names();
        assertEquals(2, names.size());
        assertTrue(names.contains("foo"));
        assertTrue(names.contains("bar"));
        assertEquals("foo_value", params.get("foo"));
        assertEquals(Collections.singletonList("foo_value"), params.getAll("foo"));
        assertEquals("bar_value_2", params.get("bar"));
        assertEquals(Arrays.asList("bar_value_1", "bar_value_2"), params.getAll("bar"));
        testComplete();
    });
    startServer();
    TestClient client = new TestClient();
    ChannelFuture fut = client.connect(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, request -> {
        int id = request.nextStreamId();
        Http2Headers headers = new DefaultHttp2Headers().method("GET").scheme("http").authority("whatever.com").path("/some/path?foo=foo_value&bar=bar_value_1&bar=bar_value_2");
        request.encoder.writeHeaders(request.context, id, headers, 0, true, request.context.newPromise());
        request.context.flush();
    });
    fut.sync();
    await();
}
Also used : ChannelFuture(io.netty.channel.ChannelFuture) MultiMap(io.vertx.core.MultiMap) Http2Headers(io.netty.handler.codec.http2.Http2Headers) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) Test(org.junit.Test)

Example 99 with Http2Headers

use of io.netty.handler.codec.http2.Http2Headers in project vert.x by eclipse.

the class Http2ServerTest method testSendFile.

private void testSendFile(Buffer expected, String path, long offset, long length) throws Exception {
    waitFor(2);
    server.requestHandler(req -> {
        HttpServerResponse resp = req.response();
        resp.bodyEndHandler(v -> {
            assertEquals(resp.bytesWritten(), length);
            complete();
        });
        resp.sendFile(path, offset, length);
    });
    startServer();
    TestClient client = new TestClient();
    ChannelFuture fut = client.connect(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, request -> {
        request.decoder.frameListener(new Http2EventAdapter() {

            Buffer buffer = Buffer.buffer();

            Http2Headers responseHeaders;

            @Override
            public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endStream) throws Http2Exception {
                responseHeaders = headers;
            }

            @Override
            public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) throws Http2Exception {
                buffer.appendBuffer(Buffer.buffer(data.duplicate()));
                if (endOfStream) {
                    vertx.runOnContext(v -> {
                        assertEquals("" + length, responseHeaders.get("content-length").toString());
                        assertEquals(expected, buffer);
                        complete();
                    });
                }
                return data.readableBytes() + padding;
            }
        });
        int id = request.nextStreamId();
        request.encoder.writeHeaders(request.context, id, GET("/"), 0, true, request.context.newPromise());
        request.context.flush();
    });
    fut.sync();
    await();
}
Also used : ChannelFuture(io.netty.channel.ChannelFuture) Buffer(io.vertx.core.buffer.Buffer) Arrays(java.util.Arrays) GZIPInputStream(java.util.zip.GZIPInputStream) HttpServer(io.vertx.core.http.HttpServer) MultiMap(io.vertx.core.MultiMap) Http2ConnectionEncoder(io.netty.handler.codec.http2.Http2ConnectionEncoder) DefaultHttp2Connection(io.netty.handler.codec.http2.DefaultHttp2Connection) Context(io.vertx.core.Context) Unpooled(io.netty.buffer.Unpooled) Http2ConnectionDecoder(io.netty.handler.codec.http2.Http2ConnectionDecoder) ByteArrayInputStream(java.io.ByteArrayInputStream) HttpVersion(io.vertx.core.http.HttpVersion) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Http2Exception(io.netty.handler.codec.http2.Http2Exception) Map(java.util.Map) ApplicationProtocolNegotiationHandler(io.netty.handler.ssl.ApplicationProtocolNegotiationHandler) ReadStream(io.vertx.core.streams.ReadStream) AbstractHttp2ConnectionHandlerBuilder(io.netty.handler.codec.http2.AbstractHttp2ConnectionHandlerBuilder) Http2FrameAdapter(io.netty.handler.codec.http2.Http2FrameAdapter) StreamResetException(io.vertx.core.http.StreamResetException) ChannelDuplexHandler(io.netty.channel.ChannelDuplexHandler) ChannelInitializer(io.netty.channel.ChannelInitializer) Http2Flags(io.netty.handler.codec.http2.Http2Flags) Set(java.util.Set) ChannelPipeline(io.netty.channel.ChannelPipeline) Http2ConnectionHandler(io.netty.handler.codec.http2.Http2ConnectionHandler) Future(io.vertx.core.Future) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) StandardCharsets(java.nio.charset.StandardCharsets) Base64(java.util.Base64) List(java.util.List) Buffer(io.vertx.core.buffer.Buffer) SslHandler(io.netty.handler.ssl.SslHandler) Http2Headers(io.netty.handler.codec.http2.Http2Headers) HttpServerResponse(io.vertx.core.http.HttpServerResponse) Http2Error(io.netty.handler.codec.http2.Http2Error) HttpClient(io.vertx.core.http.HttpClient) NetSocket(io.vertx.core.net.NetSocket) Trust(io.vertx.test.core.tls.Trust) NioSocketChannel(io.netty.channel.socket.nio.NioSocketChannel) HttpServerRequest(io.vertx.core.http.HttpServerRequest) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Http2EventAdapter(io.netty.handler.codec.http2.Http2EventAdapter) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) HttpClientRequest(io.vertx.core.http.HttpClientRequest) ByteBuf(io.netty.buffer.ByteBuf) WriteStream(io.vertx.core.streams.WriteStream) Http2Stream(io.netty.handler.codec.http2.Http2Stream) BiConsumer(java.util.function.BiConsumer) AsyncResult(io.vertx.core.AsyncResult) HttpClientOptions(io.vertx.core.http.HttpClientOptions) HttpConnection(io.vertx.core.http.HttpConnection) EventLoopGroup(io.netty.channel.EventLoopGroup) VertxInternal(io.vertx.core.impl.VertxInternal) ClosedChannelException(java.nio.channels.ClosedChannelException) Vertx(io.vertx.core.Vertx) FileOutputStream(java.io.FileOutputStream) ApplicationProtocolNames(io.netty.handler.ssl.ApplicationProtocolNames) Test(org.junit.Test) IOException(java.io.IOException) SSLHelper(io.vertx.core.net.impl.SSLHelper) File(java.io.File) ChannelFuture(io.netty.channel.ChannelFuture) Channel(io.netty.channel.Channel) Http2Settings(io.netty.handler.codec.http2.Http2Settings) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Bootstrap(io.netty.bootstrap.Bootstrap) AtomicLong(java.util.concurrent.atomic.AtomicLong) Http2Connection(io.netty.handler.codec.http2.Http2Connection) HttpMethod(io.vertx.core.http.HttpMethod) HttpUtils(io.vertx.core.http.impl.HttpUtils) HttpServerOptions(io.vertx.core.http.HttpServerOptions) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) Handler(io.vertx.core.Handler) Collections(java.util.Collections) TestUtils.assertIllegalStateException(io.vertx.test.core.TestUtils.assertIllegalStateException) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) Http2Exception(io.netty.handler.codec.http2.Http2Exception) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) ByteBuf(io.netty.buffer.ByteBuf) Http2Headers(io.netty.handler.codec.http2.Http2Headers) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) HttpServerResponse(io.vertx.core.http.HttpServerResponse) Http2EventAdapter(io.netty.handler.codec.http2.Http2EventAdapter)

Example 100 with Http2Headers

use of io.netty.handler.codec.http2.Http2Headers in project vert.x by eclipse.

the class Http2ServerTest method test100Continue.

private void test100Continue() throws Exception {
    startServer();
    TestClient client = new TestClient();
    ChannelFuture fut = client.connect(DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_HOST, request -> {
        int id = request.nextStreamId();
        request.decoder.frameListener(new Http2EventAdapter() {

            int count = 0;

            @Override
            public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endStream) throws Http2Exception {
                switch(count++) {
                    case 0:
                        vertx.runOnContext(v -> {
                            assertEquals("100", headers.status().toString());
                        });
                        request.encoder.writeData(request.context, id, Buffer.buffer("the-body").getByteBuf(), 0, true, request.context.newPromise());
                        request.context.flush();
                        break;
                    case 1:
                        vertx.runOnContext(v -> {
                            assertEquals("200", headers.status().toString());
                            assertEquals("wibble-value", headers.get("wibble").toString());
                            testComplete();
                        });
                        break;
                    default:
                        vertx.runOnContext(v -> {
                            fail();
                        });
                }
            }
        });
        request.encoder.writeHeaders(request.context, id, GET("/").add("expect", "100-continue"), 0, false, request.context.newPromise());
        request.context.flush();
    });
    fut.sync();
    await();
}
Also used : ChannelFuture(io.netty.channel.ChannelFuture) Arrays(java.util.Arrays) GZIPInputStream(java.util.zip.GZIPInputStream) HttpServer(io.vertx.core.http.HttpServer) MultiMap(io.vertx.core.MultiMap) Http2ConnectionEncoder(io.netty.handler.codec.http2.Http2ConnectionEncoder) DefaultHttp2Connection(io.netty.handler.codec.http2.DefaultHttp2Connection) Context(io.vertx.core.Context) Unpooled(io.netty.buffer.Unpooled) Http2ConnectionDecoder(io.netty.handler.codec.http2.Http2ConnectionDecoder) ByteArrayInputStream(java.io.ByteArrayInputStream) HttpVersion(io.vertx.core.http.HttpVersion) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Http2Exception(io.netty.handler.codec.http2.Http2Exception) Map(java.util.Map) ApplicationProtocolNegotiationHandler(io.netty.handler.ssl.ApplicationProtocolNegotiationHandler) ReadStream(io.vertx.core.streams.ReadStream) AbstractHttp2ConnectionHandlerBuilder(io.netty.handler.codec.http2.AbstractHttp2ConnectionHandlerBuilder) Http2FrameAdapter(io.netty.handler.codec.http2.Http2FrameAdapter) StreamResetException(io.vertx.core.http.StreamResetException) ChannelDuplexHandler(io.netty.channel.ChannelDuplexHandler) ChannelInitializer(io.netty.channel.ChannelInitializer) Http2Flags(io.netty.handler.codec.http2.Http2Flags) Set(java.util.Set) ChannelPipeline(io.netty.channel.ChannelPipeline) Http2ConnectionHandler(io.netty.handler.codec.http2.Http2ConnectionHandler) Future(io.vertx.core.Future) InetSocketAddress(java.net.InetSocketAddress) Collectors(java.util.stream.Collectors) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) StandardCharsets(java.nio.charset.StandardCharsets) Base64(java.util.Base64) List(java.util.List) Buffer(io.vertx.core.buffer.Buffer) SslHandler(io.netty.handler.ssl.SslHandler) Http2Headers(io.netty.handler.codec.http2.Http2Headers) HttpServerResponse(io.vertx.core.http.HttpServerResponse) Http2Error(io.netty.handler.codec.http2.Http2Error) HttpClient(io.vertx.core.http.HttpClient) NetSocket(io.vertx.core.net.NetSocket) Trust(io.vertx.test.core.tls.Trust) NioSocketChannel(io.netty.channel.socket.nio.NioSocketChannel) HttpServerRequest(io.vertx.core.http.HttpServerRequest) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Http2EventAdapter(io.netty.handler.codec.http2.Http2EventAdapter) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) HttpClientRequest(io.vertx.core.http.HttpClientRequest) ByteBuf(io.netty.buffer.ByteBuf) WriteStream(io.vertx.core.streams.WriteStream) Http2Stream(io.netty.handler.codec.http2.Http2Stream) BiConsumer(java.util.function.BiConsumer) AsyncResult(io.vertx.core.AsyncResult) HttpClientOptions(io.vertx.core.http.HttpClientOptions) HttpConnection(io.vertx.core.http.HttpConnection) EventLoopGroup(io.netty.channel.EventLoopGroup) VertxInternal(io.vertx.core.impl.VertxInternal) ClosedChannelException(java.nio.channels.ClosedChannelException) Vertx(io.vertx.core.Vertx) FileOutputStream(java.io.FileOutputStream) ApplicationProtocolNames(io.netty.handler.ssl.ApplicationProtocolNames) Test(org.junit.Test) IOException(java.io.IOException) SSLHelper(io.vertx.core.net.impl.SSLHelper) File(java.io.File) ChannelFuture(io.netty.channel.ChannelFuture) Channel(io.netty.channel.Channel) Http2Settings(io.netty.handler.codec.http2.Http2Settings) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Bootstrap(io.netty.bootstrap.Bootstrap) AtomicLong(java.util.concurrent.atomic.AtomicLong) Http2Connection(io.netty.handler.codec.http2.Http2Connection) HttpMethod(io.vertx.core.http.HttpMethod) HttpUtils(io.vertx.core.http.impl.HttpUtils) HttpServerOptions(io.vertx.core.http.HttpServerOptions) HttpHeaderNames(io.netty.handler.codec.http.HttpHeaderNames) Handler(io.vertx.core.Handler) Collections(java.util.Collections) TestUtils.assertIllegalStateException(io.vertx.test.core.TestUtils.assertIllegalStateException) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) Http2Exception(io.netty.handler.codec.http2.Http2Exception) Http2Headers(io.netty.handler.codec.http2.Http2Headers) DefaultHttp2Headers(io.netty.handler.codec.http2.DefaultHttp2Headers) Http2EventAdapter(io.netty.handler.codec.http2.Http2EventAdapter) ChannelHandlerContext(io.netty.channel.ChannelHandlerContext)

Aggregations

Http2Headers (io.netty.handler.codec.http2.Http2Headers)126 DefaultHttp2Headers (io.netty.handler.codec.http2.DefaultHttp2Headers)111 ByteBuf (io.netty.buffer.ByteBuf)103 Test (org.junit.Test)97 ChannelFuture (io.netty.channel.ChannelFuture)76 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)76 AsciiString (io.netty.util.AsciiString)58 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)58 AtomicReference (java.util.concurrent.atomic.AtomicReference)56 ByteArrayOutputStream (java.io.ByteArrayOutputStream)54 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)54 Channel (io.netty.channel.Channel)53 Collections (java.util.Collections)53 ChannelInitializer (io.netty.channel.ChannelInitializer)52 ChannelPipeline (io.netty.channel.ChannelPipeline)52 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)52 HttpHeaderNames (io.netty.handler.codec.http.HttpHeaderNames)52 ApplicationProtocolNames (io.netty.handler.ssl.ApplicationProtocolNames)52 ApplicationProtocolNegotiationHandler (io.netty.handler.ssl.ApplicationProtocolNegotiationHandler)52 SslHandler (io.netty.handler.ssl.SslHandler)52