From c99d13c6e669be3a6ecf428ae32d4b937393738a Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Sun, 15 Dec 2019 15:36:10 -0800 Subject: [PATCH] fix(transport): Fix infinite recursion in `poll_ready` (#192) b90c340 (feat(transport): Allow custom IO and UDS example (#184), 2019-12-13) changed the Connector type to be more generic instead of only allowing the HttpConnector type, during this change the `Service::poll_ready` impl was changed from calling `MakeConnection::poll_ready` on `self.http` to `self` resulting in infinite recursion due to the blanket imple of `MakeConnection::poll_ready` calling `Service::poll_ready`. This fixes the bug by calling `MakeConnection::poll_ready` on `self.inner` instead of `self`. Fixes #191 --- tonic/src/transport/service/connector.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tonic/src/transport/service/connector.rs b/tonic/src/transport/service/connector.rs index c7a9f3c37..6f1177dea 100644 --- a/tonic/src/transport/service/connector.rs +++ b/tonic/src/transport/service/connector.rs @@ -53,7 +53,7 @@ where Pin> + Send + 'static>>; fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { - MakeConnection::poll_ready(self, cx).map_err(Into::into) + MakeConnection::poll_ready(&mut self.inner, cx).map_err(Into::into) } fn call(&mut self, uri: Uri) -> Self::Future {