Commit 7f32b017 authored by shajiaiming's avatar shajiaiming

fix

parent 74fadbdd
...@@ -167,9 +167,9 @@ class CurlHttpClient ...@@ -167,9 +167,9 @@ class CurlHttpClient
$this->response = curl_exec($this->curl_handle); $this->response = curl_exec($this->curl_handle);
// Connect failed? // Connect failed?
if (!$this->response) { if (!$this->response) {
curl_close($this->curl_handle);
$error = 'CurlHttpClient: Could not connect to ' . $full_url; $error = 'CurlHttpClient: Could not connect to ' . $full_url;
\Yii::$app->fpf->error('http', curl_errno($this->curl_handle), __CLASS__, __FUNCTION__, ' ERROR:' .$error); \Yii::$app->fpf->error('http', curl_errno($this->curl_handle), __CLASS__, __FUNCTION__, ' ERROR:' .$error);
curl_close($this->curl_handle);
$this->curl_handle = null; $this->curl_handle = null;
throw new CurlHttpException($error, CurlHttpException::NOT_OPEN); throw new CurlHttpException($error, CurlHttpException::NOT_OPEN);
} }
......
...@@ -234,9 +234,9 @@ class TCurlClient extends \Thrift\Transport\TTransport ...@@ -234,9 +234,9 @@ class TCurlClient extends \Thrift\Transport\TTransport
$this->response_ = curl_exec($this->handle); $this->response_ = curl_exec($this->handle);
// Connect failed? // Connect failed?
if (!$this->response_) { if (!$this->response_) {
curl_close($this->handle);
$error = 'TCurlClient: Could not connect to ' . $full_url; $error = 'TCurlClient: Could not connect to ' . $full_url;
\Yii::$app->fpf->error('http', curl_errno($this->handle), __CLASS__, __FUNCTION__, ' ERROR:' .$error); \Yii::$app->fpf->error('http', curl_errno($this->handle), __CLASS__, __FUNCTION__, ' ERROR:' .$error);
curl_close($this->handle);
$this->handle = null; $this->handle = null;
throw new TTransportException($error, TTransportException::NOT_OPEN); throw new TTransportException($error, TTransportException::NOT_OPEN);
} }
......
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