use of io.aklivity.zilla.runtime.binding.http.internal.codec.Http2ContinuationFW in project zilla by aklivity.
the class HttpServerFactory method decodeHttp2Continuation.
private int decodeHttp2Continuation(Http2Server server, long traceId, long authorization, long budgetId, DirectBuffer buffer, int offset, int limit) {
int progress = offset;
final Http2ContinuationFW http2Continuation = http2ContinuationRO.wrap(buffer, offset, limit);
final int streamId = http2Continuation.streamId();
final int length = http2Continuation.length();
Http2ErrorCode error = Http2ErrorCode.NO_ERROR;
if ((streamId & 0x01) != 0x01 || streamId != server.continuationStreamId) {
error = Http2ErrorCode.PROTOCOL_ERROR;
}
if (server.headersSlotOffset + length > headersPool.slotCapacity()) {
// TODO: decoded header list size check, recoverable error instead
error = Http2ErrorCode.PROTOCOL_ERROR;
}
if (error != Http2ErrorCode.NO_ERROR) {
server.onDecodeError(traceId, authorization, error);
server.decoder = decodeHttp2IgnoreAll;
} else {
server.onDecodeContinuation(traceId, authorization, http2Continuation);
server.decoder = decodeHttp2FrameType;
progress = http2Continuation.limit();
}
return progress;
}
Aggregations