Skip to content

Commit

Permalink
Add QUIC_SETTINGS Support to SpinQuic (#3758)
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks authored Jul 22, 2023
1 parent feb87e1 commit 9685eb5
Show file tree
Hide file tree
Showing 2 changed files with 225 additions and 65 deletions.
8 changes: 7 additions & 1 deletion src/core/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ QuicSettingApply(
Destination->IsSet.SendIdleTimeoutMs = TRUE;
}
if (Source->IsSet.InitialRttMs && (!Destination->IsSet.InitialRttMs || OverWrite)) {
if (Source->InitialRttMs == 0) {
return FALSE;
}
Destination->InitialRttMs = Source->InitialRttMs;
Destination->IsSet.InitialRttMs = TRUE;
}
Expand All @@ -435,7 +438,7 @@ QuicSettingApply(
Destination->IsSet.MaxAckDelayMs = TRUE;
}
if (Source->IsSet.DisconnectTimeoutMs && (!Destination->IsSet.DisconnectTimeoutMs || OverWrite)) {
if (Source->DisconnectTimeoutMs > QUIC_MAX_DISCONNECT_TIMEOUT) {
if (Source->DisconnectTimeoutMs == 0 || Source->DisconnectTimeoutMs > QUIC_MAX_DISCONNECT_TIMEOUT) {
return FALSE;
}
Destination->DisconnectTimeoutMs = Source->DisconnectTimeoutMs;
Expand Down Expand Up @@ -476,6 +479,9 @@ QuicSettingApply(
Destination->IsSet.TlsClientMaxSendBuffer = TRUE;
}
if (Source->IsSet.StreamRecvWindowDefault && (!Destination->IsSet.StreamRecvWindowDefault || OverWrite)) {
if (Source->StreamRecvWindowDefault == 0 || (Source->StreamRecvWindowDefault & (Source->StreamRecvWindowDefault - 1)) != 0) {
return FALSE; // Must be power of 2
}
Destination->StreamRecvWindowDefault = Source->StreamRecvWindowDefault;
Destination->IsSet.StreamRecvWindowDefault = TRUE;
}
Expand Down
Loading

0 comments on commit 9685eb5

Please sign in to comment.