From ecd69fc8fb8ce04cde2dab31aacc7abbf588c99f Mon Sep 17 00:00:00 2001 From: Mxmilu666 Date: Sun, 5 May 2024 20:02:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E5=99=A8=E4=B8=8D=E5=B8=A6ua=E6=97=B6=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/server.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/server.php b/inc/server.php index e1a2873..5221691 100644 --- a/inc/server.php +++ b/inc/server.php @@ -107,6 +107,10 @@ public function startserver() { else{ $url = $request->server['request_uri']."?".$request->server['query_string']; } + //真的会有启动器不带ua的啊,太神奇了 + if(!isset($request->server['user-agent'])){ + $request->server['user-agent'] = "other"; + } mlog(" Serve {$code} | {$request->server['remote_addr']} | {$request->server['server_protocol']} | {$url} | {$request->header['user-agent']};") ; }); $server->handle('/measure', function ($request, $response) { From 7b0a250f258a11fb537d002f6579869e59e84ed1 Mon Sep 17 00:00:00 2001 From: Mxmilu666 Date: Mon, 6 May 2024 00:00:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=A8=20=E6=94=AF=E6=8C=81byoc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.php | 1 + inc/socketio.php | 4 ++-- main.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config.php b/config.php index b8cb580..adf6ec8 100644 --- a/config.php +++ b/config.php @@ -7,6 +7,7 @@ "public_port"=> 4000,//服务端口 "CLUSTER_ID"=> "", "CLUSTER_SECRET"=> "", + "byoc"=>false, ], "file"=> [ "cache_dir"=> "./cache",//缓存文件夹 diff --git a/inc/socketio.php b/inc/socketio.php index 2cae699..d08b7b2 100644 --- a/inc/socketio.php +++ b/inc/socketio.php @@ -142,7 +142,7 @@ public function ack($event,$data = "") { public function Getclient() { return $this->client; } - public function enable($host,$port) { + public function enable($host,$port,$byoc) { if (in_array($host, ["0.0.0.0", "127.0.0.1"])){ $host = preg_replace('/\R/', '', file_get_contents('http://ip.3322.net')); } @@ -151,7 +151,7 @@ public function enable($host,$port) { 'host' => $host, 'port' => $port, 'version' => VERSION, - 'byoc' => false, + 'byoc' => $byoc, 'noFastEnable' => false, 'flavor' =>[ 'runtime' => 'PHP-'.substr(PHP_VERSION,0,3).'/'.php_uname('s'), diff --git a/main.php b/main.php index 79a873d..8cce16d 100644 --- a/main.php +++ b/main.php @@ -4,7 +4,7 @@ use function Swoole\Timer; declare(ticks=1) require './config.php'; -const PHPOBAVERSION = '1.2.0'; +const PHPOBAVERSION = '1.3.0'; const VERSION = '1.10.4'; global $DOWNLOAD_DIR; $DOWNLOAD_DIR = $config['file']['cache_dir']; @@ -135,6 +135,6 @@ function registerSigintHandler() { Coroutine::create(function () use ($config,$httpserver){ $httpserver->startserver(); }); - $socketio->enable($config['cluster']['public_host'],$config['cluster']['public_port']); + $socketio->enable($config['cluster']['public_host'],$config['cluster']['public_port'],$config['cluster']['byoc']); } }); \ No newline at end of file From 1b2f4ba196645e7a514a44c6dbd8db882e85d911 Mon Sep 17 00:00:00 2001 From: Mxmilu666 Date: Mon, 6 May 2024 22:48:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=90=9B=20=E6=8A=8A=E5=86=85=E5=AD=98?= =?UTF-8?q?=E8=B0=83=E6=88=90=E6=97=A0=E4=B8=8A=E9=99=90=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E8=83=BD=E8=A7=A3=E5=86=B3=E5=81=87=E6=AD=BB?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=3F(?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.php b/main.php index 8cce16d..2ba5e68 100644 --- a/main.php +++ b/main.php @@ -3,6 +3,8 @@ use function Swoole\Coroutine\run; use function Swoole\Timer; declare(ticks=1) +set_time_limit(0); +ini_set('memory_limit', '-1'); require './config.php'; const PHPOBAVERSION = '1.3.0'; const VERSION = '1.10.4';