##// END OF EJS Templates
ssh: fix flakey ssh errors on BSD systems...
Durham Goode -
r34107:c037fd65 default
parent child Browse files
Show More
@@ -203,23 +203,33 b' class sshpeer(wireproto.wirepeer):'
203 203 self._pipei = doublepipe(self.ui, self._pipei, self._pipee)
204 204 self._pipeo = doublepipe(self.ui, self._pipeo, self._pipee)
205 205
206 # skip any noise generated by remote shell
207 self._callstream("hello")
208 r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
206 def badresponse():
207 self._abort(error.RepoError(_('no suitable response from '
208 'remote hg')))
209
210 try:
211 # skip any noise generated by remote shell
212 self._callstream("hello")
213 r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
214 except IOError:
215 badresponse()
216
209 217 lines = ["", "dummy"]
210 218 max_noise = 500
211 219 while lines[-1] and max_noise:
212 l = r.readline()
213 self._readerr()
214 if lines[-1] == "1\n" and l == "\n":
215 break
216 if l:
217 self.ui.debug("remote: ", l)
218 lines.append(l)
219 max_noise -= 1
220 try:
221 l = r.readline()
222 self._readerr()
223 if lines[-1] == "1\n" and l == "\n":
224 break
225 if l:
226 self.ui.debug("remote: ", l)
227 lines.append(l)
228 max_noise -= 1
229 except IOError:
230 badresponse()
220 231 else:
221 self._abort(error.RepoError(_('no suitable response from '
222 'remote hg')))
232 badresponse()
223 233
224 234 self._caps = set()
225 235 for l in reversed(lines):
General Comments 0
You need to be logged in to leave comments. Login now