use of io.aklivity.zilla.runtime.binding.http.internal.codec.Http2PriorityFW in project zilla by aklivity.
the class HttpServerFactory method decodePriority.
private int decodePriority(Http2Server server, long traceId, long authorization, long budgetId, DirectBuffer buffer, int offset, int limit) {
int progress = offset;
final Http2FrameInfoFW http2FrameInfo = http2FrameInfoRO.wrap(buffer, offset, limit);
final int streamId = http2FrameInfo.streamId();
final int length = http2FrameInfo.length();
Http2ErrorCode error = Http2ErrorCode.NO_ERROR;
if (length != 5) {
error = Http2ErrorCode.FRAME_SIZE_ERROR;
} else if (streamId == 0) {
error = Http2ErrorCode.PROTOCOL_ERROR;
}
if (error != Http2ErrorCode.NO_ERROR) {
server.onDecodeError(traceId, authorization, error);
server.decoder = decodeHttp2IgnoreAll;
} else {
final Http2PriorityFW http2Priority = http2PriorityRO.wrap(buffer, offset, limit);
server.onDecodePriority(traceId, authorization, http2Priority);
server.decoder = decodeHttp2FrameType;
progress = http2Priority.limit();
}
return progress;
}
Aggregations