def pool.stream.close
import bend-kit-http@0.38.2.0/http.bend as Httpimport Base
4875# stream.close, but a body read to its end and decoded cleanly gives its connection to the pool.
4876def pool.stream.close(p: Pool, st: Stream) -> IO(Pool):
4877 Stream{+tls, s, ms, res, +rb, out, decs, back} = st
4878 do IO<Pool>:
4879 good : Bool <- stream.finish(decs)
4880 stream.give(Bool.and(good, Bool.and(stream.po.end(out), stream.rb.done(rb))), back, p, tls, s)