close protocol if transport reuse brings responses before requests
This commit is contained in:
parent
ac69fcbc5f
commit
ff2985cc80
1 changed files with 3 additions and 0 deletions
|
@ -35,6 +35,9 @@ class BlobExchangeClientProtocol(asyncio.Protocol):
|
|||
if self._response_fut and not self._response_fut.done():
|
||||
self._response_fut.cancel()
|
||||
return
|
||||
if not self._response_fut:
|
||||
log.warning("Protocol received data before expected, probable race on keep alive. Closing transport.")
|
||||
return self.close()
|
||||
if self._blob_bytes_received and not self.writer.closed():
|
||||
return self._write(data)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue