def read
import bend-kit-postgres@0.3.0.0/postgres.bend as Postgresimport Base
import bend-kit-postgres@0.3.0.0/codec.bend as Codec
185# The next message. Bytes already read are decoded before the socket is asked for more.
186# 2^24 reads of up to 64 KiB pass Postgres's 1 GiB field limit.
187def read(c: Conn) -> IO(Result<&1, &1, Failure, Conn & Codec.Back>):
188 Conn{tls, sock, rd, key, ms, status} = c
189 read.loop(Nat.mul(65536n, 256n), RNext{tls, sock, key, ms, status, Codec.next(rd)})