MCPcopy
hub / github.com/benoitc/gunicorn / drain_body

Method drain_body

gunicorn/asgi/uwsgi.py:149–157  ·  view source on GitHub ↗

Drain unread body data. Should be called before reusing connection for keepalive.

(self)

Source from the content-addressed store, hash-verified

147 return data
148
149 async def drain_body(self):
150 """Drain unread body data.
151
152 Should be called before reusing connection for keepalive.
153 """
154 while self._body_remaining > 0:
155 data = await self.read_body(8192)
156 if not data:
157 break
158
159 def get_header(self, name):
160 """Get header by name (case-insensitive).

Callers 2

test_drain_bodyFunction · 0.80

Calls 1

read_bodyMethod · 0.95

Tested by 1

test_drain_bodyFunction · 0.64