Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18404171
D21251.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D21251.diff
View Options
diff --git a/src/future/http/HTTPSFuture.php b/src/future/http/HTTPSFuture.php
--- a/src/future/http/HTTPSFuture.php
+++ b/src/future/http/HTTPSFuture.php
@@ -27,6 +27,8 @@
private $parser;
private $progressSink;
+ private $curlOptions = array();
+
/**
* Create a temp file containing an SSL cert, and use it for this session.
*
@@ -164,6 +166,22 @@
return $this->progressSink;
}
+ /**
+ * See T13533. This supports an install-specific Kerberos workflow.
+ */
+ public function addCURLOption($option_key, $option_value) {
+ if (!is_scalar($option_key)) {
+ throw new Exception(
+ pht(
+ 'Expected option key passed to "addCurlOption(<key>, ...)" to be '.
+ 'a scalar, got "%s".',
+ phutil_describe_type($option_key)));
+ }
+
+ $this->curlOptions[] = array($option_key, $option_value);
+ return $this;
+ }
+
/**
* Attach a file to the request.
*
@@ -409,6 +427,24 @@
curl_setopt($curl, CURLOPT_PROXY, (string)$proxy);
}
+ foreach ($this->curlOptions as $curl_option) {
+ list($curl_key, $curl_value) = $curl_option;
+ try {
+ $ok = curl_setopt($curl, $curl_key, $curl_value);
+ if (!$ok) {
+ throw new Exception(
+ pht(
+ 'Call to "curl_setopt(...)" returned "false".'));
+ }
+ } catch (Exception $ex) {
+ throw new PhutilProxyException(
+ pht(
+ 'Call to "curl_setopt(...) failed for option key "%s".',
+ $curl_key),
+ $ex);
+ }
+ }
+
if ($is_download) {
$this->downloadHandle = @fopen($this->downloadPath, 'wb+');
if (!$this->downloadHandle) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Aug 30, 9:57 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8810821
Default Alt Text
D21251.diff (1 KB)
Attached To
Mode
D21251: Add "HTTPSFuture->addCurlOption()" for raw access to "curl_setopt()"
Attached
Detach File
Event Timeline
Log In to Comment