FrameProcessor: cancel input/push tasks on CancelFrame

This commit is contained in:
Aleix Conchillo Flaqué
2025-02-24 21:35:43 -08:00
parent 699704732c
commit 4536d03e82

View File

@@ -240,7 +240,7 @@ class FrameProcessor:
elif isinstance(frame, StopInterruptionFrame):
self._should_report_ttfb = True
elif isinstance(frame, CancelFrame):
self._cancelling = True
await self.__cancel(frame)
async def push_error(self, error: ErrorFrame):
await self.push_frame(error, FrameDirection.UPSTREAM)
@@ -275,6 +275,11 @@ class FrameProcessor:
self.__create_input_task()
self.__create_push_task()
async def __cancel(self, frame: CancelFrame):
self._cancelling = True
await self.__cancel_input_task()
await self.__cancel_push_task()
#
# Handle interruptions
#