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