Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1262430
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/conduit/ConduitFuture.php b/src/conduit/ConduitFuture.php
index 351d2d11..5966f42e 100644
--- a/src/conduit/ConduitFuture.php
+++ b/src/conduit/ConduitFuture.php
@@ -1,79 +1,84 @@
<?php
final class ConduitFuture extends FutureProxy {
private $client;
private $engine;
private $conduitMethod;
public function setClient(ConduitClient $client, $method) {
$this->client = $client;
$this->conduitMethod = $method;
return $this;
}
protected function getServiceProfilerStartParameters() {
return array(
'type' => 'conduit',
'method' => $this->conduitMethod,
'size' => $this->getProxiedFuture()->getHTTPRequestByteLength(),
);
}
protected function getServiceProfilerResultParameters() {
return array();
}
protected function didReceiveResult($result) {
list($status, $body, $headers) = $result;
if ($status->isError()) {
throw $status;
}
$capabilities = array();
foreach ($headers as $header) {
list($name, $value) = $header;
if (!strcasecmp($name, 'X-Conduit-Capabilities')) {
$capabilities = explode(' ', $value);
break;
}
}
if ($capabilities) {
$this->client->enableCapabilities($capabilities);
}
$raw = $body;
$shield = 'for(;;);';
if (!strncmp($raw, $shield, strlen($shield))) {
$raw = substr($raw, strlen($shield));
}
$data = null;
try {
$data = phutil_json_decode($raw);
} catch (PhutilJSONParserException $ex) {
throw new PhutilProxyException(
pht(
'Host returned HTTP/200, but invalid JSON data in response to '.
'a Conduit method call.'),
$ex);
}
if ($data['error_code']) {
+ $message = pht(
+ '<%s> %s',
+ $this->conduitMethod,
+ $data['error_info']);
+
throw new ConduitClientException(
$data['error_code'],
- $data['error_info']);
+ $message);
}
$result = $data['result'];
$result = $this->client->didReceiveResponse(
$this->conduitMethod,
$result);
return $result;
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Jan 24, 03:14 (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
601537
Default Alt Text
(2 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment