Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/sshpeer.py @ 25457:2afa748138e0
sshpeer: allow doublepipe on unbuffered main pipe
The output pipe does not have manually managed read buffer (actually, no read
anything). To also use the doublepipe for outgoing write (useful to consume
remote output when pushing large set of data) we need the doublepipe to work on
standard pipe too.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 05 Jun 2015 04:54:23 -0700 |
parents | 408b7979bf03 |
children | 4642f0b803ae |
comparison
equal
deleted
inserted
replaced
25456:408b7979bf03 | 25457:2afa748138e0 |
---|---|
63 | 63 |
64 return a pair of boolean (ismainready, issideready) | 64 return a pair of boolean (ismainready, issideready) |
65 | 65 |
66 (This will only wait for data if the setup is supported by `util.poll`) | 66 (This will only wait for data if the setup is supported by `util.poll`) |
67 """ | 67 """ |
68 if self._main.hasbuffer: | 68 if getattr(self._main, 'hasbuffer', False): # getattr for classic pipe |
69 return (True, True) # main has data, assume side is worth poking at. | 69 return (True, True) # main has data, assume side is worth poking at. |
70 fds = [self._main.fileno(), self._side.fileno()] | 70 fds = [self._main.fileno(), self._side.fileno()] |
71 try: | 71 try: |
72 act = util.poll(fds) | 72 act = util.poll(fds) |
73 except NotImplementedError: | 73 except NotImplementedError: |