-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(s2n-quic-qns): add ability to set congestion controller in inter…
…op/perf
- Loading branch information
1 parent
c7e3f51
commit 529cd9b
Showing
9 changed files
with
203 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
use core::str::FromStr; | ||
use std::io; | ||
use structopt::StructOpt; | ||
|
||
#[derive(Debug, StructOpt)] | ||
pub struct CongestionControl { | ||
/// The congestion controller to use | ||
#[structopt(long = "cc", default_value = "bbr", possible_values = &["cubic","bbr"])] | ||
pub congestion_controller: CongestionController, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug)] | ||
pub enum CongestionController { | ||
Cubic, | ||
Bbr, | ||
} | ||
|
||
impl FromStr for CongestionController { | ||
type Err = crate::Error; | ||
fn from_str(s: &str) -> Result<Self, Self::Err> { | ||
match s { | ||
"cubic" => Ok(Self::Cubic), | ||
"bbr" => Ok(Self::Bbr), | ||
_ => { | ||
Err(io::Error::new( | ||
io::ErrorKind::InvalidInput, | ||
format!("Unsupported congestion controller: {s}"), | ||
) | ||
.into()) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.