mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
http: don't send response if body is too long for buffer
This commit is contained in:
parent
0ee2e2d2ae
commit
abf3e7015e
1 changed files with 6 additions and 0 deletions
|
|
@ -429,6 +429,12 @@ impl Connection {
|
|||
|
||||
position += body_len;
|
||||
|
||||
if position + 2 > self.response_buffer.len() {
|
||||
::log::error!("Response buffer is too short for response");
|
||||
|
||||
return Err(anyhow::anyhow!("Response buffer is too short for response"));
|
||||
}
|
||||
|
||||
(&mut self.response_buffer[position..position + 2]).copy_from_slice(b"\r\n");
|
||||
|
||||
position += 2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue