Package org.eclipse.jetty.http3.qpack
Class QpackDecoder
java.lang.Object
org.eclipse.jetty.http3.qpack.QpackDecoder
- All Implemented Interfaces:
Dumpable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
decode
(long streamId, ByteBuffer buffer, QpackDecoder.Handler handler) Decode a buffer into aMetaData
object given a HTTP/3 stream ID.void
dump
(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.int
int
int
void
parseInstructions
(ByteBuffer buffer) Parse instructions from the Encoder stream.void
setBeginNanoTimeSupplier
(LongSupplier beginNanoTimeSupplier) void
setMaxBlockedStreams
(int maxBlockedStreams) void
setMaxHeadersSize
(int maxHeadersSize) void
setMaxTableCapacity
(int maxTableCapacity) void
streamCancellation
(long streamId) Tells theQpackDecoder
that a particular stream has been cancelled.toString()
-
Constructor Details
-
QpackDecoder
-
-
Method Details
-
getMaxHeadersSize
public int getMaxHeadersSize() -
setBeginNanoTimeSupplier
-
setMaxHeadersSize
public void setMaxHeadersSize(int maxHeadersSize) - Parameters:
maxHeadersSize
- The maximum allowed size of a headers block, expressed as total of all name and value characters, plus 32 per field
-
getMaxBlockedStreams
public int getMaxBlockedStreams() -
setMaxBlockedStreams
public void setMaxBlockedStreams(int maxBlockedStreams) -
getMaxTableCapacity
public int getMaxTableCapacity() -
setMaxTableCapacity
public void setMaxTableCapacity(int maxTableCapacity) -
decode
public boolean decode(long streamId, ByteBuffer buffer, QpackDecoder.Handler handler) throws QpackException Decode a buffer into a
MetaData
object given a HTTP/3 stream ID. The buffer must be the complete content of a headers frame and will be fully consumed. It may be that the Dynamic Table does not yet contain the state required to decode this headers frame, in this case the encoded headers will be saved until the required state arrives on the instruction stream to update the dynamic table.This method may generate instructions to be sent back over the Decoder stream to the remote Encoder.
- Parameters:
streamId
- the stream ID corresponding to this headers frame.buffer
- the content of the headers frame.handler
- a handler that is invoked when the MetaData is able to be decoded.- Returns:
- true if the MetaData could be decoded immediately without requiring addition state in the DynamicTable.
- Throws:
QpackException
- if there was an error with the QPACK decompression.
-
parseInstructions
Parse instructions from the Encoder stream. The Encoder stream carries an unframed sequence of instructions from the Encoder to the Decoder. This method will fully consume the suppliedByteBuffer
and produce instructions to update the state of the Decoder and its Dynamic Table.- Parameters:
buffer
- a buffer containing bytes from the Encoder stream.- Throws:
QpackException.SessionException
- if there was an error parsing or handling the instructions.
-
streamCancellation
public void streamCancellation(long streamId) Tells theQpackDecoder
that a particular stream has been cancelled. Any encoded field sections for this stream will be discarded and a stream cancellation instruction will be sent to the remote Encoder.- Parameters:
streamId
- the streamId of the stream that was cancelled.
-
dump
Description copied from interface:Dumpable
Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dump
in interfaceDumpable
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-
toString
-