changeset 25407:e461230cc95b

sshpeer: use a 'bufferedinputpipe' for standard output of the ssh process We need this pipe to still be buffered when will switch to unbuffered pipe. (switch motivated by the need of using polling to restore real time output from ssh server). This is the only pipe that needs to be wrapped because this is the one who do extensive usage of 'readline'. The stderr pipe of the process is alway read in non blocking raw chunk, so it won't benefit from the buffering.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sun, 31 May 2015 00:00:36 -0700
parents be930f16a52a
children c88975a4d264
files mercurial/sshpeer.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/sshpeer.py	Sat May 30 23:55:24 2015 -0700
+++ b/mercurial/sshpeer.py	Sun May 31 00:00:36 2015 -0700
@@ -89,6 +89,8 @@
         # to clean up correctly later
         self.pipeo, self.pipei, self.pipee, self.subprocess = util.popen4(cmd)
 
+        self.pipei = util.bufferedinputpipe(self.pipei)
+
         # skip any noise generated by remote shell
         self._callstream("hello")
         r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))