openai / go-vncdriver

Fast VNC driver
MIT License
123 stars 60 forks source link

transcode: fix unexpected EOF #20

Closed jonathathan closed 7 years ago

jonathathan commented 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