Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions inc/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion inc/socketio.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,6 @@ public function disable() {
Coroutine::sleep(2);
}
mlog("[socket.io]Close Connection");
$this->$client->close();
$this->client->close();
}
}
3 changes: 0 additions & 3 deletions main.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,7 +50,6 @@ function registerSigintHandler() {
$tokendata = $token->gettoken();
mlog("GetNewToken:".$tokendata['token'],1);
});
global $socketio;
registerSigintHandler();
mlog("Timer start on ID{$tokentimeid}",1);

Expand Down Expand Up @@ -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();
Expand Down