If you send a friend request through the onion with a message over a certain threshold but still under TOX_MAX_FRIEND_REQUEST_LENGTH, the request will succeed on the sender's side, but be dropped on the receiving side. This is because the length of the request packet is too large for the onion data packet handler.
If you send a friend request through the onion with a message over a certain threshold but still under
TOX_MAX_FRIEND_REQUEST_LENGTH
, the request will succeed on the sender's side, but be dropped on the receiving side. This is because the length of the request packet is too large for the onion data packet handler.The fix: Reduce MAX_FRIEND_REQUEST_DATA_SIZE and TOX_MAX_FRIEND_REQUEST_LENGTH so that the maximum possible packet size received by handle_data_response() is <= MAX_DATA_REQUEST_SIZE. The length check in send_friend_request_packet() also needs to be adjusted to match the new value.
The bigger fix: The onion shouldn't be able to send packets that are too large to be handled.