Server.server.octets.go: def of emerging-ezhttp@0.21.0.0 Import: import emerging-ezhttp@0.21.0.0/src/server.bend as Server Lines 208-222 of emerging-ezhttp@0.21.0.0/src/server.bend: https://jend.leeeet.dev/read.txt?path=emerging-ezhttp@0.21.0.0/src/server.bend&start_line=208&end_line=222 import Base import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes import emerging-ezhttp@0.21.0.0/src/http.bend as Http import emerging-ezhttp@0.21.0.0/src/step.bend as Step # an octets reply once its length is known: its head, then its octets # unless it is bare (HTTP-SRV-6, 8) def server.octets.go(sock: Socket, +status: U32, headers: List<&2, Http.Header>, r: Bytes.Bytes & U32, bare: Bool) -> IO(Unit): (b, +n) = r match bare: case True{}: IO.bind(Socket & Step.Got, Unit, server.send.text(sock, Http.respond.head(status, headers, 0n)), server.close) case False{}: IO.bind(Socket & Step.Got, Unit, server.send(sock, Bytes.append(Bytes.from_string( Http.respond.head(status, headers, U32.to_nat(n))), b)), server.close) Uses (19): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Socket https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=append https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=from_string https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=Header https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=respond.head https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/server.bend&name=server.close https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/server.bend&name=server.send https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/server.bend&name=server.send.text https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/step.bend&name=Got