diff --git a/application/third_party/tuniu/controllers/tuniu_train.php b/application/third_party/tuniu/controllers/tuniu_train.php index 559fba16..e1c82793 100644 --- a/application/third_party/tuniu/controllers/tuniu_train.php +++ b/application/third_party/tuniu/controllers/tuniu_train.php @@ -19,6 +19,17 @@ class Tuniu_train extends CI_Controller{ $this->load->model("tuniuprice_model"); } + public function test_response(){ + sleep(44); + echo '123'; + } + + public function test_post(){ + $url = 'http://cht.mycht.cn/info.php/apps/tuniu/tuniu_train/test_response/'; + $data = post_tuniu($url,'',$method = 'POST'); + echo $data; + } + //创建请求签名 public function create_sign(){ $time = date('Y-m-d H:i:s',time()); diff --git a/application/third_party/tuniu/helpers/tuniu_helper.php b/application/third_party/tuniu/helpers/tuniu_helper.php index 822429e6..7c6a4324 100644 --- a/application/third_party/tuniu/helpers/tuniu_helper.php +++ b/application/third_party/tuniu/helpers/tuniu_helper.php @@ -45,6 +45,7 @@ curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); } curl_setopt($curl, CURLOPT_TIMEOUT, 45); // 设置超时限制防止死循环 + curl_setopt($curl, CURLOPT_TIMEOUT_MS, 45000); // 设置超时限制防止死循环 curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回 $tmpInfo = curl_exec($curl); // 执行操作