mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-28 01:32:57 +01:00
fix client connection pooling
This commit is contained in:
parent
7bcc258b09
commit
2d75ced4ed
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user