mirror of
https://github.com/actix/actix-web.git
synced 2025-01-03 13:58:44 +00:00
fix client connection pooling
This commit is contained in:
parent
7bcc258b09
commit
2d75ced4ed
2 changed files with 9 additions and 1 deletions
|
@ -1,5 +1,10 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## 0.4.11
|
||||||
|
|
||||||
|
* Fix client connection pooling
|
||||||
|
|
||||||
|
|
||||||
## 0.4.10 (2018-03-20)
|
## 0.4.10 (2018-03-20)
|
||||||
|
|
||||||
* Use `Error` instead of `InternalError` for `error::ErrorXXXX` methods
|
* 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 key = Key {host, port, ssl: proto.is_secure()};
|
||||||
|
|
||||||
let pool = if proto.is_http() {
|
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))
|
return ActorResponse::async(fut::ok(conn))
|
||||||
} else {
|
} else {
|
||||||
Some(Rc::clone(&self.pool))
|
Some(Rc::clone(&self.pool))
|
||||||
|
@ -452,6 +453,8 @@ impl Pool {
|
||||||
self.to_close.borrow_mut().push(conn.1);
|
self.to_close.borrow_mut().push(conn.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
self.to_close.borrow_mut().push(conn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue