proxy: Fix ConditionallyUpgradeServerToTls not being notified (#1209)

#1203 introduced a bug in the implementation of `Future` for 
`connection::ConditionallyUpgradeServerToTls`. If the attempt to match
the current peek buffer was incomplete, the `Future` implementation
would return `Ok(Async::NotReady)`. This results in the task yielding.
However, in this case the task would not be notified again, as the 
`NotReady` state wasn't from an underlying IO resource. Instead, the
would _never_ be ready.

This branch fixes this issue by simply continuing the loop, so that 
we instead try to read more bytes from the socket and try to match
again, until the match is successful or the _socket_ returns `NotReady`.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
Eliza Weisman 2018-06-26 16:55:55 -07:00 committed by GitHub
parent e3d61c9a70
commit 5bba831f9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -231,7 +231,7 @@ impl Future for ConditionallyUpgradeServerToTls {
return Ok(Async::Ready(conn));
},
tls::conditional_accept::Match::Incomplete => {
return Ok(Async::NotReady);
continue;
},
}
},