1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-03 15:39:50 +00:00

fix alpn connector

This commit is contained in:
Nikolay Kim 2018-06-23 17:59:45 +06:00
parent 3d2226aa9e
commit 348491b18c
2 changed files with 7 additions and 6 deletions

View file

@ -837,9 +837,9 @@ impl fut::ActorFuture for Maintenance {
act.collect_waiters();
// check waiters
let mut waiters = act.waiters.take().unwrap();
let mut act_waiters = act.waiters.take().unwrap();
for (key, waiters) in &mut waiters {
for (key, ref mut waiters) in &mut act_waiters {
while let Some(waiter) = waiters.pop_front() {
if waiter.tx.is_canceled() {
continue;
@ -858,10 +858,11 @@ impl fut::ActorFuture for Maintenance {
break;
}
Acquire::Available => {
let key = key.clone();
let conn = AcquiredConn(key.clone(), Some(act.acq_tx.clone()));
fut::WrapFuture::<ClientConnector>::actfuture(
Resolver::from_registry().send(
act.resolver.as_ref().unwrap().send(
ResolveConnect::host_and_port(&conn.0.host, conn.0.port)
.timeout(waiter.conn_timeout),
),
@ -898,7 +899,7 @@ impl fut::ActorFuture for Maintenance {
}
Ok(())
})
.actfuture(),
.into_actor(act),
)
} else {
let _ = waiter.tx.send(Ok(Connection::new(
@ -986,7 +987,7 @@ impl fut::ActorFuture for Maintenance {
}
}
act.waiters = Some(waiters);
act.waiters = Some(act_waiters);
Ok(Async::NotReady)
}
}

View file

@ -841,7 +841,7 @@ mod tests {
Pipeline(info, PipelineState::Completed(state), Rc::new(Vec::new()));
assert!(!pp.is_done());
let Pipeline(mut info, st, mws) = pp;
let Pipeline(mut info, st, _) = pp;
let mut st = st.completed().unwrap();
drop(addr);