Skip to content

Commit c99d13c

Browse files
bmwillLucioFranco
authored andcommitted
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
1 parent 3a5c66d commit c99d13c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tonic/src/transport/service/connector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ where
5353
Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'static>>;
5454

5555
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
56-
MakeConnection::poll_ready(self, cx).map_err(Into::into)
56+
MakeConnection::poll_ready(&mut self.inner, cx).map_err(Into::into)
5757
}
5858

5959
fn call(&mut self, uri: Uri) -> Self::Future {

0 commit comments

Comments
 (0)