mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-27 17:22:57 +01:00
Fix BorrowMutError panic in client connector #793
This commit is contained in:
parent
3532602299
commit
5d531989e7
@ -1,5 +1,12 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.1.2] - 2019-04-23
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Fix BorrowMutError panic in client connector #793
|
||||||
|
|
||||||
|
|
||||||
## [0.1.1] - 2019-04-19
|
## [0.1.1] - 2019-04-19
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
@ -113,31 +113,31 @@ where
|
|||||||
match self.1.as_ref().borrow_mut().acquire(&key) {
|
match self.1.as_ref().borrow_mut().acquire(&key) {
|
||||||
Acquire::Acquired(io, created) => {
|
Acquire::Acquired(io, created) => {
|
||||||
// use existing connection
|
// use existing connection
|
||||||
Either::A(ok(IoConnection::new(
|
return Either::A(ok(IoConnection::new(
|
||||||
io,
|
io,
|
||||||
created,
|
created,
|
||||||
Some(Acquired(key, Some(self.1.clone()))),
|
Some(Acquired(key, Some(self.1.clone()))),
|
||||||
)))
|
)));
|
||||||
}
|
|
||||||
Acquire::NotAvailable => {
|
|
||||||
// connection is not available, wait
|
|
||||||
let (rx, token) = self.1.as_ref().borrow_mut().wait_for(req);
|
|
||||||
Either::B(Either::A(WaitForConnection {
|
|
||||||
rx,
|
|
||||||
key,
|
|
||||||
token,
|
|
||||||
inner: Some(self.1.clone()),
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
Acquire::Available => {
|
Acquire::Available => {
|
||||||
// open new connection
|
// open new connection
|
||||||
Either::B(Either::B(OpenConnection::new(
|
return Either::B(Either::B(OpenConnection::new(
|
||||||
key,
|
key,
|
||||||
self.1.clone(),
|
self.1.clone(),
|
||||||
self.0.call(req),
|
self.0.call(req),
|
||||||
)))
|
)));
|
||||||
}
|
}
|
||||||
|
_ => (),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// connection is not available, wait
|
||||||
|
let (rx, token) = self.1.as_ref().borrow_mut().wait_for(req);
|
||||||
|
Either::B(Either::A(WaitForConnection {
|
||||||
|
rx,
|
||||||
|
key,
|
||||||
|
token,
|
||||||
|
inner: Some(self.1.clone()),
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user