Dont accept connections when application down
This commit is contained in:
@@ -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))
|
||||
|
Reference in New Issue
Block a user