def fetch.loop

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

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

2590def fetch.loop(+close: Bool, +head: Bool, +tls: Bool, +ms: U32, st: Socket & Fl) -> IO(Out):
2591  (s, fl) = st
2592  match fl:
2593    case FlMore{rv, +n}:
2594      do IO<Out>:
2595        m : Socket & Result<&1, &1, U32 & String, U32 & Array<U32>> <- io.recv.words(tls, s, 65536, ms)
2596        fetch.loop(close, head, tls, ms, fetch.next(head, rv, n, m))
2597    case FlBad{err, none}:
2598      fetch.failout(tls, s, err, none)
2599    case FlDone{res, rest}:
2600      fetch.hold(tls, close, s, res, rest)

Uses (16)

Used by (1)