transports: push EndFrame/CancelFrame before stopping push task

This commit is contained in:
Aleix Conchillo Flaqué
2024-06-04 15:11:04 -07:00
parent c8d37a7227
commit 891b7b22ea
3 changed files with 7 additions and 4 deletions

View File

@@ -121,11 +121,11 @@ class BaseOutputTransport(FrameProcessor):
self._sink_queue.put_nowait(frame)
# EndFrame is managed in the queue handler.
elif isinstance(frame, CancelFrame):
await self.push_frame(frame, direction)
await self.stop()
await self.push_frame(frame, direction)
elif isinstance(frame, StartInterruptionFrame) or isinstance(frame, StopInterruptionFrame):
await self._handle_interruptions(frame)
await self.push_frame(frame, direction)
await self._handle_interruptions(frame)
else:
self._sink_queue.put_nowait(frame)