Remove CommProtocolReceive commands, Remove protocol onConnect() functions, pass Setup::class to protocols
This commit is contained in:
@@ -12,7 +12,6 @@ use App\Classes\Crypt;
|
||||
use App\Classes\Node;
|
||||
use App\Classes\Protocol as BaseProtocol;
|
||||
use App\Classes\Sock\Exception\SocketException;
|
||||
use App\Classes\Sock\SocketClient;
|
||||
use App\Exceptions\{FileGrewException,InvalidFTNException};
|
||||
use App\Models\{Address,Setup};
|
||||
|
||||
@@ -142,27 +141,6 @@ final class Binkp extends BaseProtocol
|
||||
*/
|
||||
private Crypt $crypt_out;
|
||||
|
||||
/**
|
||||
* Incoming BINKP session
|
||||
*
|
||||
* @param SocketClient $client
|
||||
* @return int|null
|
||||
* @throws SocketException
|
||||
*/
|
||||
public function onConnect(SocketClient $client): ?int
|
||||
{
|
||||
// If our parent returns a PID, we've forked
|
||||
if (! parent::onConnect($client)) {
|
||||
Log::withContext(['pid'=>getmypid()]);
|
||||
|
||||
$this->session($client,(new Address));
|
||||
$this->client->close();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* BINKD handshake
|
||||
*
|
||||
|
@@ -6,7 +6,6 @@ use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
use App\Classes\Protocol as BaseProtocol;
|
||||
use App\Classes\Sock\SocketClient;
|
||||
use App\Models\{Address,Domain,Mailer};
|
||||
|
||||
/**
|
||||
@@ -64,22 +63,6 @@ final class DNS extends BaseProtocol
|
||||
public const DNS_TYPE_OPT = 41; // OPT Records
|
||||
public const DNS_TYPE_DS = 43; // DS Records (Delegation signer RFC 4034)
|
||||
|
||||
public function onConnect(SocketClient $client): ?int
|
||||
{
|
||||
// If our parent returns a PID, we've forked
|
||||
if (! parent::onConnect($client)) {
|
||||
Log::withContext(['pid'=>getmypid()]);
|
||||
|
||||
$this->client = $client;
|
||||
$this->protocol_session();
|
||||
|
||||
Log::debug(sprintf('%s:= onConnect - Connection closed [%s]',self::LOGKEY,$client->address_remote));
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
protected function protocol_init(): int
|
||||
{
|
||||
// N/A
|
||||
|
@@ -7,7 +7,6 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Classes\Protocol as BaseProtocol;
|
||||
use App\Classes\Sock\Exception\SocketException;
|
||||
use App\Classes\Sock\SocketClient;
|
||||
use App\Exceptions\InvalidFTNException;
|
||||
use App\Interfaces\CRC as CRCInterface;
|
||||
use App\Interfaces\Zmodem as ZmodemInterface;
|
||||
@@ -82,27 +81,6 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
||||
'1'=>self::P_ZMODEM,
|
||||
];
|
||||
|
||||
/**
|
||||
* Incoming EMSI session
|
||||
*
|
||||
* @param SocketClient $client
|
||||
* @return int|null
|
||||
* @throws SocketException
|
||||
*/
|
||||
public function onConnect(SocketClient $client): ?int
|
||||
{
|
||||
// If our parent returns a PID, we've forked
|
||||
if (! parent::onConnect($client)) {
|
||||
Log::withContext(['pid'=>getmypid()]);
|
||||
|
||||
$this->session($client,(new Address));
|
||||
$this->client->close();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send our welcome banner
|
||||
*
|
||||
|
@@ -202,27 +202,6 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
||||
private string $rxbuf = '';
|
||||
private string $txbuf = '';
|
||||
|
||||
/**
|
||||
* @param SocketClient $client
|
||||
* @return null
|
||||
* @throws SocketException
|
||||
*/
|
||||
public function onConnect(SocketClient $client): ?int
|
||||
{
|
||||
// If our parent returns a PID, we've forked
|
||||
if (! parent::onConnect($client)) {
|
||||
Log::withContext(['pid'=>getmypid()]);
|
||||
|
||||
$this->session($client);
|
||||
$this->client->close();
|
||||
|
||||
Log::info(sprintf('%s:= onConnect - Connection closed [%s]',self::LOGKEY,$client->address_remote));
|
||||
exit(0);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise our session
|
||||
*/
|
||||
|
Reference in New Issue
Block a user