Commit 58049bc4 authored by tufengqi's avatar tufengqi

fix post curl bug

parent f6f18f2b
......@@ -98,7 +98,7 @@ class CurlHttpClient
$scheme = 'https' === $arr[0] ? 'https' : 'http';
$this->scheme = $scheme;
$this->full_url = $url;
$this->post_arr = $post_arr;
$this->post_fields = $post_arr;
if (!empty($options['time']['connect_timeout_ms'])) {
$this->connect_timeout_ms = $options['time']['connect_timeout'];
}
......
......@@ -202,7 +202,7 @@ class TCurlClient extends \Thrift\Transport\TTransport
public function flush()
{
if (!self::$curlHandle) {
register_shutdown_function(array('Thrift\\Transport\\TCurlClient', 'closeCurlHandle'));
register_shutdown_function(array($this, 'closeCurlHandle'));
self::$curlHandle = curl_init();
curl_setopt(self::$curlHandle, CURLOPT_RETURNTRANSFER, true);
curl_setopt(self::$curlHandle, CURLOPT_BINARYTRANSFER, true);
......@@ -234,7 +234,6 @@ class TCurlClient extends \Thrift\Transport\TTransport
$this->request_ = '';
curl_setopt(self::$curlHandle, CURLOPT_URL, $fullUrl);
$this->response_ = curl_exec(self::$curlHandle);
// echo $this->response_ ;exit;
// Connect failed?
if (!$this->response_) {
curl_close(self::$curlHandle);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment