1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-30 18:34:36 +01:00

fix client connection pooling

This commit is contained in:
Nikolay Kim 2018-03-21 11:51:08 -07:00
parent 7bcc258b09
commit 2d75ced4ed
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -232,7 +232,8 @@ impl Handler<Connect> 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);
}
}
}