|
@@ -18,8 +18,6 @@ function http_request($url, $params = array(), $method = 'GET', $multi = false,
|
|
|
$method = strtoupper($method);
|
|
|
$ci = curl_init();
|
|
|
curl_setopt($ci, CURLOPT_USERAGENT, 'PHP-SDK OAuth2.0');
|
|
|
-// curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 10);
|
|
|
-// curl_setopt($ci, CURLOPT_TIMEOUT, 10);
|
|
|
curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);
|
|
|
curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, false);
|
|
@@ -63,9 +61,10 @@ function http_request($url, $params = array(), $method = 'GET', $multi = false,
|
|
|
}
|
|
|
|
|
|
$response = curl_exec($ci);
|
|
|
- if($response == false) {
|
|
|
+ if($response === false) {
|
|
|
$err = curl_error($ci);
|
|
|
- Log::record("http_request err={$err}",Log::ERR);
|
|
|
+ $no = curl_errno($ci);
|
|
|
+ Log::record("netmodule http_request errno={$no} err={$err}",Log::ERR);
|
|
|
}
|
|
|
|
|
|
curl_close($ci);
|
|
@@ -81,8 +80,6 @@ function http_post_data($url, $body, $headers = array())
|
|
|
|
|
|
$ci = curl_init();
|
|
|
curl_setopt($ci, CURLOPT_USERAGENT, 'PHP-SDK OAuth2.0');
|
|
|
- curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 10);
|
|
|
- curl_setopt($ci, CURLOPT_TIMEOUT, 10);
|
|
|
curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);
|
|
|
curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, false);
|
|
@@ -97,9 +94,10 @@ function http_post_data($url, $body, $headers = array())
|
|
|
}
|
|
|
|
|
|
$response = curl_exec($ci);
|
|
|
- if($response == false) {
|
|
|
+ if($response === false) {
|
|
|
$err = curl_error($ci);
|
|
|
- Log::record("http_post_data err={$err}",Log::ERR);
|
|
|
+ $no = curl_errno($ci);
|
|
|
+ Log::record("netmodule http_post_data errno={$no} err={$err}",Log::ERR);
|
|
|
}
|
|
|
curl_close($ci);
|
|
|
|
|
@@ -115,8 +113,6 @@ function https_request($url, $params = array(), $method = 'GET', $multi = false,
|
|
|
$method = strtoupper($method);
|
|
|
$ci = curl_init();
|
|
|
curl_setopt($ci, CURLOPT_USERAGENT, 'PHP-SDK OAuth2.0');
|
|
|
- curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 10);
|
|
|
- curl_setopt($ci, CURLOPT_TIMEOUT, 10);
|
|
|
curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);
|
|
|
curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);
|
|
@@ -158,6 +154,11 @@ function https_request($url, $params = array(), $method = 'GET', $multi = false,
|
|
|
}
|
|
|
|
|
|
$response = curl_exec($ci);
|
|
|
+ if($response === false) {
|
|
|
+ $err = curl_error($ci);
|
|
|
+ $no = curl_errno($ci);
|
|
|
+ Log::record("netmodule https_request errno={$no} err={$err}",Log::ERR);
|
|
|
+ }
|
|
|
curl_close($ci);
|
|
|
|
|
|
return $response;
|