1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02: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

@ -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);
}
}
}