Skip to content
Snippets Groups Projects
Commit 94b0d0f9 authored by Gregory Szorc's avatar Gregory Szorc
Browse files

wireprotov2peer: always return a bool from _processredirect()

Without this, we may stop servicing the redirect response if the
future has already been resolved. And the future will often be
resolved very early, since many consumers iterate the decoded
CBOR object stream and expect data to lazily arrive.
parent 25b7c4cb
No related branches found
No related tags found
No related merge requests found
......@@ -458,7 +458,10 @@
self._redirects.append((requestid, res))
def _processredirect(self, rid, res):
"""Called to continue processing a response from a redirect."""
"""Called to continue processing a response from a redirect.
Returns a bool indicating if the redirect is still serviceable.
"""
response = self._responses[rid]
try:
......@@ -470,7 +473,7 @@
response._oninputcomplete()
if rid not in self._futures:
return
return bool(data)
if response.command not in COMMAND_DECODERS:
self._futures[rid].set_result(response.objects())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment