1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Use more sensible waitForAny semantics in SSH process

Summary: Ref T4189. Updates the Phabricator stuff to use the new, more sensible semantics from D7769. Basically, this works correctly now and doesn't need workarounds.

Test Plan: Pushed Wine repo in 1m13s.

Reviewers: btrahan, zeeg

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4189

Differential Revision: https://secure.phabricator.com/D7770
This commit is contained in:
epriestley 2013-12-15 12:52:31 -08:00
parent 0011068d7a
commit b555e4bd91

View file

@ -76,13 +76,6 @@ final class PhabricatorSSHPassthruCommand extends Phobject {
public function writeErrorIOCallback(PhutilChannel $channel, $data) {
$this->errorChannel->write($data);
// TODO: Because of the way `waitForAny()` works, we degrade to a busy
// wait if we hand it a writable, write-only channel. We should handle this
// case better in `waitForAny()`. For now, just flush the error channel
// explicity after writing data over it.
$this->errorChannel->flush();
}
public function execute() {
@ -105,9 +98,7 @@ final class PhabricatorSSHPassthruCommand extends Phobject {
$channels = array($command_channel, $io_channel, $error_channel);
while (true) {
// TODO: See note in writeErrorIOCallback!
$wait = array($command_channel, $io_channel);
PhutilChannel::waitForAny($wait);
PhutilChannel::waitForAny($channels);
$io_channel->update();
$command_channel->update();