MCPcopy
hub / github.com/pallets/werkzeug / exhaust

Method exhaust

src/werkzeug/wsgi.py:519–532  ·  view source on GitHub ↗

Exhaust the stream by reading until the limit is reached or the client disconnects, returning the remaining data. .. versionchanged:: 2.3 Return the remaining data. .. versionchanged:: 2.2.3 Handle case where wrapped stream returns fewer bytes than r

(self)

Source from the content-addressed store, hash-verified

517 # client disconnecting early.
518
519 def exhaust(self) -> bytes:
520 """Exhaust the stream by reading until the limit is reached or the client
521 disconnects, returning the remaining data.
522
523 .. versionchanged:: 2.3
524 Return the remaining data.
525
526 .. versionchanged:: 2.2.3
527 Handle case where wrapped stream returns fewer bytes than requested.
528 """
529 if not self.is_exhausted:
530 return self.readall()
531
532 return b""
533
534 def readinto(self, b: bytearray) -> int | None: # type: ignore[override]
535 size = len(b)

Callers

nothing calls this directly

Calls 1

readallMethod · 0.95

Tested by

no test coverage detected