turn/ttorrent — pull request #40 by pankdm (2013-04-10 08:46:57+00:00)
Title: Fix read when message size wasn't read in one step

This bug is not that easy to reproduce, but the mental experiment can help.

Suppose that you received only 3 (out of 4) bytes for message size.
Then you would go for the next iteration, call `buffer.rewind()`,that will throw away all the read bytes and starts reading message size from the new position. (and the new message size read will obviously be incorrect).

This patch hopefully fixes this behavior.