Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
transport: use io.ReadFull in recv()
Currently, recv() does not check the number of bytes read into the buffer during its Read() calls. This means that in some cases a partial read may occur, which will cause the next recv() call to read the packet length incorrectly. In particular, this may be a huge number and cause a huge buffer allocation. To fix this, simply use io.ReadFull to make sure we do not get partial reads. Related: #34 Signed-off-by: Nick Rosbrook <nr@enr0n.net>
- Loading branch information