From 3f649b8e07ff8a67d25415a6f41899c0170f8c7b Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sat, 4 Nov 2017 14:07:15 -0700 Subject: [PATCH] fix name --- src/h1.rs | 2 +- src/task.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/h1.rs b/src/h1.rs index f2189e00..5d478f01 100644 --- a/src/h1.rs +++ b/src/h1.rs @@ -252,7 +252,7 @@ impl Http1 // check for parse error if self.tasks.is_empty() { if self.h2 { - return Ok(Async::Ready(Http1Result::Upgrade)) + return Ok(Async::Ready(Http1Result::Switch)) } if self.error || self.keepalive_timer.is_none() { return Ok(Async::Ready(Http1Result::Done)) diff --git a/src/task.rs b/src/task.rs index 0a8a4606..74c2c415 100644 --- a/src/task.rs +++ b/src/task.rs @@ -190,12 +190,13 @@ impl Task { } } - // use exiting frames + // if task is paused, write buffer probably is full if self.state != TaskRunningState::Paused { + // process exiting frames while let Some(frame) = self.frames.pop_front() { trace!("IO Frame: {:?}", frame); let res = match frame { - Frame::Message(mut response) => { + Frame::Message(response) => { trace!("Prepare message status={:?}", response.status); // run middlewares