Skip to content
Snippets Groups Projects
Commit 49f8ba4febec authored by Cédric Krier's avatar Cédric Krier
Browse files

keepalive: Do not append _rbuf if _raw_readinto exists (issue6356)

The readline method append to the chunks the content of the _rbuf then there
is a loop that call _raw_read which on Python3 call readinto. But the readinto
version in mercurial append again the _rbuf content. So this creates the
duplicate content. This does not happen in Python2 because _raw_read does not
call readinto.

Differential Revision: https://phab.mercurial-scm.org/D8859
parent 3d414dce2d40
No related branches found
No related tags found
No related merge requests found
...@@ -542,4 +542,6 @@ ...@@ -542,4 +542,6 @@
return line return line
# No newline in local buffer. Read until we find one. # No newline in local buffer. Read until we find one.
# readinto read via readinto will already return _rbuf
if self._raw_readinto is None:
chunks = [self._rbuf] chunks = [self._rbuf]
...@@ -545,4 +547,6 @@ ...@@ -545,4 +547,6 @@
chunks = [self._rbuf] chunks = [self._rbuf]
else:
chunks = []
i = -1 i = -1
readsize = self._rbufsize readsize = self._rbufsize
while True: while True:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment