fix(client): check for drained stream in Response::drop

This commit is contained in:
Sean McArthur
2015-06-17 13:17:56 -07:00
parent 306f39c731
commit e689f20376
3 changed files with 33 additions and 34 deletions

View File

@@ -20,6 +20,7 @@ pub struct RawStatus(pub u16, pub Cow<'static, str>);
/// Checks if a connection should be kept alive.
#[inline]
pub fn should_keep_alive(version: HttpVersion, headers: &Headers) -> bool {
trace!("should_keep_alive( {:?}, {:?} )", version, headers.get::<Connection>());
match (version, headers.get::<Connection>()) {
(Http10, Some(conn)) if !conn.contains(&KeepAlive) => false,
(Http11, Some(conn)) if conn.contains(&Close) => false,