Enabled configuration of EMSI tunables in setup
This commit is contained in:
@@ -6,6 +6,7 @@ use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Classes\File\{Receive,Send};
|
||||
use App\Classes\Protocol\EMSI;
|
||||
use App\Classes\Sock\SocketClient;
|
||||
use App\Classes\Sock\SocketException;
|
||||
use App\Models\{Address,Setup,System,SystemLog};
|
||||
@@ -402,7 +403,7 @@ abstract class Protocol
|
||||
|
||||
// @todo These flags determine when we connect to the remote.
|
||||
// If the remote indicated that they dont support file requests (NRQ) or temporarily hold them (HRQ)
|
||||
if (($this->node->optionGet(self::O_NRQ) && (! $this->setup->ignore_nrq)) || $this->node->optionGet(self::O_HRQ))
|
||||
if (($this->node->optionGet(self::O_NRQ) && (! $this->setup->optionGet(EMSI::F_IGNORE_NRQ,'emsi_options'))) || $this->node->optionGet(self::O_HRQ))
|
||||
$rc |= self::S_HOLDR;
|
||||
|
||||
if ($this->optionGet(self::O_HXT))
|
||||
|
@@ -39,6 +39,13 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
||||
private const NL = "\n";
|
||||
private const DEL = "\x08";
|
||||
|
||||
/* FEATURES */
|
||||
|
||||
/** Ignore NRQ */
|
||||
public const F_IGNORE_NRQ = 1<<0;
|
||||
/** Send an immediate EMSI_INQ on connect */
|
||||
public const F_DO_PREVENT = 1<<1;
|
||||
|
||||
private const EMSI_BUF = 8192;
|
||||
private const TMP_LEN = 1024;
|
||||
|
||||
@@ -825,6 +832,9 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
||||
if ($this->originate) {
|
||||
$gotreq = 0;
|
||||
|
||||
if ($this->setup->optionGet(EMSI::F_DO_PREVENT,'emsi_options'))
|
||||
$this->capSet(EMSI::F_DO_PREVENT,self::O_YES);
|
||||
|
||||
// Send a character to get a response from the remote
|
||||
$t1 = $this->client->timer_set(self::EMSI_HSTIMEOUT);
|
||||
do {
|
||||
@@ -848,8 +858,8 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
||||
return self::TIMEOUT;
|
||||
|
||||
if ($this->client->timer_expired($t2)) {
|
||||
if ($this->setup->do_prevent && $tries === 0) {
|
||||
$this->setup->do_prevent = 0;
|
||||
if ($this->capGet(EMSI::F_DO_PREVENT,self::O_YES) && $tries === 0) {
|
||||
$this->capSet(EMSI::F_DO_PREVENT,self::O_NO);
|
||||
|
||||
$this->client->buffer_add(self::EMSI_INQ.self::CR);
|
||||
$this->client->buffer_flush(5);
|
||||
|
Reference in New Issue
Block a user