From 2297da817a5bf15a4b0e8ca363f552c28441c9d3 Mon Sep 17 00:00:00 2001 From: Mxmilu666 Date: Thu, 2 May 2024 12:02:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=8E=A8=20=E5=88=A0=E9=99=A4=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=B2=A1=E5=BF=85=E8=A6=81=E7=9A=84=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/main.php b/main.php index 3399c45..820db3d 100644 --- a/main.php +++ b/main.php @@ -10,7 +10,6 @@ $DOWNLOAD_DIR = $config['file']['cache_dir']; const USERAGENT = 'openbmclapi-cluster/' . VERSION . ' ' . 'PHP-OpenBmclApi/'.PHPOBAVERSION; const OPENBMCLAPIURL = 'openbmclapi.bangbang93.com'; -global $tokendata; $list = glob('inc/*.php'); foreach ($list as $file) { require $file; @@ -51,7 +50,6 @@ function registerSigintHandler() { $tokendata = $token->gettoken(); mlog("GetNewToken:".$tokendata['token'],1); }); - global $socketio; registerSigintHandler(); mlog("Timer start on ID{$tokentimeid}",1); @@ -133,7 +131,6 @@ function registerSigintHandler() { fclose($cert); } global $httpserver; - global $DOWNLOAD_DIR; $httpserver = new fileserver($config['cluster']['host'],$config['cluster']['port'],$config['cluster']['CLUSTER_ID'].'.crt',$config['cluster']['CLUSTER_ID'].'.key',$config['cluster']['CLUSTER_SECRET']); Coroutine::create(function () use ($config,$httpserver){ $httpserver->startserver(); From b8ce23762247a678da44792b0bcabc43d99cf2a9 Mon Sep 17 00:00:00 2001 From: Mxmilu666 Date: Thu, 2 May 2024 12:56:25 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20=E5=8F=98=E9=87=8F=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/socketio.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/socketio.php b/inc/socketio.php index 361088e..2cae699 100644 --- a/inc/socketio.php +++ b/inc/socketio.php @@ -183,6 +183,6 @@ public function disable() { Coroutine::sleep(2); } mlog("[socket.io]Close Connection"); - $this->$client->close(); + $this->client->close(); } } \ No newline at end of file From 4614bd9e180f0ac2cc21a371c801a9cef0ce674b Mon Sep 17 00:00:00 2001 From: Mxmilu666 Date: Thu, 2 May 2024 14:24:25 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=90=9B=20=E8=BF=94=E5=9B=9E=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=E7=A7=B0=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/server.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inc/server.php b/inc/server.php index 25fd21f..a703412 100644 --- a/inc/server.php +++ b/inc/server.php @@ -66,7 +66,9 @@ public function startserver() { } $code = 206; $response->header('Content-Type', 'application/octet-stream'); - $response->header('Content-Disposition', $allurl['name']); + if(isset($request->header['name'])){ + $response->header('Content-Disposition', $allurl['name']); + } $response->header('x-bmclapi-hash', $downloadhash); $result = $response->sendfile($filepath,$start_byte,$length); } @@ -79,7 +81,9 @@ public function startserver() { } $code = 200; $response->header('Content-Type', 'application/octet-stream'); - $response->header('Content-Disposition', $allurl['name']); + if(isset($request->header['name'])){ + $response->header('Content-Disposition', $allurl['name']); + } $response->header('x-bmclapi-hash', $downloadhash); $result = $response->sendfile($filepath); }