Mark parsing complete for EOF handling. Call when no more data will be received. Handles edge cases like chunked encoding without final trailer CRLF.
(self)
| 247 | self._header_count = 0 |
| 248 | |
| 249 | def finish(self): |
| 250 | """Mark parsing complete for EOF handling. |
| 251 | |
| 252 | Call when no more data will be received. Handles edge cases like |
| 253 | chunked encoding without final trailer CRLF. |
| 254 | """ |
| 255 | if self._state == 'chunked' and self._chunk_state == 'trailer': |
| 256 | # All body data received, just missing final CRLF |
| 257 | self._state = 'complete' |
| 258 | self.is_complete = True |
| 259 | if self._on_message_complete: |
| 260 | self._on_message_complete() |
| 261 | |
| 262 | def _parse_proxy_protocol(self): |
| 263 | """Parse PROXY protocol header if enabled. |
no test coverage detected