Dont accept connections when application down
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 39s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m46s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
2024-06-07 18:07:34 +10:00
parent b23d9351b5
commit 829fe1d7a9
4 changed files with 240 additions and 207 deletions

View File

@@ -168,10 +168,21 @@ final class Binkp extends BaseProtocol
*
* @throws \Exception
*/
private function binkp_hs(): void
private function binkp_hs(): bool
{
Log::debug(sprintf('%s:+ Starting BINKP handshake',self::LOGKEY));
if (! $this->originate && $this->down) {
Log::info(sprintf('%s:! System down for maintenance',self::LOGKEY));
$this->msgs(self::BPM_BSY,'RETRY 0600: Down for maintenance, back soon...');
while ($this->tx_left || $this->mqueue->count())
$this->binkp_send();
return FALSE;
}
if (! $this->originate && $this->capGet(self::F_MD,self::O_WANT)) {
$random_key = random_bytes(8);
$this->md_challenge = md5($random_key,TRUE);
@@ -206,6 +217,8 @@ final class Binkp extends BaseProtocol
$this->msgs(self::BPM_ADR,$addresses->pluck('ftn')->join(' '));
}
return TRUE;
}
/**
@@ -1341,7 +1354,8 @@ final class Binkp extends BaseProtocol
return self::S_FAILURE;
$this->force_queue = $force_queue;
$this->binkp_hs();
if (! $this->binkp_hs())
return self::S_FAILURE;
while (TRUE) {
if ((! $this->sessionGet(self::SE_INIT))