def packed.heads

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

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

193# the heads in turn from p, at most `fuel` of them
194def packed.heads(fuel: Nat, +asked: Bool, b: Bytes.Bytes, +p: U32, +len: U32)
195  -> Got:
196  match fuel:
197    case 0n:
198      Torn{"the response head has no blank line after it"}
199    case 1n+f:
200      packed.head(asked, Bytes.find.from(b, "\r\n\r\n", p), p, len,
201        b2 => q => packed.heads(f, asked, b2, q, len))

Uses (7)

Used by (1)