Search in sources :

Example 6 with FuturePromise

use of org.eclipse.jetty.util.FuturePromise in project jetty.project by eclipse.

the class FlowControlStrategyTest method testWindowSizeUpdates.

@Test
public void testWindowSizeUpdates() throws Exception {
    final CountDownLatch prefaceLatch = new CountDownLatch(1);
    final CountDownLatch stream1Latch = new CountDownLatch(1);
    final CountDownLatch stream2Latch = new CountDownLatch(1);
    final CountDownLatch settingsLatch = new CountDownLatch(1);
    start(new ServerSessionListener.Adapter() {

        @Override
        public Map<Integer, Integer> onPreface(Session session) {
            HTTP2Session serverSession = (HTTP2Session) session;
            Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, serverSession.getSendWindow());
            Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, serverSession.getRecvWindow());
            prefaceLatch.countDown();
            return null;
        }

        @Override
        public void onSettings(Session session, SettingsFrame frame) {
            for (Stream stream : session.getStreams()) {
                HTTP2Stream serverStream = (HTTP2Stream) stream;
                Assert.assertEquals(0, serverStream.getSendWindow());
                Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, serverStream.getRecvWindow());
            }
            settingsLatch.countDown();
        }

        @Override
        public Stream.Listener onNewStream(Stream stream, HeadersFrame frame) {
            HTTP2Stream serverStream = (HTTP2Stream) stream;
            MetaData.Request request = (MetaData.Request) frame.getMetaData();
            if ("GET".equalsIgnoreCase(request.getMethod())) {
                Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, serverStream.getSendWindow());
                Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, serverStream.getRecvWindow());
                stream1Latch.countDown();
            } else {
                Assert.assertEquals(0, serverStream.getSendWindow());
                Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, serverStream.getRecvWindow());
                stream2Latch.countDown();
            }
            return null;
        }
    });
    HTTP2Session clientSession = (HTTP2Session) newClient(new Session.Listener.Adapter());
    Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, clientSession.getSendWindow());
    Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, clientSession.getRecvWindow());
    Assert.assertTrue(prefaceLatch.await(5, TimeUnit.SECONDS));
    MetaData.Request request1 = newRequest("GET", new HttpFields());
    FuturePromise<Stream> promise1 = new FuturePromise<>();
    clientSession.newStream(new HeadersFrame(request1, null, true), promise1, new Stream.Listener.Adapter());
    HTTP2Stream clientStream1 = (HTTP2Stream) promise1.get(5, TimeUnit.SECONDS);
    Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, clientStream1.getSendWindow());
    Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, clientStream1.getRecvWindow());
    Assert.assertTrue(stream1Latch.await(5, TimeUnit.SECONDS));
    // Send a SETTINGS frame that changes the window size.
    // This tells the server that its stream send window must be updated,
    // so on the client it's the receive window that must be updated.
    Map<Integer, Integer> settings = new HashMap<>();
    settings.put(SettingsFrame.INITIAL_WINDOW_SIZE, 0);
    SettingsFrame frame = new SettingsFrame(settings, false);
    FutureCallback callback = new FutureCallback();
    clientSession.settings(frame, callback);
    callback.get(5, TimeUnit.SECONDS);
    Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, clientStream1.getSendWindow());
    Assert.assertEquals(0, clientStream1.getRecvWindow());
    settingsLatch.await(5, TimeUnit.SECONDS);
    // Now create a new stream, it must pick up the new value.
    MetaData.Request request2 = newRequest("POST", new HttpFields());
    FuturePromise<Stream> promise2 = new FuturePromise<>();
    clientSession.newStream(new HeadersFrame(request2, null, true), promise2, new Stream.Listener.Adapter());
    HTTP2Stream clientStream2 = (HTTP2Stream) promise2.get(5, TimeUnit.SECONDS);
    Assert.assertEquals(FlowControlStrategy.DEFAULT_WINDOW_SIZE, clientStream2.getSendWindow());
    Assert.assertEquals(0, clientStream2.getRecvWindow());
    Assert.assertTrue(stream2Latch.await(5, TimeUnit.SECONDS));
}
Also used : ServerSessionListener(org.eclipse.jetty.http2.api.server.ServerSessionListener) HTTP2Stream(org.eclipse.jetty.http2.HTTP2Stream) HashMap(java.util.HashMap) FuturePromise(org.eclipse.jetty.util.FuturePromise) CountDownLatch(java.util.concurrent.CountDownLatch) HTTP2Session(org.eclipse.jetty.http2.HTTP2Session) HeadersFrame(org.eclipse.jetty.http2.frames.HeadersFrame) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) SettingsFrame(org.eclipse.jetty.http2.frames.SettingsFrame) MetaData(org.eclipse.jetty.http.MetaData) HttpFields(org.eclipse.jetty.http.HttpFields) HTTP2Stream(org.eclipse.jetty.http2.HTTP2Stream) Stream(org.eclipse.jetty.http2.api.Stream) Map(java.util.Map) HashMap(java.util.HashMap) ServerSessionListener(org.eclipse.jetty.http2.api.server.ServerSessionListener) FutureCallback(org.eclipse.jetty.util.FutureCallback) HTTP2Session(org.eclipse.jetty.http2.HTTP2Session) Session(org.eclipse.jetty.http2.api.Session) ISession(org.eclipse.jetty.http2.ISession) Test(org.junit.Test)

Example 7 with FuturePromise

use of org.eclipse.jetty.util.FuturePromise in project jetty.project by eclipse.

the class FlowControlStrategyTest method testClientFlowControlOneBigWrite.

@Test
public void testClientFlowControlOneBigWrite() throws Exception {
    final int windowSize = 1536;
    final Exchanger<Callback> exchanger = new Exchanger<>();
    final CountDownLatch settingsLatch = new CountDownLatch(1);
    final CountDownLatch dataLatch = new CountDownLatch(1);
    start(new ServerSessionListener.Adapter() {

        @Override
        public Map<Integer, Integer> onPreface(Session session) {
            Map<Integer, Integer> settings = new HashMap<>();
            settings.put(SettingsFrame.INITIAL_WINDOW_SIZE, windowSize);
            return settings;
        }

        @Override
        public Stream.Listener onNewStream(Stream stream, HeadersFrame requestFrame) {
            MetaData.Response metaData = new MetaData.Response(HttpVersion.HTTP_2, 200, new HttpFields());
            HeadersFrame responseFrame = new HeadersFrame(stream.getId(), metaData, null, true);
            stream.headers(responseFrame, Callback.NOOP);
            return new Stream.Listener.Adapter() {

                private AtomicInteger dataFrames = new AtomicInteger();

                @Override
                public void onData(Stream stream, DataFrame frame, Callback callback) {
                    try {
                        int dataFrames = this.dataFrames.incrementAndGet();
                        if (dataFrames == 1 || dataFrames == 2) {
                            // Do not consume the data frame.
                            // We should then be flow-control stalled.
                            exchanger.exchange(callback);
                        } else if (dataFrames == 3 || dataFrames == 4 || dataFrames == 5) {
                            // Consume totally.
                            callback.succeeded();
                            if (frame.isEndStream())
                                dataLatch.countDown();
                        } else {
                            Assert.fail();
                        }
                    } catch (InterruptedException x) {
                        callback.failed(x);
                    }
                }
            };
        }
    });
    Session session = newClient(new Session.Listener.Adapter() {

        @Override
        public void onSettings(Session session, SettingsFrame frame) {
            settingsLatch.countDown();
        }
    });
    Assert.assertTrue(settingsLatch.await(5, TimeUnit.SECONDS));
    MetaData.Request metaData = newRequest("GET", new HttpFields());
    HeadersFrame requestFrame = new HeadersFrame(metaData, null, false);
    FuturePromise<Stream> streamPromise = new FuturePromise<>();
    session.newStream(requestFrame, streamPromise, null);
    Stream stream = streamPromise.get(5, TimeUnit.SECONDS);
    final int length = 5 * windowSize;
    DataFrame dataFrame = new DataFrame(stream.getId(), ByteBuffer.allocate(length), true);
    stream.data(dataFrame, Callback.NOOP);
    Callback callback = exchanger.exchange(null, 5, TimeUnit.SECONDS);
    checkThatWeAreFlowControlStalled(exchanger);
    // Consume the first chunk.
    callback.succeeded();
    callback = exchanger.exchange(null, 5, TimeUnit.SECONDS);
    checkThatWeAreFlowControlStalled(exchanger);
    // Consume the second chunk.
    callback.succeeded();
    Assert.assertTrue(dataLatch.await(5, TimeUnit.SECONDS));
}
Also used : ServerSessionListener(org.eclipse.jetty.http2.api.server.ServerSessionListener) Exchanger(java.util.concurrent.Exchanger) HeadersFrame(org.eclipse.jetty.http2.frames.HeadersFrame) SettingsFrame(org.eclipse.jetty.http2.frames.SettingsFrame) MetaData(org.eclipse.jetty.http.MetaData) HttpFields(org.eclipse.jetty.http.HttpFields) HTTP2Stream(org.eclipse.jetty.http2.HTTP2Stream) Stream(org.eclipse.jetty.http2.api.Stream) FuturePromise(org.eclipse.jetty.util.FuturePromise) DataFrame(org.eclipse.jetty.http2.frames.DataFrame) CountDownLatch(java.util.concurrent.CountDownLatch) Callback(org.eclipse.jetty.util.Callback) FutureCallback(org.eclipse.jetty.util.FutureCallback) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) HashMap(java.util.HashMap) ServerSessionListener(org.eclipse.jetty.http2.api.server.ServerSessionListener) HTTP2Session(org.eclipse.jetty.http2.HTTP2Session) Session(org.eclipse.jetty.http2.api.Session) ISession(org.eclipse.jetty.http2.ISession) Test(org.junit.Test)

Example 8 with FuturePromise

use of org.eclipse.jetty.util.FuturePromise in project jetty.project by eclipse.

the class FlowControlStrategyTest method testClientExceedingStreamWindow.

@Test
public void testClientExceedingStreamWindow() throws Exception {
    // On server, we don't consume the data.
    start(new ServerSessionListener.Adapter() {

        @Override
        public Map<Integer, Integer> onPreface(Session session) {
            // Enlarge the session window.
            ((ISession) session).updateRecvWindow(FlowControlStrategy.DEFAULT_WINDOW_SIZE);
            return super.onPreface(session);
        }
    });
    final CountDownLatch closeLatch = new CountDownLatch(1);
    Session session = newClient(new Session.Listener.Adapter() {

        @Override
        public void onClose(Session session, GoAwayFrame frame) {
            if (frame.getError() == ErrorCode.FLOW_CONTROL_ERROR.code)
                closeLatch.countDown();
        }
    });
    // Consume the whole stream window.
    MetaData.Request metaData = newRequest("POST", new HttpFields());
    HeadersFrame requestFrame = new HeadersFrame(metaData, null, false);
    FuturePromise<Stream> streamPromise = new FuturePromise<>();
    session.newStream(requestFrame, streamPromise, new Stream.Listener.Adapter());
    Stream stream = streamPromise.get(5, TimeUnit.SECONDS);
    ByteBuffer data = ByteBuffer.allocate(FlowControlStrategy.DEFAULT_WINDOW_SIZE);
    final CountDownLatch dataLatch = new CountDownLatch(1);
    stream.data(new DataFrame(stream.getId(), data, false), new Callback() {

        @Override
        public InvocationType getInvocationType() {
            return InvocationType.NON_BLOCKING;
        }

        @Override
        public void succeeded() {
            dataLatch.countDown();
        }
    });
    Assert.assertTrue(dataLatch.await(5, TimeUnit.SECONDS));
    // Wait for a while before doing the "sneaky" write
    // below, see comments in the previous test case.
    Thread.sleep(1000);
    // Now the client is supposed to not send more frames.
    // If it does, the connection must be closed.
    HTTP2Session http2Session = (HTTP2Session) session;
    ByteBufferPool.Lease lease = new ByteBufferPool.Lease(connector.getByteBufferPool());
    ByteBuffer extraData = ByteBuffer.allocate(1024);
    http2Session.getGenerator().data(lease, new DataFrame(stream.getId(), extraData, true), extraData.remaining());
    List<ByteBuffer> buffers = lease.getByteBuffers();
    http2Session.getEndPoint().write(Callback.NOOP, buffers.toArray(new ByteBuffer[buffers.size()]));
    // Expect the connection to be closed.
    Assert.assertTrue(closeLatch.await(5, TimeUnit.SECONDS));
}
Also used : ByteBufferPool(org.eclipse.jetty.io.ByteBufferPool) ServerSessionListener(org.eclipse.jetty.http2.api.server.ServerSessionListener) InvocationType(org.eclipse.jetty.util.thread.Invocable.InvocationType) HTTP2Session(org.eclipse.jetty.http2.HTTP2Session) HeadersFrame(org.eclipse.jetty.http2.frames.HeadersFrame) MetaData(org.eclipse.jetty.http.MetaData) HttpFields(org.eclipse.jetty.http.HttpFields) HTTP2Stream(org.eclipse.jetty.http2.HTTP2Stream) Stream(org.eclipse.jetty.http2.api.Stream) FuturePromise(org.eclipse.jetty.util.FuturePromise) DataFrame(org.eclipse.jetty.http2.frames.DataFrame) CountDownLatch(java.util.concurrent.CountDownLatch) ByteBuffer(java.nio.ByteBuffer) GoAwayFrame(org.eclipse.jetty.http2.frames.GoAwayFrame) Callback(org.eclipse.jetty.util.Callback) FutureCallback(org.eclipse.jetty.util.FutureCallback) Map(java.util.Map) HashMap(java.util.HashMap) ServerSessionListener(org.eclipse.jetty.http2.api.server.ServerSessionListener) HTTP2Session(org.eclipse.jetty.http2.HTTP2Session) Session(org.eclipse.jetty.http2.api.Session) ISession(org.eclipse.jetty.http2.ISession) Test(org.junit.Test)

Example 9 with FuturePromise

use of org.eclipse.jetty.util.FuturePromise in project jetty.project by eclipse.

the class IdleTimeoutTest method testBufferedReadsResetStreamIdleTimeout.

@Test
public void testBufferedReadsResetStreamIdleTimeout() throws Exception {
    int bufferSize = 8192;
    long delay = 1000;
    start(new HttpServlet() {

        @Override
        protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            ServletInputStream input = request.getInputStream();
            byte[] buffer = new byte[bufferSize];
            while (true) {
                int read = input.read(buffer);
                Log.getLogger(IdleTimeoutTest.class).info("Read {} bytes", read);
                if (read < 0)
                    break;
                sleep(delay);
            }
        }
    });
    connector.setIdleTimeout(2 * delay);
    Session session = newClient(new Session.Listener.Adapter());
    MetaData.Request metaData = newRequest("POST", new HttpFields());
    HeadersFrame requestFrame = new HeadersFrame(metaData, null, false);
    FuturePromise<Stream> promise = new FuturePromise<>();
    CountDownLatch latch = new CountDownLatch(1);
    session.newStream(requestFrame, promise, new Stream.Listener.Adapter() {

        @Override
        public void onHeaders(Stream stream, HeadersFrame frame) {
            if (frame.isEndStream())
                latch.countDown();
        }
    });
    Stream stream = promise.get(5, TimeUnit.SECONDS);
    // Send data larger than the flow control window.
    // The client will send bytes up to the flow control window immediately
    // and they will be buffered by the server; the Servlet will consume them slowly.
    // Servlet reads should reset the idle timeout.
    int contentLength = FlowControlStrategy.DEFAULT_WINDOW_SIZE + 1;
    ByteBuffer data = ByteBuffer.allocate(contentLength);
    stream.data(new DataFrame(stream.getId(), data, true), Callback.NOOP);
    Assert.assertTrue(latch.await(2 * (contentLength / bufferSize + 1) * delay, TimeUnit.MILLISECONDS));
}
Also used : ServerSessionListener(org.eclipse.jetty.http2.api.server.ServerSessionListener) HttpServlet(javax.servlet.http.HttpServlet) FuturePromise(org.eclipse.jetty.util.FuturePromise) HttpServletResponse(javax.servlet.http.HttpServletResponse) IOException(java.io.IOException) DataFrame(org.eclipse.jetty.http2.frames.DataFrame) CountDownLatch(java.util.concurrent.CountDownLatch) HeadersFrame(org.eclipse.jetty.http2.frames.HeadersFrame) ByteBuffer(java.nio.ByteBuffer) HttpServletRequest(javax.servlet.http.HttpServletRequest) ServletException(javax.servlet.ServletException) ServletInputStream(javax.servlet.ServletInputStream) MetaData(org.eclipse.jetty.http.MetaData) HttpFields(org.eclipse.jetty.http.HttpFields) ServletInputStream(javax.servlet.ServletInputStream) Stream(org.eclipse.jetty.http2.api.Stream) HTTP2Session(org.eclipse.jetty.http2.HTTP2Session) Session(org.eclipse.jetty.http2.api.Session) Test(org.junit.Test)

Example 10 with FuturePromise

use of org.eclipse.jetty.util.FuturePromise in project jetty.project by eclipse.

the class InterleavingTest method testInterleaving.

@Test
public void testInterleaving() throws Exception {
    CountDownLatch serverStreamsLatch = new CountDownLatch(2);
    List<Stream> serverStreams = new ArrayList<>();
    start(new ServerSessionListener.Adapter() {

        @Override
        public Stream.Listener onNewStream(Stream stream, HeadersFrame frame) {
            serverStreams.add(stream);
            serverStreamsLatch.countDown();
            return null;
        }
    });
    int maxFrameSize = Frame.DEFAULT_MAX_LENGTH + 1;
    Session session = newClient(new Session.Listener.Adapter() {

        @Override
        public Map<Integer, Integer> onPreface(Session session) {
            Map<Integer, Integer> settings = new HashMap<>();
            settings.put(SettingsFrame.MAX_FRAME_SIZE, maxFrameSize);
            return settings;
        }
    });
    BlockingQueue<FrameBytesCallback> dataFrames = new LinkedBlockingDeque<>();
    Stream.Listener streamListener = new Stream.Listener.Adapter() {

        @Override
        public void onData(Stream stream, DataFrame frame, Callback callback) {
            ByteBuffer data = frame.getData();
            byte[] bytes = new byte[data.remaining()];
            data.get(bytes);
            dataFrames.offer(new FrameBytesCallback(frame, bytes, callback));
        }
    };
    HeadersFrame headersFrame1 = new HeadersFrame(newRequest("GET", new HttpFields()), null, true);
    FuturePromise<Stream> streamPromise1 = new FuturePromise<>();
    session.newStream(headersFrame1, streamPromise1, streamListener);
    streamPromise1.get(5, TimeUnit.SECONDS);
    HeadersFrame headersFrame2 = new HeadersFrame(newRequest("GET", new HttpFields()), null, true);
    FuturePromise<Stream> streamPromise2 = new FuturePromise<>();
    session.newStream(headersFrame2, streamPromise2, streamListener);
    streamPromise2.get(5, TimeUnit.SECONDS);
    Assert.assertTrue(serverStreamsLatch.await(5, TimeUnit.SECONDS));
    Thread.sleep(1000);
    Stream serverStream1 = serverStreams.get(0);
    Stream serverStream2 = serverStreams.get(1);
    MetaData.Response response1 = new MetaData.Response(HttpVersion.HTTP_2, HttpStatus.OK_200, new HttpFields(), 0);
    serverStream1.headers(new HeadersFrame(serverStream1.getId(), response1, null, false), Callback.NOOP);
    Random random = new Random();
    byte[] content1 = new byte[2 * ((ISession) serverStream1.getSession()).updateSendWindow(0)];
    random.nextBytes(content1);
    byte[] content2 = new byte[2 * ((ISession) serverStream2.getSession()).updateSendWindow(0)];
    random.nextBytes(content2);
    MetaData.Response response2 = new MetaData.Response(HttpVersion.HTTP_2, HttpStatus.OK_200, new HttpFields(), 0);
    serverStream2.headers(new HeadersFrame(serverStream2.getId(), response2, null, false), new Callback() {

        @Override
        public void succeeded() {
            // Write data for both streams from within the callback so that they get queued together.
            ByteBuffer buffer1 = ByteBuffer.wrap(content1);
            serverStream1.data(new DataFrame(serverStream1.getId(), buffer1, true), NOOP);
            ByteBuffer buffer2 = ByteBuffer.wrap(content2);
            serverStream2.data(new DataFrame(serverStream2.getId(), buffer2, true), NOOP);
        }
    });
    // The client reads with a buffer size that is different from the
    // frame size and synthesizes DATA frames, so expect N frames for
    // stream1 up to maxFrameSize of data, then M frames for stream2
    // up to maxFrameSize of data, and so forth, interleaved.
    Map<Integer, ByteArrayOutputStream> contents = new HashMap<>();
    contents.put(serverStream1.getId(), new ByteArrayOutputStream());
    contents.put(serverStream2.getId(), new ByteArrayOutputStream());
    List<StreamLength> streamLengths = new ArrayList<>();
    int finished = 0;
    while (finished < 2) {
        FrameBytesCallback frameBytesCallback = dataFrames.poll(5, TimeUnit.SECONDS);
        if (frameBytesCallback == null)
            Assert.fail();
        DataFrame dataFrame = frameBytesCallback.frame;
        int streamId = dataFrame.getStreamId();
        int length = dataFrame.remaining();
        streamLengths.add(new StreamLength(streamId, length));
        if (dataFrame.isEndStream())
            ++finished;
        contents.get(streamId).write(frameBytesCallback.bytes);
        frameBytesCallback.callback.succeeded();
    }
    // Verify that the content has been sent properly.
    Assert.assertArrayEquals(content1, contents.get(serverStream1.getId()).toByteArray());
    Assert.assertArrayEquals(content2, contents.get(serverStream2.getId()).toByteArray());
    // Verify that the interleaving is correct.
    Map<Integer, List<Integer>> groups = new HashMap<>();
    groups.put(serverStream1.getId(), new ArrayList<>());
    groups.put(serverStream2.getId(), new ArrayList<>());
    int currentStream = 0;
    int currentLength = 0;
    for (StreamLength streamLength : streamLengths) {
        if (currentStream == 0)
            currentStream = streamLength.stream;
        if (currentStream != streamLength.stream) {
            groups.get(currentStream).add(currentLength);
            currentStream = streamLength.stream;
            currentLength = 0;
        }
        currentLength += streamLength.length;
    }
    groups.get(currentStream).add(currentLength);
    Logger logger = Log.getLogger(getClass());
    logger.debug("frame lengths = {}", streamLengths);
    groups.forEach((stream, lengths) -> {
        logger.debug("stream {} interleaved lengths = {}", stream, lengths);
        for (Integer length : lengths) Assert.assertThat(length, Matchers.lessThanOrEqualTo(maxFrameSize));
    });
}
Also used : ServerSessionListener(org.eclipse.jetty.http2.api.server.ServerSessionListener) LinkedBlockingDeque(java.util.concurrent.LinkedBlockingDeque) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) Logger(org.eclipse.jetty.util.log.Logger) HeadersFrame(org.eclipse.jetty.http2.frames.HeadersFrame) Random(java.util.Random) MetaData(org.eclipse.jetty.http.MetaData) HttpFields(org.eclipse.jetty.http.HttpFields) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Stream(org.eclipse.jetty.http2.api.Stream) ArrayList(java.util.ArrayList) List(java.util.List) FuturePromise(org.eclipse.jetty.util.FuturePromise) DataFrame(org.eclipse.jetty.http2.frames.DataFrame) ByteArrayOutputStream(java.io.ByteArrayOutputStream) CountDownLatch(java.util.concurrent.CountDownLatch) ByteBuffer(java.nio.ByteBuffer) Callback(org.eclipse.jetty.util.Callback) HashMap(java.util.HashMap) Map(java.util.Map) ServerSessionListener(org.eclipse.jetty.http2.api.server.ServerSessionListener) Session(org.eclipse.jetty.http2.api.Session) ISession(org.eclipse.jetty.http2.ISession) Test(org.junit.Test)

Aggregations

FuturePromise (org.eclipse.jetty.util.FuturePromise)49 Test (org.junit.Test)42 Session (org.eclipse.jetty.http2.api.Session)40 CountDownLatch (java.util.concurrent.CountDownLatch)38 HttpFields (org.eclipse.jetty.http.HttpFields)36 Stream (org.eclipse.jetty.http2.api.Stream)36 HeadersFrame (org.eclipse.jetty.http2.frames.HeadersFrame)36 MetaData (org.eclipse.jetty.http.MetaData)35 ServerSessionListener (org.eclipse.jetty.http2.api.server.ServerSessionListener)29 DataFrame (org.eclipse.jetty.http2.frames.DataFrame)25 Callback (org.eclipse.jetty.util.Callback)22 HttpServletResponse (javax.servlet.http.HttpServletResponse)18 HttpServletRequest (javax.servlet.http.HttpServletRequest)17 HTTP2Session (org.eclipse.jetty.http2.HTTP2Session)15 ISession (org.eclipse.jetty.http2.ISession)15 IOException (java.io.IOException)13 ServletException (javax.servlet.ServletException)13 FutureCallback (org.eclipse.jetty.util.FutureCallback)11 ByteBuffer (java.nio.ByteBuffer)10 HttpServlet (javax.servlet.http.HttpServlet)10