mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_http: microoptimize EstablishedConnection
This commit is contained in:
parent
fb6caf7343
commit
7bc47ab93f
1 changed files with 1 additions and 2 deletions
|
|
@ -95,8 +95,7 @@ impl EstablishedConnection {
|
|||
pub fn send_response(&mut self, body: &[u8]) -> ::std::io::Result<()> {
|
||||
let mut response = Vec::new();
|
||||
|
||||
response.extend_from_slice(b"HTTP/1.1 200 OK\r\n");
|
||||
response.extend_from_slice(b"Content-Length: ");
|
||||
response.extend_from_slice(b"HTTP/1.1 200 OK\r\nContent-Length: ");
|
||||
response.extend_from_slice(format!("{}", body.len() + 2).as_bytes());
|
||||
response.extend_from_slice(b"\r\n\r\n");
|
||||
response.extend_from_slice(body);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue