Set up body state for async reading.
(self)
| 119 | return bytes(buf) |
| 120 | |
| 121 | def _set_body_reader(self): |
| 122 | """Set up body state for async reading.""" |
| 123 | content_length = 0 |
| 124 | if 'CONTENT_LENGTH' in self.uwsgi_vars: |
| 125 | try: |
| 126 | content_length = max(int(self.uwsgi_vars['CONTENT_LENGTH']), 0) |
| 127 | except ValueError: |
| 128 | content_length = 0 |
| 129 | self.content_length = content_length |
| 130 | self._body_remaining = content_length |
| 131 | |
| 132 | async def read_body(self, size=8192): |
| 133 | """Read body chunk asynchronously. |