mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-04-25 11:02:12 +00:00
Also add warn if parsing of a packet fails, so problems with for example packet sizes can more easily be detected. Reasoning: The previous 2048 bytes is already larger than the recommend size by [rfc6762](https://tools.ietf.org/html/rfc6762#page-46), which recommends a packet size that fits within the interface MTU. Nevertheless the rfc also states, that if more data needs to be transmitted one should rely on IP fragments, which would only pose problems when interfacing with devices not understanding IP fragments. The standard also imposes a strict upper limit of 9000 bytes. Therefore raising `recv_buffer` to 4096 seems sensible, given that we already exceed the recommend size and given that we are not restricting the size when sending in any way. Meaning the implementation already sends packets larger than recommended, just can't handle them on reception.