Skip to content

Commit

Permalink
Add preview API feature with additional settings and methods
Browse files Browse the repository at this point in the history
  • Loading branch information
masa-koz committed Jan 1, 2025
1 parent b6ebb83 commit b5b7ddd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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
15 changes: 14 additions & 1 deletion 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 @@ -1350,6 +1351,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 @@ -1958,9 +1965,15 @@ 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),
.set_peer_unidi_stream_count(3)
);
assert!(
res.is_ok(),
Expand Down

0 comments on commit b5b7ddd

Please sign in to comment.