title: Bittorrent bitfield length
body: <p>I write BitTorrent client and right now I'm dealing with bitfield messages.
  The bitfield message looks like below:</p>
  
  <pre><code> &lt;len=0001+X&gt;&lt;id=5&gt;&lt;bitfield&gt;
  </code></pre>
  
  <p>The problem is that the len is always the same while the actual length of message is always different. Here's my python code:</p>
  
  <pre><code>message = self.recv(4096)
  print(len(message)) #prints different numbers every time
  current_msg_len = struct.unpack('!I', message[:4])[0]
  print(current_msg_len) #always prints the same number
  </code></pre>
  
  <p>I am using TCP and I know that I can get incomplete message, but after handshake and bitfield there are no any messages coming in. 
  An example of the received message:</p>
  
  <pre><code>[0, 0, 0, 95, 5, 255, 255, 255, 255, 254, 254, 255, 239, 255, 255, 255, 255, 255, 255, 255, 255, 247, 253, 255]
  </code></pre>