equal
deleted
inserted
replaced
20 wireprotov1peer, |
20 wireprotov1peer, |
21 wireprotov1server, |
21 wireprotov1server, |
22 ) |
22 ) |
23 from .utils import ( |
23 from .utils import ( |
24 procutil, |
24 procutil, |
|
25 stringutil, |
25 ) |
26 ) |
26 |
27 |
27 def _serverquote(s): |
28 def _serverquote(s): |
28 """quote a string for the remote shell ... which we assume is sh""" |
29 """quote a string for the remote shell ... which we assume is sh""" |
29 if not s: |
30 if not s: |
271 except IOError: |
272 except IOError: |
272 badresponse() |
273 badresponse() |
273 |
274 |
274 # Assume version 1 of wire protocol by default. |
275 # Assume version 1 of wire protocol by default. |
275 protoname = wireprototypes.SSHV1 |
276 protoname = wireprototypes.SSHV1 |
276 reupgraded = re.compile(b'^upgraded %s (.*)$' % re.escape(token)) |
277 reupgraded = re.compile(b'^upgraded %s (.*)$' % stringutil.reescape(token)) |
277 |
278 |
278 lines = ['', 'dummy'] |
279 lines = ['', 'dummy'] |
279 max_noise = 500 |
280 max_noise = 500 |
280 while lines[-1] and max_noise: |
281 while lines[-1] and max_noise: |
281 try: |
282 try: |