From e88bf6cb4403245821e89bc628c19dfa4969ad95 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Sun, 5 Jun 2022 10:12:18 +0100 Subject: [PATCH] Convert size limit hits into permanent failures --- quickpeep_raker/src/raking.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quickpeep_raker/src/raking.rs b/quickpeep_raker/src/raking.rs index fa9c66b..b51dea6 100644 --- a/quickpeep_raker/src/raking.rs +++ b/quickpeep_raker/src/raking.rs @@ -227,7 +227,9 @@ async fn response_to_bytes_limited( buffer.extend_from_slice(next_chunk?.as_bytes()); if buffer.len() > size_limit { increment_counter!("qprake_rake_specific_fail_count", "reason" => "SizeLimit"); - bail!("Exceeds size limit"); + return Err(PermanentFailure { + reason: PermanentFailureReason::ExceedsSizeLimit, + }.into()); } }, None => {