def sv.chunk.counted

bend-kit-http@0.38.2.0 · http.bend:5733

import bend-kit-http@0.38.2.0/http.bend as Http
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

5733def sv.chunk.counted(+max: Nat, req: Req, v11: Bool, n: U32, st: Dc, rest: Bytes.Bytes, counted: List<&1, Bytes.Bytes> & Nat) -> Turn:
5734  (parts, size) = counted
5735  +total = Nat.add(U32.to_nat(n), size)
5736  sv.chunk.cap(Nat.is_lt(max, total) || Nat.is_lt(U32.to_nat(4294967295), total), req, v11,
5737    U32.from_nat(total), st, parts, rest)

Uses (16)

Used by (1)