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

chore: Removed duplicate frame setting options #35

Merged
merged 2 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
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: 3 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1186,9 +1186,10 @@ impl Builder {
self
}

/// unknown_setting8
/// Sets the enable connect protocol.
pub fn unknown_setting8(&mut self, enabled: bool) -> &mut Self {
self.settings.set_unknown_setting_8(enabled);
self.settings
.set_enable_connect_protocol(Some(enabled as _));
self
}

Expand Down
26 changes: 2 additions & 24 deletions src/frame/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ pub struct Settings {
max_frame_size: Option<u32>,
max_header_list_size: Option<u32>,
enable_connect_protocol: Option<u32>,
unknown_setting_8: Option<u32>,
unknown_setting_9: Option<u32>,
// Fields for the settings frame order
settings_orders: SettingsOrders,
Expand All @@ -70,7 +69,6 @@ pub enum Setting {
MaxFrameSize(u32),
MaxHeaderListSize(u32),
EnableConnectProtocol(u32),
UnknownSetting8(u32),
UnknownSetting9(u32),
}

Expand Down Expand Up @@ -168,10 +166,6 @@ impl Settings {
self.header_table_size = size;
}

pub fn set_unknown_setting_8(&mut self, enable: bool) {
self.unknown_setting_8 = Some(enable as u32);
}

pub fn set_unknown_setting_9(&mut self, enable: bool) {
self.unknown_setting_9 = Some(enable as u32);
}
Expand Down Expand Up @@ -252,14 +246,6 @@ impl Settings {
return Err(Error::InvalidSettingValue);
}
},
Some(UnknownSetting8(val)) => match val {
0 | 1 => {
settings.unknown_setting_8 = Some(val);
}
_ => {
return Err(Error::InvalidSettingValue);
}
},
Some(UnknownSetting9(val)) => match val {
0 | 1 => {
settings.unknown_setting_9 = Some(val);
Expand Down Expand Up @@ -323,8 +309,8 @@ impl Settings {
}
}
SettingsOrder::UnknownSetting8 => {
if let Some(v) = self.unknown_setting_8 {
f(UnknownSetting8(v));
if let Some(v) = self.enable_connect_protocol {
f(EnableConnectProtocol(v));
}
}
SettingsOrder::UnknownSetting9 => {
Expand All @@ -344,10 +330,6 @@ impl Settings {
}
}
}

if let Some(v) = self.enable_connect_protocol {
f(EnableConnectProtocol(v));
}
}
}

Expand Down Expand Up @@ -384,9 +366,6 @@ impl fmt::Debug for Settings {
Setting::EnableConnectProtocol(v) => {
builder.field("enable_connect_protocol", &v);
}
Setting::UnknownSetting8(v) => {
builder.field("unknown_setting8", &v);
}
Setting::UnknownSetting9(v) => {
builder.field("unknown_setting9", &v);
}
Expand Down Expand Up @@ -445,7 +424,6 @@ impl Setting {
MaxFrameSize(v) => (5, v),
MaxHeaderListSize(v) => (6, v),
EnableConnectProtocol(v) => (8, v),
UnknownSetting8(v) => (8, v),
UnknownSetting9(v) => (9, v),
};

Expand Down
Loading