Package org.eclipse.jetty.http2.frames

Examples of org.eclipse.jetty.http2.frames.SettingsFrame


    public void testBadPingWrongStreamId() throws Exception
    {
        startServer(new HttpServlet(){});

        ByteBufferPool.Lease lease = new ByteBufferPool.Lease(byteBufferPool);
        generator.control(lease, new PrefaceFrame());
        generator.control(lease, new PingFrame(new byte[8], false));
        // Modify the streamId of the frame to non zero.
        lease.getByteBuffers().get(1).putInt(4, 1);

        final CountDownLatch latch = new CountDownLatch(1);
View Full Code Here


                }
            }
        });

        ByteBufferPool.Lease lease = new ByteBufferPool.Lease(byteBufferPool);
        generator.control(lease, new PrefaceFrame());
        MetaData.Request metaData = newRequest("GET", new HttpFields());
        generator.control(lease, new HeadersFrame(1, metaData, null, true));

        try (Socket client = new Socket("localhost", connector.getLocalPort()))
        {
View Full Code Here

                return null;
            }
        });

        ByteBufferPool.Lease lease = new ByteBufferPool.Lease(byteBufferPool);
        generator.control(lease, new PrefaceFrame());
        MetaData.Request metaData = newRequest("GET", new HttpFields());
        generator.control(lease, new HeadersFrame(1, metaData, null, true));
        generator.control(lease, new GoAwayFrame(1, ErrorCodes.NO_ERROR, "OK".getBytes("UTF-8")));

        try (Socket client = new Socket("localhost", connector.getLocalPort()))
View Full Code Here

            }
        });
        connector.setIdleTimeout(idleTimeout);

        ByteBufferPool.Lease lease = new ByteBufferPool.Lease(byteBufferPool);
        generator.control(lease, new PrefaceFrame());
        MetaData.Request metaData = newRequest("GET", new HttpFields());
        generator.control(lease, new HeadersFrame(1, metaData, null, true));

        try (Socket client = new Socket("localhost", connector.getLocalPort()))
        {
View Full Code Here

        return Result.PENDING;
    }

    private Result onPriority(int streamId, int weight, boolean exclusive)
    {
        PriorityFrame frame = new PriorityFrame(streamId, getStreamId(), weight, exclusive);
        reset();
        return notifyPriority(frame) ? Result.ASYNC : Result.COMPLETE;
    }
View Full Code Here

        return Result.PENDING;
    }

    private boolean onHeaders(int streamId, int weight, boolean exclusive, MetaData metaData)
    {
        PriorityFrame priorityFrame = null;
        if (hasFlag(Flags.PRIORITY))
        {
            priorityFrame = new PriorityFrame(streamId, getStreamId(), weight, exclusive);
        }
        HeadersFrame frame = new HeadersFrame(getStreamId(), metaData, priorityFrame, isEndStream());
        return notifyHeaders(frame);
    }
View Full Code Here

        return Result.PENDING;
    }

    private boolean onPushPromise(int streamId, MetaData metaData)
    {
        PushPromiseFrame frame = new PushPromiseFrame(getStreamId(), streamId, metaData);
        return notifyPushPromise(frame);
    }
View Full Code Here

        return Result.PENDING;
    }

    private Result onReset(int error)
    {
        ResetFrame frame = new ResetFrame(getStreamId(), error);
        reset();
        return notifyReset(frame) ? Result.ASYNC : Result.COMPLETE;
    }
View Full Code Here

        return Result.PENDING;
    }

    private Result onSettings(Map<Integer, Integer> settings)
    {
        SettingsFrame frame = new SettingsFrame(settings, hasFlag(Flags.ACK));
        reset();
        return notifySettings(frame) ? Result.ASYNC : Result.COMPLETE;
    }
View Full Code Here

            Map<Integer, Integer> settings = listener.onPreface(getSession());
            if (settings == null)
                settings = Collections.emptyMap();

            PrefaceFrame prefaceFrame = new PrefaceFrame();
            SettingsFrame settingsFrame = new SettingsFrame(settings, false);
            int windowDelta = getInitialSessionWindow() - FlowControl.DEFAULT_WINDOW_SIZE;
            if (windowDelta > 0)
                getSession().control(null, this, prefaceFrame, settingsFrame, new WindowUpdateFrame(0, windowDelta));
            else
                getSession().control(null, this, prefaceFrame, settingsFrame);
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.http2.frames.SettingsFrame

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.