Changeset View
Changeset View
Standalone View
Standalone View
src/future/http/HTTPSFuture.php
Context not available. | |||||
curl_setopt($curl, CURLOPT_REDIR_PROTOCOLS, $allowed_protocols); | curl_setopt($curl, CURLOPT_REDIR_PROTOCOLS, $allowed_protocols); | ||||
} | } | ||||
if (strlen($this->rawBody)) { | if (@strlen($this->rawBody)) { | ||||
if ($this->getData()) { | if ($this->getData()) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
Context not available. | |||||
// a PUT request. | // a PUT request. | ||||
curl_setopt($curl, CURLOPT_PUT, true); | curl_setopt($curl, CURLOPT_PUT, true); | ||||
curl_setopt($curl, CURLOPT_INFILE, $this->fileHandle); | curl_setopt($curl, CURLOPT_INFILE, $this->fileHandle); | ||||
curl_setopt($curl, CURLOPT_INFILESIZE, strlen($this->rawBody)); | curl_setopt($curl, CURLOPT_INFILESIZE, @strlen($this->rawBody)); | ||||
curl_setopt($curl, CURLOPT_READFUNCTION, | curl_setopt($curl, CURLOPT_READFUNCTION, | ||||
array($this, 'willWriteBody')); | array($this, 'willWriteBody')); | ||||
} else { | } else { | ||||
Context not available. | |||||
$this->responseBuffer .= $data; | $this->responseBuffer .= $data; | ||||
} | } | ||||
return strlen($data); | return @strlen($data); | ||||
} | } | ||||
Context not available. | |||||
'parser.')); | 'parser.')); | ||||
} | } | ||||
$result = substr($this->responseBuffer, $this->responseBufferPos); | $result = @substr($this->responseBuffer, $this->responseBufferPos); | ||||
$this->responseBufferPos = strlen($this->responseBuffer); | $this->responseBufferPos = @strlen($this->responseBuffer); | ||||
return $result; | return $result; | ||||
} | } | ||||
Context not available. | |||||
$data = $this->getData(); | $data = $this->getData(); | ||||
$files = $this->files; | $files = $this->files; | ||||
$any_data = ($data || (is_string($data) && strlen($data))); | $any_data = ($data || (is_string($data) && @strlen($data))); | ||||
$any_files = (bool)$this->files; | $any_files = (bool)$this->files; | ||||
if (!$any_data && !$any_files) { | if (!$any_data && !$any_files) { | ||||
Context not available. | |||||
* Callback to pass data to cURL. | * Callback to pass data to cURL. | ||||
*/ | */ | ||||
public function willWriteBody($handle, $infile, $len) { | public function willWriteBody($handle, $infile, $len) { | ||||
$bytes = substr($this->rawBody, $this->rawBodyPos, $len); | $bytes = @substr($this->rawBody, $this->rawBodyPos, $len); | ||||
$this->rawBodyPos += $len; | $this->rawBodyPos += $len; | ||||
return $bytes; | return $bytes; | ||||
} | } | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0