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