inetstack icon indicating copy to clipboard operation
inetstack copied to clipboard

[inetstack] Allow `TcpSegment`'s `data` Field to be Optional

Open BrianZill opened this issue 2 years ago • 0 comments

This PR changes the TcpSegment struct so that the data field is now Option<Buffer> instead of Buffer. This struct is used in issuing transmission requests to the runtime. Before this change, sending a header-only TCP segment required one to create an empty Buffer just to be able to have something to fill this field. When Buffer was a pure stack object, this was still somewhat acceptable, now that we're planning on having all Buffers live in the heap, this change will save us from needless allocations.

This PR fixes Issue #202.

BrianZill avatar Aug 25 '22 20:08 BrianZill