Initial passing tests

non-blocking
Jack Christensen 2022-06-04 08:58:05 -05:00
parent ea3cdab234
commit f1df39a29d
1 changed files with 2 additions and 2 deletions

View File

@ -1159,7 +1159,7 @@ func (pgConn *PgConn) CopyFrom(ctx context.Context, r io.Reader, sql string) (Co
buf[0] = 'd' buf[0] = 'd'
var readErr, pgErr error var readErr, pgErr error
for { for pgErr == nil {
// Read chunk from r. // Read chunk from r.
var n int var n int
n, readErr = r.Read(buf[5:cap(buf)]) n, readErr = r.Read(buf[5:cap(buf)])
@ -1182,7 +1182,7 @@ func (pgConn *PgConn) CopyFrom(ctx context.Context, r io.Reader, sql string) (Co
} }
// Read messages until error or none available. // Read messages until error or none available.
for { for pgErr == nil {
msg, err := pgConn.receiveMessage() msg, err := pgConn.receiveMessage()
if err != nil { if err != nil {
if errors.Is(err, nbbconn.ErrWouldBlock) { if errors.Is(err, nbbconn.ErrWouldBlock) {