def packed.sized

emerging-ezhttp@0.21.0.0 · src/packed.bend:129

import emerging-ezhttp@0.21.0.0/src/packed.bend as Packed
import Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
import emerging-ezhttp@0.21.0.0/src/http.bend as Http

129# a body framed by Content-Length: torn when fewer octets arrived
130def packed.sized(st: U32, hs: List<&2, Http.Header>, reason: String,
131  b: Bytes.Bytes, +q: U32, +n: Nat, short: Bool) -> Got:
132  match short:
133    case True{}:
134      Torn{"the response body stopped before its Content-Length"}
135    case False{}:
136      Got{st, hs, reason, packed.copy(b, q, U32.from_nat(n))}

Uses (10)

Used by (1)