Write data in chunked transfer encoding.
(self)
| 737 | return self.transport.drain() |
| 738 | |
| 739 | def _write_chunked_payload(self): |
| 740 | """Write data in chunked transfer encoding.""" |
| 741 | while True: |
| 742 | try: |
| 743 | chunk = yield |
| 744 | except aiohttp.EofStream: |
| 745 | self.transport.write(b'0\r\n\r\n') |
| 746 | self.output_length += 5 |
| 747 | break |
| 748 | |
| 749 | chunk = bytes(chunk) |
| 750 | chunk_len = '{:x}\r\n'.format(len(chunk)).encode('ascii') |
| 751 | self.transport.write(chunk_len + chunk + b'\r\n') |
| 752 | self.output_length += len(chunk_len) + len(chunk) + 2 |
| 753 | |
| 754 | def _write_length_payload(self, length): |
| 755 | """Write specified number of bytes to a stream.""" |
no test coverage detected