From 460b0e46eea0b380dcb04154ead43f0adc7a710d Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 16 Feb 2017 05:08:51 -0800 Subject: [PATCH] Fix a property name collision in ArcanistHgServerChannel Summary: See D2665. Here, `channel` is the Mercurial wire protocol channel name ("o" = "output", "e" = "error", etc), not the underlying channel from `PhutilProxyChannel`. Rename the property so there's no collision. Test Plan: ``` $ ../../core/lib/arcanist/scripts/hgdaemon/hgdaemon_client.php . --trace --skip-hello array(3) { [0]=> int(0) [1]=> string(103) "capabilities: getencoding runcommand encoding: UTF-8 pid: 73263e20cf21273d50f1f66cab6e0f7c74f4864e67f0f" [2]=> string(0) "" } Executed in 30647 us. ``` Reviewers: vrana, chad Reviewed By: vrana Differential Revision: https://secure.phabricator.com/D17366 --- src/hgdaemon/ArcanistHgServerChannel.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hgdaemon/ArcanistHgServerChannel.php b/src/hgdaemon/ArcanistHgServerChannel.php index 1850c9af..22f6b4ab 100644 --- a/src/hgdaemon/ArcanistHgServerChannel.php +++ b/src/hgdaemon/ArcanistHgServerChannel.php @@ -54,6 +54,7 @@ final class ArcanistHgServerChannel extends PhutilProtocolChannel { private $mode = self::MODE_CHANNEL; private $byteLengthOfNextChunk = 1; private $buf = ''; + private $outputChannel; /* -( Protocol Implementation )-------------------------------------------- */ @@ -137,7 +138,7 @@ final class ArcanistHgServerChannel extends PhutilProtocolChannel { // 'output', 'error', 'result' or 'debug' respectively. This is a // single byte long. Next, we'll expect a length. - $this->channel = $chunk; + $this->outputChannel = $chunk; $this->byteLengthOfNextChunk = 4; $this->mode = self::MODE_LENGTH; break; @@ -153,11 +154,11 @@ final class ArcanistHgServerChannel extends PhutilProtocolChannel { // given length. We produce a message from the channel and the data // and return it. Next, we expect another channel name. - $message = array($this->channel, $chunk); + $message = array($this->outputChannel, $chunk); $this->byteLengthOfNextChunk = 1; $this->mode = self::MODE_CHANNEL; - $this->channel = null; + $this->outputChannel = null; $messages[] = $message; break;