From 6b1015fcdd74e144faa71425eecedf52976f03b4 Mon Sep 17 00:00:00 2001 From: cyc Date: Thu, 11 Oct 2018 12:00:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86curl=E8=B6=85=E6=97=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=BA25S?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/tuniu/controllers/tuniu_train.php | 11 ----------- .../third_party/tuniu/helpers/tuniu_helper.php | 4 ++-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/application/third_party/tuniu/controllers/tuniu_train.php b/application/third_party/tuniu/controllers/tuniu_train.php index e1c82793..559fba16 100644 --- a/application/third_party/tuniu/controllers/tuniu_train.php +++ b/application/third_party/tuniu/controllers/tuniu_train.php @@ -19,17 +19,6 @@ 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 7c6a4324..eb76527d 100644 --- a/application/third_party/tuniu/helpers/tuniu_helper.php +++ b/application/third_party/tuniu/helpers/tuniu_helper.php @@ -44,8 +44,8 @@ curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Post提交的数据包 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_TIMEOUT, 25); // 设置超时限制防止死循环 + curl_setopt($curl, CURLOPT_TIMEOUT_MS, 25000); // 设置超时限制防止死循环 curl_setopt($curl, CURLOPT_HEADER, 0); // 显示返回的Header区域内容 curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // 获取的信息以文件流的形式返回 $tmpInfo = curl_exec($curl); // 执行操作