dotcloud/docker-py — pull request #123 by mpetazzoni (2013-12-16 23:55:34+00:00)
Title: Fix stream receive by correctly reading all required bytes from the socket

`socket.recv()` doesn't always return the requested number of bytes if the data isn't ready (slow network for example). Since log streaming is blocking by nature, we can simply implement a loop on `socket.recv()` to fill the buffer until the requested number of bytes has been received.

This is crucial for correct multiplexed stream decoding.