mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
http load test: add keep_alive setting
This commit is contained in:
parent
da6180e871
commit
7215d26ff4
2 changed files with 6 additions and 0 deletions
|
|
@ -22,6 +22,7 @@ pub struct Config {
|
|||
/// Announce/scrape url suffix. Use `/my_token/` to get `/announce/my_token/`
|
||||
pub url_suffix: String,
|
||||
pub duration: usize,
|
||||
pub keep_alive: bool,
|
||||
pub torrents: TorrentConfig,
|
||||
pub cpu_pinning: CpuPinningConfigDesc,
|
||||
}
|
||||
|
|
@ -60,6 +61,7 @@ impl Default for Config {
|
|||
connection_creation_interval_ms: 10,
|
||||
url_suffix: "".into(),
|
||||
duration: 0,
|
||||
keep_alive: true,
|
||||
torrents: TorrentConfig::default(),
|
||||
cpu_pinning: Default::default(),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,6 +138,10 @@ impl Connection {
|
|||
loop {
|
||||
self.send_request().await?;
|
||||
self.read_response().await?;
|
||||
|
||||
if !self.config.keep_alive {
|
||||
break Ok(());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue