From 5bba831f9bf1f4f90f7410b6c9bf201c7cb886e4 Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Tue, 26 Jun 2018 16:55:55 -0700 Subject: [PATCH] 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 --- proxy/src/connection.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/src/connection.rs b/proxy/src/connection.rs index 05ff2a22e..817979b8c 100644 --- a/proxy/src/connection.rs +++ b/proxy/src/connection.rs @@ -231,7 +231,7 @@ impl Future for ConditionallyUpgradeServerToTls { return Ok(Async::Ready(conn)); }, tls::conditional_accept::Match::Incomplete => { - return Ok(Async::NotReady); + continue; }, } },