public class ServerParser extends Parser
Modifier and Type | Class and Description |
---|---|
static interface |
ServerParser.Listener |
private static class |
ServerParser.State |
Modifier and Type | Field and Description |
---|---|
private ServerParser.Listener |
listener |
private static Logger |
LOG |
private boolean |
notifyPreface |
private PrefaceParser |
prefaceParser |
private ServerParser.State |
state |
Constructor and Description |
---|
ServerParser(ByteBufferPool byteBufferPool,
ServerParser.Listener listener,
int maxDynamicTableSize,
int maxHeaderSize) |
Modifier and Type | Method and Description |
---|---|
void |
directUpgrade()
A direct upgrade is an unofficial upgrade from HTTP/1.1 to HTTP/2.0.
|
private void |
notifyPreface() |
protected void |
onPreface() |
void |
parse(java.nio.ByteBuffer buffer)
Parses the given
buffer bytes and emit events to a Parser.Listener . |
void |
standardUpgrade()
The standard HTTP/1.1 upgrade path.
|
getFrameType, getMaxFrameLength, getMaxSettingsKeys, hasFlag, init, notifyConnectionFailure, parseBody, parseHeader, setMaxFrameLength, setMaxSettingsKeys
private static final Logger LOG
private final ServerParser.Listener listener
private final PrefaceParser prefaceParser
private ServerParser.State state
private boolean notifyPreface
public ServerParser(ByteBufferPool byteBufferPool, ServerParser.Listener listener, int maxDynamicTableSize, int maxHeaderSize)
public void directUpgrade()
A direct upgrade is an unofficial upgrade from HTTP/1.1 to HTTP/2.0.
A direct upgrade is initiated when org.eclipse.jetty.server.HttpConnection
sees a request with these bytes:
PRI * HTTP/2.0\r\n \r\n
This request is part of the HTTP/2.0 preface, indicating that a HTTP/2.0 client is attempting a h2c direct connection.
This is not a standard HTTP/1.1 Upgrade path.
public void standardUpgrade()
The standard HTTP/1.1 upgrade path.
public void parse(java.nio.ByteBuffer buffer)
Parser
Parses the given buffer
bytes and emit events to a Parser.Listener
.
When this method returns, the buffer may not be fully consumed, so invocations to this method should be wrapped in a loop:
while (buffer.hasRemaining()) parser.parse(buffer);
protected void onPreface()
private void notifyPreface()