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:
- Four unused bytes are vainly sent over the network (very small overhead though)ю
- Each
CPacket structure stored in memory has 4 extra bytes CPacket::__pad. thus slightly increasing memory utilization with no proper reason.
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:
CPacketstructure stored in memory has 4 extra bytesCPacket::__pad. thus slightly increasing memory utilization with no proper reason.