ignore the error
This commit is contained in:
@@ -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,
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user