Skip to content

Extra 4 zero bytes in ACKACK, KEEPALIVE, etc. #983

@maxsharabayko

Description

@maxsharabayko

There are extra four zero bytes sent at the end of ACKACK, CGWARNING, KEEPALIVE, SHUTDOWN, PEERERROR.
The main motivation for this seems to be due to code design.
Every SRT packet has two buffers to send: header and data. Both pointers are converted directly when passing to the UDP socket. Having a null pointer as the second buffer does not work with UDP ::send() function, therefore the second buffer is just set to 4 zero bytes.

This is a minor thing. But it has two drawbacks:

  1. Four unused bytes are vainly sent over the network (very small overhead though)ю
  2. Each CPacket structure stored in memory has 4 extra bytes CPacket::__pad. thus slightly increasing memory utilization with no proper reason.

Metadata

Metadata

Assignees

Labels

Priority: HighType: MaintenanceWork required to maintain or clean up the code[core]Area: Changes in SRT library core

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions