Examples of RstInfo


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

    public void headers(HeadersInfo headersInfo, Callback callback)
    {
        notIdle();
        if (!canSend())
        {
            session.rst(new RstInfo(getId(), StreamStatus.PROTOCOL_ERROR), new StreamCallback());
            throw new IllegalStateException("Protocol violation: cannot send a HEADERS frame before a SYN_REPLY frame");
        }
        if (isLocallyClosed())
        {
            session.rst(new RstInfo(getId(), StreamStatus.PROTOCOL_ERROR), new StreamCallback());
            throw new IllegalStateException("Protocol violation: cannot send a HEADERS frame on a closed stream");
        }

        updateCloseState(headersInfo.isClose(), true);
        HeadersFrame frame = new HeadersFrame(session.getVersion(), headersInfo.getFlags(), getId(), headersInfo.getHeaders());
View Full Code Here

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

            int streamId = frame.getStreamId();
            IStream stream = streams.get(streamId);
            if (stream == null)
            {
                RstInfo rstInfo = new RstInfo(streamId, StreamStatus.INVALID_STREAM);
                if (LOG.isDebugEnabled())
                    LOG.debug("Unknown stream {}", rstInfo);
                rst(rstInfo, Callback.Adapter.INSTANCE);
            }
            else
View Full Code Here

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

    @Override
    public void onStreamException(StreamException x)
    {
        notifyOnFailure(listener, x); // TODO: notify StreamFrameListener if exists?
        rst(new RstInfo(x.getStreamId(), x.getStreamStatus()), Callback.Adapter.INSTANCE);
    }
View Full Code Here

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

            if (local)
            {
                localStreamCount.decrementAndGet();
                throw duplicateIdException;
            }
            RstInfo rstInfo = new RstInfo(streamId, StreamStatus.PROTOCOL_ERROR);
            if (LOG.isDebugEnabled())
                LOG.debug("Duplicate stream, {}", rstInfo);
            rst(rstInfo, Callback.Adapter.INSTANCE); // We don't care (too much) if the reset fails.
            return null;
        }
View Full Code Here

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

    {
        int streamId = frame.getStreamId();
        IStream stream = streams.get(streamId);
        if (stream == null)
        {
            RstInfo rstInfo = new RstInfo(streamId, StreamStatus.INVALID_STREAM);
            if (LOG.isDebugEnabled())
                LOG.debug("Unknown stream {}", rstInfo);
            rst(rstInfo, Callback.Adapter.INSTANCE);
        }
        else
View Full Code Here

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

        IStream stream = streams.get(frame.getStreamId());

        if (stream != null)
            stream.process(frame);

        RstInfo rstInfo = new RstInfo(frame.getStreamId(), StreamStatus.from(frame.getVersion(), frame.getStatusCode()));
        notifyOnRst(listener, rstInfo);

        if (stream != null)
            removeStream(stream);
    }
View Full Code Here

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

    {
        int streamId = frame.getStreamId();
        IStream stream = streams.get(streamId);
        if (stream == null)
        {
            RstInfo rstInfo = new RstInfo(streamId, StreamStatus.INVALID_STREAM);
            if (LOG.isDebugEnabled())
                LOG.debug("Unknown stream, {}", rstInfo);
            rst(rstInfo, Callback.Adapter.INSTANCE);
        }
        else
View Full Code Here

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

    public void testResetStreamIsRemoved() throws Exception
    {
        Session session = startClient(startServer(new ServerSessionFrameListener.Adapter()/*TODO, true*/), null);

        Stream stream = session.syn(new SynInfo(5, TimeUnit.SECONDS, new Fields(), false, (byte)0), null);
        session.rst(new RstInfo(5, TimeUnit.SECONDS, stream.getId(), StreamStatus.CANCEL_STREAM));

        assertEquals("session expected to contain 0 streams", 0, session.getStreams().size());
    }
View Full Code Here

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

            @Override
            public StreamFrameListener onSyn(Stream stream, SynInfo synInfo)
            {
                Session serverSession = stream.getSession();
                serverSessionRef.set(serverSession);
                serverSession.rst(new RstInfo(stream.getId(), StreamStatus.REFUSED_STREAM), new FutureCallback());
                synLatch.countDown();
                return null;
            }
        }), new SessionFrameListener.Adapter()
        {
View Full Code Here

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

            {
                try
                {
                    // Refuse the stream, we must ignore data frames
                    assertTrue(synLatch.await(5, TimeUnit.SECONDS));
                    stream.getSession().rst(new RstInfo(stream.getId(), StreamStatus.REFUSED_STREAM), new FutureCallback());
                    return new StreamFrameListener.Adapter()
                    {
                        @Override
                        public void onData(Stream stream, DataInfo dataInfo)
                        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.