def stream.sent

bend-kit-http@0.38.5.0 · http.bend:4950

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

4950def stream.sent(+tls: Bool, +ms: U32, +head: Bool, back: Maybe<&2, String>, m: Socket & Result<&1, &1, U32 & String, Unit>) -> IO(Bool & Result<&1, &1, Err, Stream>):
4951  (s, r) = m
4952  match r:
4953    case Fail{(+code, why)}:
4954      do IO<Bool & Result<&1, &1, Err, Stream>>:
4955        io.close(tls, s)
4956        return (True{}, Fail{err.or_late(code, ErrWrite{code, why})})
4957    case Done{u}:
4958      stream.head(tls, ms, head, back, (s, ShMore{Bytes.new(0), 0}))

Uses (19)

Used by (2)