(self, chunk: bytes)
| 734 | return self._delegate.headers_received(start_line, headers) |
| 735 | |
| 736 | async def data_received(self, chunk: bytes) -> None: |
| 737 | if self._decompressor: |
| 738 | compressed_data = chunk |
| 739 | while compressed_data: |
| 740 | decompressed = self._decompressor.decompress( |
| 741 | compressed_data, self._chunk_size |
| 742 | ) |
| 743 | if decompressed: |
| 744 | self._decompressed_body_size += len(decompressed) |
| 745 | if self._decompressed_body_size > self._max_body_size: |
| 746 | raise httputil.HTTPInputError("decompressed body too large") |
| 747 | ret = self._delegate.data_received(decompressed) |
| 748 | if ret is not None: |
| 749 | await ret |
| 750 | compressed_data = self._decompressor.unconsumed_tail |
| 751 | if compressed_data and not decompressed: |
| 752 | raise httputil.HTTPInputError( |
| 753 | "encountered unconsumed gzip data without making progress" |
| 754 | ) |
| 755 | else: |
| 756 | ret = self._delegate.data_received(chunk) |
| 757 | if ret is not None: |
| 758 | await ret |
| 759 | |
| 760 | def finish(self) -> None: |
| 761 | if self._decompressor is not None: |
no test coverage detected