Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quic: reduce padding for small packets #3178

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/waltz/quic/fd_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -4157,9 +4157,8 @@ fd_quic_conn_tx( fd_quic_t * quic,
FD_QUIC_CRYPTO_TAG_SZ;
uint padding = initial_pkt ? FD_QUIC_INITIAL_PAYLOAD_SZ_MIN - base_pkt_len : 0u;

/* TODO possibly don't need both SAMPLE_SZ and TAG_SZ */
if( base_pkt_len + padding < ( FD_QUIC_CRYPTO_SAMPLE_SZ + FD_QUIC_CRYPTO_TAG_SZ ) ) {
padding = FD_QUIC_CRYPTO_SAMPLE_SZ + FD_QUIC_CRYPTO_TAG_SZ - base_pkt_len;
if( base_pkt_len + padding < FD_QUIC_CRYPTO_SAMPLE_SZ ) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be

if( pkt_number_len + tot_frame_sz + padding < 4 ) {
  padding = 4 - pkt_number_len
}

padding = FD_QUIC_CRYPTO_SAMPLE_SZ - base_pkt_len;
}

/* this length includes the packet number length (pkt_number_len+1),
Expand Down
Loading