diff --git a/CHANGES.md b/CHANGES.md index 67798f4d1..3049061cc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ # Changes +## 0.4.11 + +* Fix client connection pooling + + ## 0.4.10 (2018-03-20) * Use `Error` instead of `InternalError` for `error::ErrorXXXX` methods diff --git a/src/client/connector.rs b/src/client/connector.rs index 5a4572369..8f2828935 100644 --- a/src/client/connector.rs +++ b/src/client/connector.rs @@ -232,7 +232,8 @@ impl Handler for ClientConnector { let key = Key {host, port, ssl: proto.is_secure()}; let pool = if proto.is_http() { - if let Some(conn) = self.pool.query(&key) { + if let Some(mut conn) = self.pool.query(&key) { + conn.pool = Some(self.pool.clone()); return ActorResponse::async(fut::ok(conn)) } else { Some(Rc::clone(&self.pool)) @@ -452,6 +453,8 @@ impl Pool { self.to_close.borrow_mut().push(conn.1); } } + } else { + self.to_close.borrow_mut().push(conn); } } }