From 1912c8f4083c425689e3d2a43e1763b6c81ca645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E6=81=92?= <2323333339@qq.com> Date: Thu, 20 May 2021 11:31:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/function.php | 6 ++++-- core/route.php | 4 +++- package.json | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/function.php b/core/function.php index b8656f0..016b517 100644 --- a/core/function.php +++ b/core/function.php @@ -2,7 +2,7 @@ /* 获取主题当前版本号 */ function _getVersion() { - return "7.0.2"; + return "7.0.3"; }; /* 判断是否是手机 */ @@ -278,12 +278,14 @@ function _curl($url) $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_NOSIGNAL, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 3000); + curl_setopt($ch, CURLOPT_TIMEOUT_MS, 3000); if (strpos($url, 'https') !== false) { curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); } curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36'); - curl_setopt($ch, CURLOPT_TIMEOUT, 5); $result = curl_exec($ch); curl_close($ch); return $result; diff --git a/core/route.php b/core/route.php index 90f1a70..b1184b5 100644 --- a/core/route.php +++ b/core/route.php @@ -313,7 +313,9 @@ function _getServerStatus($self) $request_token = md5($request_time . '' . md5($api_sk)); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $api_panel . '/system?action=GetNetWork'); - curl_setopt($ch, CURLOPT_TIMEOUT, 5); + curl_setopt($ch, CURLOPT_NOSIGNAL, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 3000); + curl_setopt($ch, CURLOPT_TIMEOUT_MS, 3000); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array("request_time" => $request_time, "request_token" => $request_token)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); diff --git a/package.json b/package.json index 3849ea2..0c88eb5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typecho-joe-next", - "version": "7.0.2", + "version": "7.0.3", "description": "A Theme Of Typecho", "main": "index.php", "keywords": [