MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / readline

Method readline

tools/python-3.11.9-amd64/Lib/http/client.py:679–694  ·  view source on GitHub ↗
(self, limit=-1)

Source from the content-addressed store, hash-verified

677 return self.fp.peek(n)
678
679 def readline(self, limit=-1):
680 if self.fp is None or self._method == "HEAD":
681 return b""
682 if self.chunked:
683 # Fallback to IOBase readline which uses peek() and read()
684 return super().readline(limit)
685 if self.length is not None and (limit < 0 or limit > self.length):
686 limit = self.length
687 result = self.fp.readline(limit)
688 if not result and limit:
689 self._close_conn()
690 elif self.length is not None:
691 self.length -= len(result)
692 if not self.length:
693 self._close_conn()
694 return result
695
696 def _read1_chunked(self, n):
697 # Strictly speaking, _get_chunk_left() may cause more than one read,

Callers 8

_read_headersFunction · 0.45
_read_statusMethod · 0.45
_read_next_chunk_sizeMethod · 0.45
_tunnelMethod · 0.45
_really_loadMethod · 0.45
_really_loadMethod · 0.45
handle_one_requestMethod · 0.45

Calls 1

_close_connMethod · 0.95

Tested by

no test coverage detected