add debug message for h3 body size

This commit is contained in:
Jun Kurihara 2022-08-06 17:55:25 +09:00
commit 02ee7a25c6
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03

View file

@ -92,10 +92,10 @@ where
let mut sender = body_sender; let mut sender = body_sender;
let mut size = 0usize; let mut size = 0usize;
while let Some(mut body) = recv_stream.recv_data().await? { while let Some(mut body) = recv_stream.recv_data().await? {
debug!("HTTP/3 incoming request body"); debug!("HTTP/3 incoming request body: remaining {}", body.remaining());
size += body.remaining(); size += body.remaining();
if size > max_body_size { if size > max_body_size {
error!("Exceeds max request body size for HTTP/3"); error!("Exceeds max request body size for HTTP/3: received {}", size);
return Err(RpxyError::Proxy("Exceeds max request body size for HTTP/3".to_string())); return Err(RpxyError::Proxy("Exceeds max request body size for HTTP/3".to_string()));
} }
// create stream body to save memory, shallow copy (increment of ref-count) to Bytes using copy_to_bytes // create stream body to save memory, shallow copy (increment of ref-count) to Bytes using copy_to_bytes