##// END OF EJS Templates
ssh: fix flakey ssh errors on BSD systems...
Durham Goode -
r34194:1908dc95 stable
parent child Browse files
Show More
@@ -190,12 +190,21 b' class sshpeer(wireproto.wirepeer):'
190 self.pipei = doublepipe(self.ui, self.pipei, self.pipee)
190 self.pipei = doublepipe(self.ui, self.pipei, self.pipee)
191 self.pipeo = doublepipe(self.ui, self.pipeo, self.pipee)
191 self.pipeo = doublepipe(self.ui, self.pipeo, self.pipee)
192
192
193 def badresponse():
194 self._abort(error.RepoError(_('no suitable response from '
195 'remote hg')))
196
197 try:
193 # skip any noise generated by remote shell
198 # skip any noise generated by remote shell
194 self._callstream("hello")
199 self._callstream("hello")
195 r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
200 r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
201 except IOError:
202 badresponse()
203
196 lines = ["", "dummy"]
204 lines = ["", "dummy"]
197 max_noise = 500
205 max_noise = 500
198 while lines[-1] and max_noise:
206 while lines[-1] and max_noise:
207 try:
199 l = r.readline()
208 l = r.readline()
200 self.readerr()
209 self.readerr()
201 if lines[-1] == "1\n" and l == "\n":
210 if lines[-1] == "1\n" and l == "\n":
@@ -204,9 +213,10 b' class sshpeer(wireproto.wirepeer):'
204 self.ui.debug("remote: ", l)
213 self.ui.debug("remote: ", l)
205 lines.append(l)
214 lines.append(l)
206 max_noise -= 1
215 max_noise -= 1
216 except IOError:
217 badresponse()
207 else:
218 else:
208 self._abort(error.RepoError(_('no suitable response from '
219 badresponse()
209 'remote hg')))
210
220
211 self._caps = set()
221 self._caps = set()
212 for l in reversed(lines):
222 for l in reversed(lines):
General Comments 0
You need to be logged in to leave comments. Login now