Skip to content

Commit

Permalink
fix(transport): Fix infinite recursion in poll_ready (#192)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bmwill authored and LucioFranco committed Dec 15, 2019
1 parent 3a5c66d commit c99d13c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tonic/src/transport/service/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ where
Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'static>>;

fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
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 {
Expand Down

0 comments on commit c99d13c

Please sign in to comment.