Skip to content

Commit

Permalink
Add preview API feature (#4730)
Browse files Browse the repository at this point in the history
  • Loading branch information
masa-koz authored Jan 2, 2025
1 parent f16a46b commit 38469af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ include = [
[features]
default = []
static = []
preview-api = []

[build-dependencies]
cmake = "0.1"
Expand Down
13 changes: 13 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ pub struct Settings {
pub mtu_operations_per_drain: u8,
pub mtu_discovery_missing_probe_count: u8,
pub dest_cid_update_idle_timeout_ms: u32,
pub other2_flags: u64,
}

pub const PARAM_GLOBAL_RETRY_MEMORY_PERCENT: u32 = 0x01000000;
Expand Down Expand Up @@ -1454,6 +1455,12 @@ impl Settings {
self.other_flags |= (value as u8) << 3;
self
}
#[cfg(feature = "preview-api")]
pub fn set_stream_multi_receive_enabled(&mut self, value: bool) -> &mut Settings {
self.is_set_flags |= 1 << 42;
self.other2_flags |= (value as u64) << 5;
self
}
}

impl CredentialConfig {
Expand Down Expand Up @@ -2062,6 +2069,12 @@ fn test_module() {
let res = Configuration::new(
&registration,
&alpn,
#[cfg(feature = "preview-api")]
Settings::new()
.set_peer_bidi_stream_count(100)
.set_peer_unidi_stream_count(3)
.set_stream_multi_receive_enabled(true),
#[cfg(not(feature = "preview-api"))]
Settings::new()
.set_peer_bidi_stream_count(100)
.set_peer_unidi_stream_count(3),
Expand Down

0 comments on commit 38469af

Please sign in to comment.