BINKP responding to incoming netmail pings
This commit is contained in:
@@ -102,7 +102,7 @@ final class Binkp extends BaseProtocol
|
||||
if (! parent::onConnect($client)) {
|
||||
$this->session(self::SESSION_BINKP,$client,(new Address));
|
||||
$this->client->close();
|
||||
Log::info(sprintf('%s: = End - Connection closed [%s]',__METHOD__,$client->getAddress()));
|
||||
Log::info(sprintf('%s: = End - Connection closed [%s]',__METHOD__,$client->address_remote));
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -133,9 +133,9 @@ final class Binkp extends BaseProtocol
|
||||
$this->msgs(self::BPM_NUL,
|
||||
sprintf('OPT%s%s%s%s%s%s',
|
||||
($this->setup->opt_nda) ? ' NDA' : '',
|
||||
($this->setup->opt_nr&self::O_WANT) ? ' NR' : '',
|
||||
($this->setup->opt_nd&self::O_THEY) ? ' ND' : '',
|
||||
($this->setup->opt_mb&self::O_WANT) ? ' MB' : '',
|
||||
($this->setup->opt_nr&self::O_WANT) ? ' NR' : '',
|
||||
($this->setup->opt_nd&self::O_THEY) ? ' ND' : '',
|
||||
($this->setup->opt_mb&self::O_WANT) ? ' MB' : '',
|
||||
($this->setup->opt_cr&self::O_WE) ? ' CRYPT' : '',
|
||||
($this->setup->opt_cht&self::O_WANT) ? ' CHAT' : ''));
|
||||
}
|
||||
@@ -622,8 +622,11 @@ final class Binkp extends BaseProtocol
|
||||
// @todo lock nodes
|
||||
$this->node->ftn = $o;
|
||||
|
||||
// @todo Find files for node
|
||||
$this->send->add('/tmp/aa');
|
||||
// Add our mail to the queue if we have authenticated
|
||||
if ($this->node->aka_authed)
|
||||
foreach ($this->node->aka_remote as $ao) {
|
||||
$this->send->mail($ao);
|
||||
}
|
||||
|
||||
Log::info(sprintf('%s: = Node has [%lu] mail and [%lu] files - [%lu] items',__METHOD__,$this->send->mail_size,$this->send->file_size,$this->send->total_count));
|
||||
|
||||
@@ -706,7 +709,13 @@ final class Binkp extends BaseProtocol
|
||||
$this->sessionClear(self::SE_DELAYEOB);
|
||||
|
||||
if (! $this->send->total_count && $this->sessionGet(self::SE_NOFILES)) {
|
||||
// @todo See if we need to send anything else, based on what we just recevied
|
||||
// Add our mail to the queue if we have authenticated
|
||||
if ($this->node->aka_authed)
|
||||
foreach ($this->node->aka_remote as $ao) {
|
||||
Log::debug(sprintf('%s: - Checking for any new mail to [%s]',__METHOD__,$ao->ftn));
|
||||
$this->send->mail($ao);
|
||||
}
|
||||
|
||||
if ($this->send->total_count)
|
||||
$this->sessionClear(self::SE_NOFILES);
|
||||
}
|
||||
@@ -760,7 +769,7 @@ final class Binkp extends BaseProtocol
|
||||
&& $this->recv->size == Arr::get($file,'file.size')
|
||||
&& $this->recv->filepos == $file['offs'])
|
||||
{
|
||||
$this->recv->open($file['offs']<0);
|
||||
$this->recv->open($this->node->address,$file['offs']<0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -768,7 +777,7 @@ final class Binkp extends BaseProtocol
|
||||
$this->recv->new($file['file']);
|
||||
|
||||
try {
|
||||
switch ($this->recv->open($file['offs']<0)) {
|
||||
switch ($this->recv->open($this->node->address,$file['offs']<0)) {
|
||||
case self::FOP_ERROR:
|
||||
Log::error(sprintf('%s: ! File Error',__METHOD__));
|
||||
|
||||
|
@@ -1154,7 +1154,7 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
|
||||
{
|
||||
Log::debug(sprintf('%s: + Start',__METHOD__));
|
||||
|
||||
$rc = (new Zmodem)->zmodem_receive($this->client,$zap,$this->recv,$this->setup->inbound);
|
||||
$rc = (new Zmodem)->zmodem_receive($this->client,$zap,$this->recv);
|
||||
|
||||
return ($rc == self::RCDO || $rc == self::ERROR);
|
||||
}
|
||||
|
@@ -274,7 +274,7 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
||||
$rc = $this->zmodem_senddone();
|
||||
|
||||
} else {
|
||||
$rc = $this->zmodem_receive($this->client,$proto,$this->recv,'.');
|
||||
$rc = $this->zmodem_receive($this->client,$proto,$this->recv);
|
||||
}
|
||||
|
||||
return $rc;
|
||||
@@ -285,13 +285,12 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
||||
*
|
||||
* @param SocketClient $client
|
||||
* @param Receive $recv
|
||||
* @param string $dir
|
||||
* @param int $canzap
|
||||
* @return int
|
||||
*/
|
||||
public function zmodem_receive(SocketClient $client,int $canzap,Receive $recv,string $dir): int
|
||||
public function zmodem_receive(SocketClient $client,int $canzap,Receive $recv,Address $ao): int
|
||||
{
|
||||
Log::debug(sprintf('%s: + Start [%d] into dir [%s]',__METHOD__,$canzap,$dir));
|
||||
Log::debug(sprintf('%s: + Start [%d]',__METHOD__,$canzap));
|
||||
|
||||
$opts = $this->init($client,$canzap);
|
||||
|
||||
@@ -336,7 +335,7 @@ final class Zmodem extends Protocol implements CRCInterface,ZmodemInterface
|
||||
$frame = self::ZSKIP;
|
||||
|
||||
} else {
|
||||
switch ($this->recv->open()) {
|
||||
switch ($this->recv->open($ao)) {
|
||||
case self::FOP_SKIP:
|
||||
Log::info(sprintf('%s: = Skip this file [%s]',__METHOD__,$this->recv->name));
|
||||
$frame = self::ZSKIP;
|
||||
|
Reference in New Issue
Block a user