def sh.next
import bend-kit-http@0.38.2.0/http.bend as Httpimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
4909def sh.next(+head: Bool, buf: Bytes.Bytes, +k: U32, m: Socket & Result<&1, &1, U32 & String, U32 & Array<U32>>) -> Socket & Sh:
4910 (s, r) = m
4911 match r:
4912 case Fail{(+code, why)}:
4913 (s, ShBad{Some{err.or_late(code, ErrRead{code, why})}, sh.none(buf, k)})
4914 case Done{p}:
4915 (s, sh.piece(head, buf, k, p))