Skip to content

Commit

Permalink
Move copying new settings to size-checked part
Browse files Browse the repository at this point in the history
  • Loading branch information
rzikm committed Oct 31, 2023
1 parent 36135d7 commit 1c4dce8
Showing 1 changed file with 41 additions and 6 deletions.
47 changes: 41 additions & 6 deletions src/core/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -1710,9 +1710,6 @@ QuicSettingsSettingsToInternal(
SETTING_COPY_TO_INTERNAL(TlsClientMaxSendBuffer, Settings, InternalSettings);
SETTING_COPY_TO_INTERNAL(TlsServerMaxSendBuffer, Settings, InternalSettings);
SETTING_COPY_TO_INTERNAL(StreamRecvWindowDefault, Settings, InternalSettings);
SETTING_COPY_TO_INTERNAL(StreamRecvWindowBidiLocalDefault, Settings, InternalSettings);
SETTING_COPY_TO_INTERNAL(StreamRecvWindowBidiRemoteDefault, Settings, InternalSettings);
SETTING_COPY_TO_INTERNAL(StreamRecvWindowUnidiDefault, Settings, InternalSettings);
SETTING_COPY_TO_INTERNAL(StreamRecvBufferDefault, Settings, InternalSettings);
SETTING_COPY_TO_INTERNAL(ConnFlowControlWindow, Settings, InternalSettings);
SETTING_COPY_TO_INTERNAL(MaxWorkerQueueDelayUs, Settings, InternalSettings);
Expand Down Expand Up @@ -1793,6 +1790,27 @@ QuicSettingsSettingsToInternal(
SettingsSize,
InternalSettings);

SETTING_COPY_TO_INTERNAL_SIZED(
StreamRecvWindowBidiLocalDefault,
QUIC_SETTINGS,
Settings,
SettingsSize,
InternalSettings);

SETTING_COPY_TO_INTERNAL_SIZED(
StreamRecvWindowBidiRemoteDefault,
QUIC_SETTINGS,
Settings,
SettingsSize,
InternalSettings);

SETTING_COPY_TO_INTERNAL_SIZED(
StreamRecvWindowUnidiDefault,
QUIC_SETTINGS,
Settings,
SettingsSize,
InternalSettings);

return QUIC_STATUS_SUCCESS;
}

Expand Down Expand Up @@ -1845,9 +1863,6 @@ QuicSettingsGetSettings(
SETTING_COPY_FROM_INTERNAL(TlsClientMaxSendBuffer, Settings, InternalSettings);
SETTING_COPY_FROM_INTERNAL(TlsServerMaxSendBuffer, Settings, InternalSettings);
SETTING_COPY_FROM_INTERNAL(StreamRecvWindowDefault, Settings, InternalSettings);
SETTING_COPY_FROM_INTERNAL(StreamRecvWindowBidiLocalDefault, Settings, InternalSettings);
SETTING_COPY_FROM_INTERNAL(StreamRecvWindowBidiRemoteDefault, Settings, InternalSettings);
SETTING_COPY_FROM_INTERNAL(StreamRecvWindowUnidiDefault, Settings, InternalSettings);
SETTING_COPY_FROM_INTERNAL(StreamRecvBufferDefault, Settings, InternalSettings);
SETTING_COPY_FROM_INTERNAL(ConnFlowControlWindow, Settings, InternalSettings);
SETTING_COPY_FROM_INTERNAL(MaxWorkerQueueDelayUs, Settings, InternalSettings);
Expand Down Expand Up @@ -1928,6 +1943,26 @@ QuicSettingsGetSettings(
*SettingsLength,
InternalSettings);

SETTING_COPY_FROM_INTERNAL_SIZED(
StreamRecvWindowBidiLocalDefault,
QUIC_SETTINGS,
Settings,
*SettingsLength,
InternalSettings);

SETTING_COPY_FROM_INTERNAL_SIZED(
StreamRecvWindowBidiRemoteDefault,
QUIC_SETTINGS,
Settings,
*SettingsLength,
InternalSettings);

SETTING_COPY_FROM_INTERNAL_SIZED(StreamRecvWindowUnidiDefault,
QUIC_SETTINGS,
Settings,
*SettingsLength,
InternalSettings);

*SettingsLength = CXPLAT_MIN(*SettingsLength, sizeof(QUIC_SETTINGS));

return QUIC_STATUS_SUCCESS;
Expand Down

0 comments on commit 1c4dce8

Please sign in to comment.