test(http): addn a benchmark for encoding a response head

This commit is contained in:
Sean McArthur
2017-05-25 11:41:56 -07:00
parent 2cbf4ef85f
commit 78a8eed7f1
3 changed files with 28 additions and 5 deletions

View File

@@ -236,7 +236,7 @@ where I: AsyncRead + AsyncWrite,
let wants_keep_alive = head.should_keep_alive();
self.state.keep_alive &= wants_keep_alive;
let mut buf = Vec::new();
let encoder = T::encode(&mut head, &mut buf);
let encoder = T::encode(head, &mut buf);
//TODO: handle when there isn't enough room to buffer the head
assert!(self.io.buffer(buf) > 0);
self.state.writing = if body {