1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-22 08:07:18 +00:00

do not add error response if current response is in process

This commit is contained in:
Nikolay Kim 2017-10-29 14:51:30 -07:00
parent a1b7d5995e
commit 6b2248ecdf
3 changed files with 10 additions and 9 deletions

View file

@ -60,7 +60,7 @@ pub use context::HttpContext;
pub use staticfiles::StaticFiles;
// re-exports
pub use http::{Method, StatusCode};
pub use http::{Method, StatusCode, Version};
pub use cookie::{Cookie, CookieBuilder};
pub use cookie::{ParseError as CookieParseError};
pub use http_range::{HttpRange, HttpRangeParseError};

View file

@ -324,6 +324,7 @@ impl<T, A, H> Future for HttpChannel<T, A, H>
// tasks need to be completed
self.error = true;
if self.items.is_empty() {
if let ReaderError::Error(err) = err {
self.items.push_back(
Entry {task: Task::reply(err),
@ -333,6 +334,7 @@ impl<T, A, H> Future for HttpChannel<T, A, H>
finished: false});
}
}
}
Ok(Async::NotReady) => {
// start keep-alive timer, this is also slow request timeout
if self.items.is_empty() && self.inactive.is_empty() {

View file

@ -412,7 +412,6 @@ impl Task {
fut.borrow_mut().set()
}
self.drain.clear();
// return self.poll_io(io, req);
}
// response is completed