Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit b80107c

Browse files
authored
Merge pull request #4 from AppleBlockTeam/dev
同步dev分支
2 parents 4b01b29 + 4614bd9 commit b80107c

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

inc/server.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public function startserver() {
6666
}
6767
$code = 206;
6868
$response->header('Content-Type', 'application/octet-stream');
69-
$response->header('Content-Disposition', $allurl['name']);
69+
if(isset($request->header['name'])){
70+
$response->header('Content-Disposition', $allurl['name']);
71+
}
7072
$response->header('x-bmclapi-hash', $downloadhash);
7173
$result = $response->sendfile($filepath,$start_byte,$length);
7274
}
@@ -79,7 +81,9 @@ public function startserver() {
7981
}
8082
$code = 200;
8183
$response->header('Content-Type', 'application/octet-stream');
82-
$response->header('Content-Disposition', $allurl['name']);
84+
if(isset($request->header['name'])){
85+
$response->header('Content-Disposition', $allurl['name']);
86+
}
8387
$response->header('x-bmclapi-hash', $downloadhash);
8488
$result = $response->sendfile($filepath);
8589
}

inc/socketio.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,6 @@ public function disable() {
183183
Coroutine::sleep(2);
184184
}
185185
mlog("[socket.io]Close Connection");
186-
$this->$client->close();
186+
$this->client->close();
187187
}
188188
}

main.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
$DOWNLOAD_DIR = $config['file']['cache_dir'];
1111
const USERAGENT = 'openbmclapi-cluster/' . VERSION . ' ' . 'PHP-OpenBmclApi/'.PHPOBAVERSION;
1212
const OPENBMCLAPIURL = 'openbmclapi.bangbang93.com';
13-
global $tokendata;
1413
$list = glob('inc/*.php');
1514
foreach ($list as $file) {
1615
require $file;
@@ -51,7 +50,6 @@ function registerSigintHandler() {
5150
$tokendata = $token->gettoken();
5251
mlog("GetNewToken:".$tokendata['token'],1);
5352
});
54-
global $socketio;
5553
registerSigintHandler();
5654
mlog("Timer start on ID{$tokentimeid}",1);
5755

@@ -133,7 +131,6 @@ function registerSigintHandler() {
133131
fclose($cert);
134132
}
135133
global $httpserver;
136-
global $DOWNLOAD_DIR;
137134
$httpserver = new fileserver($config['cluster']['host'],$config['cluster']['port'],$config['cluster']['CLUSTER_ID'].'.crt',$config['cluster']['CLUSTER_ID'].'.key',$config['cluster']['CLUSTER_SECRET']);
138135
Coroutine::create(function () use ($config,$httpserver){
139136
$httpserver->startserver();

0 commit comments

Comments
 (0)