Read and discard any remaining HTTP response data in the response connection. Unread data in the HTTPResponse connection blocks the connection from being released back to the pool.
(self)
| 792 | self._connection = None |
| 793 | |
| 794 | def drain_conn(self) -> None: |
| 795 | """ |
| 796 | Read and discard any remaining HTTP response data in the response connection. |
| 797 | |
| 798 | Unread data in the HTTPResponse connection blocks the connection from being released back to the pool. |
| 799 | """ |
| 800 | try: |
| 801 | self._raw_read() |
| 802 | except (HTTPError, OSError, BaseSSLError, HTTPException): |
| 803 | pass |
| 804 | if self._has_decoded_content: |
| 805 | # `_raw_read` skips decompression, so we should clean up the |
| 806 | # decoder to avoid keeping unnecessary data in memory. |
| 807 | self._decoded_buffer = BytesQueueBuffer() |
| 808 | self._decoder = None |
| 809 | |
| 810 | @property |
| 811 | def data(self) -> bytes: |