Closed jonathathan closed 7 years ago
We were throwing ErrUnexpectedEOF when Read didn't fill the 4 byte buffer, but reading less than expected from bufio.Reader is OK!
From https://golang.org/pkg/io/#Reader
If some data is available but not len(p) bytes, Read conventionally returns what is available instead of waiting for more.
We now use io.ReadFull
We were throwing ErrUnexpectedEOF when Read didn't fill the 4 byte buffer, but reading less than expected from bufio.Reader is OK!
From https://golang.org/pkg/io/#Reader
We now use io.ReadFull