Show More
@@ -452,19 +452,19 b' class sshv1peer(wireproto.wirepeer):' | |||||
452 |
|
452 | |||
453 | def _call(self, cmd, **args): |
|
453 | def _call(self, cmd, **args): | |
454 | self._callstream(cmd, **args) |
|
454 | self._callstream(cmd, **args) | |
455 |
return self._re |
|
455 | return self._readframed() | |
456 |
|
456 | |||
457 | def _callpush(self, cmd, fp, **args): |
|
457 | def _callpush(self, cmd, fp, **args): | |
458 | r = self._call(cmd, **args) |
|
458 | r = self._call(cmd, **args) | |
459 | if r: |
|
459 | if r: | |
460 | return '', r |
|
460 | return '', r | |
461 | for d in iter(lambda: fp.read(4096), ''): |
|
461 | for d in iter(lambda: fp.read(4096), ''): | |
462 |
self._ |
|
462 | self._writeframed(d) | |
463 |
self._ |
|
463 | self._writeframed("", flush=True) | |
464 |
r = self._re |
|
464 | r = self._readframed() | |
465 | if r: |
|
465 | if r: | |
466 | return '', r |
|
466 | return '', r | |
467 |
return self._re |
|
467 | return self._readframed(), '' | |
468 |
|
468 | |||
469 | def _calltwowaystream(self, cmd, fp, **args): |
|
469 | def _calltwowaystream(self, cmd, fp, **args): | |
470 | r = self._call(cmd, **args) |
|
470 | r = self._call(cmd, **args) | |
@@ -472,8 +472,8 b' class sshv1peer(wireproto.wirepeer):' | |||||
472 | # XXX needs to be made better |
|
472 | # XXX needs to be made better | |
473 | raise error.Abort(_('unexpected remote reply: %s') % r) |
|
473 | raise error.Abort(_('unexpected remote reply: %s') % r) | |
474 | for d in iter(lambda: fp.read(4096), ''): |
|
474 | for d in iter(lambda: fp.read(4096), ''): | |
475 |
self._ |
|
475 | self._writeframed(d) | |
476 |
self._ |
|
476 | self._writeframed("", flush=True) | |
477 | return self._pipei |
|
477 | return self._pipei | |
478 |
|
478 | |||
479 | def _getamount(self): |
|
479 | def _getamount(self): | |
@@ -488,10 +488,10 b' class sshv1peer(wireproto.wirepeer):' | |||||
488 | except ValueError: |
|
488 | except ValueError: | |
489 | self._abort(error.ResponseError(_("unexpected response:"), l)) |
|
489 | self._abort(error.ResponseError(_("unexpected response:"), l)) | |
490 |
|
490 | |||
491 |
def _re |
|
491 | def _readframed(self): | |
492 | return self._pipei.read(self._getamount()) |
|
492 | return self._pipei.read(self._getamount()) | |
493 |
|
493 | |||
494 |
def _ |
|
494 | def _writeframed(self, data, flush=False): | |
495 | self._pipeo.write("%d\n" % len(data)) |
|
495 | self._pipeo.write("%d\n" % len(data)) | |
496 | if data: |
|
496 | if data: | |
497 | self._pipeo.write(data) |
|
497 | self._pipeo.write(data) |
General Comments 0
You need to be logged in to leave comments.
Login now