textileio / go-textile

[DEPRECATED] Textile is a set of tools and infrastructure for building composable apps and services on the IPFS network
https://textile.io
MIT License
357 stars 43 forks source link

Integer overflow in cafe http stream #944

Open requilence opened 4 years ago

requilence commented 4 years ago

Describe the bug When a cafe tries to send the payload larger than uint16(65535) length, it overflows the size bytes here. As a result, a client is got unexpected EOF when trying to unmarshal into pb.Envelope here

To Reproduce

  1. Create a lot of peers for an account
  2. Do SearchContacts, providing this account's address

Expected behavior Got accounts as usual

I'm not sure what is a good way to fix this while preserving backward compatibility. Here is what I have in mind

Let me know what do you think do so I can provide PR