In the event of a connection timeout the read method will return a buffer with some data up front, zeros padding the end, and no indication of how many bytes were actually read. There's no way to distinguish between zeros padding the data and zeros occurring immediately before the timeout.
This fixes the problem by only returning a buffer the size of the data that was read.
In the event of a connection timeout the read method will return a buffer with some data up front, zeros padding the end, and no indication of how many bytes were actually read. There's no way to distinguish between zeros padding the data and zeros occurring immediately before the timeout.
This fixes the problem by only returning a buffer the size of the data that was read.
Fixes #59