feat: add buffer_limit functions (#1922)

Co-authored-by: 纪卓志 <jizhuozhi.george@gmail.com>
Co-authored-by: 007gzs <007gzs@gmail.com>
This commit is contained in:
DefNed
2025-03-20 18:07:13 +08:00
committed by GitHub
parent e549c79ae4
commit dee4786c1c
6 changed files with 906 additions and 0 deletions

View File

@@ -143,6 +143,24 @@ where
self.set_http_response_body(0, i32::MAX as usize, body)
}
fn set_request_body_buffer_limit(&self, limit: u32) {
self.log()
.infof(format_args!("SetRequestBodyBufferLimit:{}", limit));
self.set_property(
vec!["set_decoder_buffer_limit"],
Some(limit.to_string().as_bytes()),
);
}
fn set_response_body_buffer_limit(&self, limit: u32) {
self.log()
.infof(format_args!("SetResponseBodyBufferLimit:{}", limit));
self.set_property(
vec!["set_encoder_buffer_limit"],
Some(limit.to_string().as_bytes()),
);
}
#[allow(clippy::too_many_arguments)]
fn http_call(
&mut self,