1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-23 16:21:06 +01:00
This commit is contained in:
Nikolay Kim 2017-12-14 22:22:27 -08:00
parent d77156c16c
commit 4913e7d3c2
3 changed files with 7 additions and 7 deletions

View File

@ -76,7 +76,7 @@ Each result is best of five runs. All measurements are req/sec.
Name | 1 thread | 1 pipeline | 3 thread | 3 pipeline | 8 thread | 8 pipeline
---- | -------- | ---------- | -------- | ---------- | -------- | ----------
Actix | 81.400 | 710.200 | 121.000 | 1.684.000 | 106.300 | 2.206.000
Actix | 87.200 | 813.200 | 122.100 | 1.877.000 | 107.400 | 2.390.000
Gotham | 61.000 | 178.000 | | | |
Iron | | | | | 94.500 | 78.000
Rocket | | | | | 95.500 | failed

View File

@ -539,13 +539,12 @@ impl Reader {
}
// Parse http message
let mut headers_indices = [HeaderIndices {
name: (0, 0),
value: (0, 0)
}; MAX_HEADERS];
let mut headers_indices: [HeaderIndices; MAX_HEADERS] =
unsafe{std::mem::uninitialized()};
let (len, method, path, version, headers_len) = {
let mut headers = [httparse::EMPTY_HEADER; MAX_HEADERS];
let mut headers: [httparse::Header; MAX_HEADERS] =
unsafe{std::mem::uninitialized()};
let mut req = httparse::Request::new(&mut headers);
match try!(req.parse(buf)) {
httparse::Status::Complete(len) => {

View File

@ -131,7 +131,8 @@ impl Writer for H2Writer {
if !msg.headers().contains_key(DATE) {
let mut bytes = BytesMut::with_capacity(29);
helpers::date(&mut bytes);
msg.headers_mut().insert(DATE, HeaderValue::try_from(&bytes[..]).unwrap());
msg.headers_mut().insert(
DATE, HeaderValue::try_from(bytes.freeze()).unwrap());
}
let mut resp = Response::new(());