From 029ec9c20943727bc728224084171df03183fba8 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 9 Jul 2023 22:19:11 +1000 Subject: [PATCH] Only consider NR mode if the offset presented is -1 --- app/Classes/Protocol.php | 3 +-- app/Classes/Protocol/Binkp.php | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Classes/Protocol.php b/app/Classes/Protocol.php index c5a6cef..bbc3ee0 100644 --- a/app/Classes/Protocol.php +++ b/app/Classes/Protocol.php @@ -249,14 +249,13 @@ abstract class Protocol */ public function onConnect(SocketClient $client): ?int { - $ppid = getmypid(); $pid = pcntl_fork(); if ($pid === -1) throw new SocketException(SocketException::CANT_ACCEPT,'Could not fork process'); if ($pid) - Log::info(sprintf('%s:- Running connection in pid [%d] (%d)',self::LOGKEY,$pid,$ppid)); + Log::info(sprintf('%s:+ New connection, thread [%d] created',self::LOGKEY,$pid)); // Parent return ready for next connection return $pid; diff --git a/app/Classes/Protocol/Binkp.php b/app/Classes/Protocol/Binkp.php index 6cde6ab..cc1a608 100644 --- a/app/Classes/Protocol/Binkp.php +++ b/app/Classes/Protocol/Binkp.php @@ -13,7 +13,7 @@ use App\Classes\Crypt; use App\Classes\Protocol as BaseProtocol; use App\Classes\Sock\SocketClient; use App\Classes\Sock\SocketException; -use App\Models\{Address,Setup}; +use App\Models\Address; final class Binkp extends BaseProtocol { @@ -900,7 +900,7 @@ final class Binkp extends BaseProtocol Log::debug(sprintf('%s:- Getting file from offset [%ld]',self::LOGKEY,$file['offs'])); //$this->msgs(self::BPM_GET,sprintf('%s %ld',$this->recv->name_size_time,($file['offs'] < 0) ? 0 : $file['offs'])); - if (((int)$file['offs'] !== -1) && (! $this->capGet(self::F_NOREL,self::O_THEY))) { + if (((int)$file['offs'] === -1) && (! $this->capGet(self::F_NOREL,self::O_THEY))) { Log::debug(sprintf('%s:- Assuming the remote wants NR mode, since offset is [%d] and they didnt specify an OPT with it',self::LOGKEY,$file['offs'])); $this->capSet(self::F_NOREL,self::O_THEY); }