add comment

This commit is contained in:
Jun Kurihara 2023-12-09 10:17:31 +09:00
commit d473b44556
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
2 changed files with 6 additions and 1 deletions

View file

@ -74,10 +74,15 @@ where
return res.map(wrap_incoming_body_response::<BoxBody>);
};
let (parts, body) = res.unwrap().into_parts();
let Ok(bytes) = body.collect().await.map(|v| v.to_bytes()) else {
return Err(RpxyError::FailedToWriteByteBufferForCache);
};
// TODO: this is inefficient. needs to be reconsidered to avoid unnecessary copy and should spawn async task to store cache.
// We may need to use the same logic as h3.
// Is bytes.clone() enough?
// if let Err(cache_err) = self
// .cache
// .as_ref()

View file

@ -122,7 +122,7 @@ where
size += body.remaining();
if size > max_body_size {
error!(
"Exceeds max request body size for HTTP/3: received {}, maximum_allowd {}",
"Exceeds max request body size for HTTP/3: received {}, maximum_allowed {}",
size, max_body_size
);
return Err(RpxyError::H3TooLargeBody);