def packed.head

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

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

182# a head that ends at i, or none ends
183def packed.head(+asked: Bool, r: Bytes.Bytes & Maybe<&2, U32>, +p: U32,
184  +len: U32, rest: Bytes.Bytes -> U32 -> Got) -> Got:
185  (b, at) = r
186  match at:
187    case None{}:
188      Torn{"the response head has no blank line after it"}
189    case Some{+i}:
190      packed.head.text(asked, packed.text(b, p, (i - p : U32)), (i + 4 : U32),
191        len, rest)

Uses (11)

Used by (1)