def packed.chunks
import ezhttp@0.22.0.0/src/packed.bend as Packedimport Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
108# the chunks from the chunk-size line at p, at most `fuel` of them
109def packed.chunks(fuel: Nat, b: Bytes.Bytes, +p: U32, +len: U32,
110 acc: List<&1, Bytes.Bytes>) -> Parts:
111 match fuel:
112 case 0n:
113 Bad{"the chunked body is truncated"}
114 case 1n+f:
115 packed.chunk.at(Bytes.find.from(b, "\r\n", p), p, len, acc,
116 b2 => q => a2 => packed.chunks(f, b2, q, len, a2))