Previously when writing the framed messages to the vsock connection we could perform a short write and not realise, allowing the stream to desynchronise. This patch uses io.Copy to ensure the length field and the payload are fully read, or an error is returned and the connection is closed (and subsequently re-opened).
Previously when writing the framed messages to the vsock connection we could perform a short write and not realise, allowing the stream to desynchronise. This patch uses
io.Copy
to ensure the length field and the payload are fully read, or an error is returned and the connection is closed (and subsequently re-opened).This hopefully fixes the problem demonstrated in
https://github.com/linuxkit/linuxkit/pull/702#issuecomment-261573615
Signed-off-by: David Scott dave.scott@docker.com