MCPcopy
hub / github.com/aio-libs/aiohttp / parse_length_payload

Method parse_length_payload

aiohttp/protocol.py:352–358  ·  view source on GitHub ↗

Read specified amount of bytes.

(self, out, buf, length=0)

Source from the content-addressed store, hash-verified

350 yield from buf.skipuntil(b'\r\n')
351
352 def parse_length_payload(self, out, buf, length=0):
353 """Read specified amount of bytes."""
354 required = length
355 while required:
356 chunk = yield from buf.readsome(required)
357 out.feed_data(chunk, len(chunk))
358 required -= len(chunk)
359
360 def parse_eof_payload(self, out, buf):
361 """Read all bytes until eof."""

Callers 3

__call__Method · 0.95

Calls 2

readsomeMethod · 0.80
feed_dataMethod · 0.45

Tested by 2