You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Packet::CanWriteToPacket treats Packet::limit as an exclusive bound on the packet size, such that the packet size must always be < the limit.
Other functions such as Packet::Send_bytes and Packet::ParsePacketSize treat Packet::limit as an inclusive bound on the packet size, such that the packet size must always be <= the limit.
The latter interpretation would make more sense as the "correct" behaviour, so it would seem better to correct Packet::CanWriteToPacket to match the others instead of the other way around?
If data to send is sized to fill the packet limit exactly using the latter interpretation of the limit (I made this assumption before noticing the discrepancy) an assertion is triggered.
The text was updated successfully, but these errors were encountered:
Version of OpenTTD
master (at least since a2051ba)
Details
Packet::CanWriteToPacket treats Packet::limit as an exclusive bound on the packet size, such that the packet size must always be < the limit.
Other functions such as Packet::Send_bytes and Packet::ParsePacketSize treat Packet::limit as an inclusive bound on the packet size, such that the packet size must always be <= the limit.
The latter interpretation would make more sense as the "correct" behaviour, so it would seem better to correct Packet::CanWriteToPacket to match the others instead of the other way around?
If data to send is sized to fill the packet limit exactly using the latter interpretation of the limit (I made this assumption before noticing the discrepancy) an assertion is triggered.
The text was updated successfully, but these errors were encountered: