ignore the error

This commit is contained in:
2025-09-05 01:27:11 +09:00
parent 28f9b75e8f
commit 6c32237244
2 changed files with 6 additions and 1 deletions

View File

@@ -10,8 +10,10 @@ pub struct AtomicHttpCounter {
#[derive(Default)] #[derive(Default)]
pub struct HttpCounter { pub struct HttpCounter {
pub sent: usize,
pub http_2xx: usize, pub http_2xx: usize,
pub http_3xx: usize, pub http_3xx: usize,
pub http_4xx: usize, pub http_4xx: usize,
pub http_5xx: usize, pub http_5xx: usize,
pub error: usize,
} }

View File

@@ -27,6 +27,7 @@ pub struct IntegratedHttpSward {
impl IntegratedHttpSward { impl IntegratedHttpSward {
pub async fn oneshot(&mut self) -> Result<reqwest::Response, HttpSwardError> { pub async fn oneshot(&mut self) -> Result<reqwest::Response, HttpSwardError> {
self.result_counter.sent += 1;
let url = match &mut self.attack_target { let url = match &mut self.attack_target {
AttackTarget::Random(random) => random.generate_url()?, AttackTarget::Random(random) => random.generate_url()?,
AttackTarget::Fixed(url) => url.clone(), AttackTarget::Fixed(url) => url.clone(),
@@ -71,7 +72,9 @@ impl IntegratedHttpSward {
return Ok(()); return Ok(());
} }
oneshop_result = self.oneshot() => { oneshop_result = self.oneshot() => {
oneshop_result?; if oneshop_result.is_err() {
self.result_counter.error += 1;
}
} }
} }
} }