def server.stream.body
import emerging-ezhttp@0.21.0.0/src/server.bend as Serverimport Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
267# a streamed reply after its head: its chunks, or nothing when it is bare
268def server.stream.body(sock: Socket, +ch: Chan(Bytes.Bytes), bare: Bool)
269 -> IO(Unit):
270 match bare:
271 case True{}:
272 IO.bind(Unit, Unit, Chan.close(Bytes.Bytes, ch), _u => Socket.close(sock))
273 case False{}:
274 server.stream.go(server.chunks(), sock, ch)