Skip to content

Commit 4941c07

Browse files
author
dvilaverde
committed
minor cleanup and some more comments
1 parent 88f99a9 commit 4941c07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packet/conn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,11 @@ func (c *Conn) copyN(dst io.Writer, src io.Reader, n int64) (written int64, err
188188
rd, err = io.ReadAtLeast(src, buf, bcap)
189189

190190
n -= int64(rd)
191+
191192
// if we've read to EOF and we have compression then advance the sequence number
192193
// and reset the compressed reader to continue reading the remaining bytes
193194
// in the next compressed packet.
194-
195-
if goErrors.Is(err, io.ErrUnexpectedEOF) && c.Compression != MYSQL_COMPRESS_NONE && rd < bcap {
195+
if c.Compression != MYSQL_COMPRESS_NONE && rd < bcap && goErrors.Is(err, io.ErrUnexpectedEOF) {
196196
c.CompressedSequence++
197197
if c.compressedReader, err = c.newCompressedPacketReader(); err != nil {
198198
return written, errors.Trace(err)

0 commit comments

Comments
 (0)