Convert size limit hits into permanent failures

This commit is contained in:
Olivier 'reivilibre' 2022-06-05 10:12:18 +01:00
parent e66ac80484
commit e88bf6cb44

View File

@ -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 => {