Package org.eclipse.jetty.spdy.api

Examples of org.eclipse.jetty.spdy.api.HeadersInfo


    private void reply(Stream stream, ReplyInfo replyInfo, Callback callback)
    {
        if (!stream.isUnidirectional())
            stream.reply(replyInfo, callback);
        else
            stream.headers(new HeadersInfo(replyInfo.getHeaders(), replyInfo.isClose()), callback);

        Fields responseHeaders = replyInfo.getHeaders();
        if (responseHeaders.get(HTTPSPDYHeader.STATUS.name(version)).getValue().startsWith("200") && !stream.isClosed())
        {
            Set<String> pushResources = pushStrategy.apply(stream, requestHeaders, responseHeaders);
View Full Code Here


            }
            case HEADERS:
            {
                HeadersFrame headers = (HeadersFrame)frame;
                updateCloseState(headers.isClose(), false);
                HeadersInfo headersInfo = new HeadersInfo(headers.getHeaders(), headers.isClose(), headers.isResetCompression());
                notifyOnHeaders(headersInfo);
                break;
            }
            case RST_STREAM:
            {
View Full Code Here

    @Test(expected = IllegalStateException.class)
    public void testSendHeadersAfterCloseIsIllegal() throws Exception
    {
        Session session = startClient(startServer(null), null);
        Stream stream = session.syn(new SynInfo(5, TimeUnit.SECONDS, new Fields(), true, (byte)0), null);
        stream.headers(new HeadersInfo(new Fields(), true));
    }
View Full Code Here

                {
                    @Override
                    public void onHeaders(Stream stream, HeadersInfo headersInfo)
                    {
                        Assert.assertTrue(stream.isHalfClosed());
                        stream.headers(new HeadersInfo(new Fields(), true), new Callback.Adapter());
                        Assert.assertTrue(stream.isClosed());
                    }
                };
            }
        };

        Session session = startClient(startServer(serverSessionFrameListener), null);

        final CountDownLatch latch = new CountDownLatch(1);
        session.syn(new SynInfo(new Fields(), false), new StreamFrameListener.Adapter()
        {
            @Override
            public void onReply(Stream stream, ReplyInfo replyInfo)
            {
                Fields headers = new Fields();
                headers.put("foo", "bar");
                headers.put("baz", "woo");
                stream.headers(new HeadersInfo(headers, true), new Callback.Adapter());
                Assert.assertTrue(stream.isHalfClosed());
            }

            @Override
            public void onHeaders(Stream stream, HeadersInfo headersInfo)
View Full Code Here

        setControllerWriteExpectation(false);

        IStream stream = createStream();
        assertThatStreamIsInSession(stream);
        stream.updateCloseState(true, false);
        stream.headers(new HeadersInfo(headers, true));
        assertThatStreamIsClosed(stream);
        assertThatStreamIsNotInSession(stream);
    }
View Full Code Here

        IStream stream = createStream();
        PushInfo pushInfo = new PushInfo(5, TimeUnit.SECONDS, headers, false);
        IStream pushStream = (IStream)stream.push(pushInfo);
        assertThatStreamIsAssociatedWithPushStream(stream, pushStream);
        assertThatPushStreamIsInSession(pushStream);
        pushStream.headers(new HeadersInfo(headers, true));
        assertThatPushStreamIsNotInSession(pushStream);
        assertThatPushStreamIsHalfClosed(pushStream);
        assertThatPushStreamIsClosed(pushStream);
        assertThatStreamIsNotAssociatedWithPushStream(stream, pushStream);
    }
View Full Code Here

        setControllerWriteExpectation(false);

        // This is necessary to keep the compression context of Headers valid
        IStream stream = createStream();
        session.rst(new RstInfo(stream.getId(), StreamStatus.INVALID_STREAM));
        stream.headers(new HeadersInfo(headers, true));

        verify(controller, times(3)).write(any(Callback.class), any(ByteBuffer.class));
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.spdy.api.HeadersInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.