MCPcopy
hub / github.com/tornadoweb/tornado / data_received

Method data_received

tornado/http1connection.py:736–758  ·  view source on GitHub ↗
(self, chunk: bytes)

Source from the content-addressed store, hash-verified

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:

Callers 3

_read_fixed_bodyMethod · 0.45
_read_chunked_bodyMethod · 0.45

Calls 1

decompressMethod · 0.45

Tested by

no test coverage detected