From 00494cadfa202fe3496473f1a3ff58fee497b2d1 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 27 Jun 2024 13:44:49 +1000 Subject: [PATCH] Remove a deprecated function in BINKP and SocketClient --- app/Classes/Protocol/Binkp.php | 25 +------------------------ app/Classes/Sock/SocketClient.php | 27 +-------------------------- 2 files changed, 2 insertions(+), 50 deletions(-) diff --git a/app/Classes/Protocol/Binkp.php b/app/Classes/Protocol/Binkp.php index 94c4401..4b34f27 100644 --- a/app/Classes/Protocol/Binkp.php +++ b/app/Classes/Protocol/Binkp.php @@ -1433,33 +1433,10 @@ final class Binkp extends BaseProtocol } $wd = ($this->mqueue->count() || $this->tx_left || ($this->sessionGet(self::SE_SENDFILE) && $this->send->fd && ! $this->sessionGet(self::SE_WAITGET))); - $rd = TRUE; - - try { - Log::debug(sprintf('%s:- Checking if there more data (ttySelect), timeout [%d]',self::LOGKEY,self::TIMEOUT_TIME)); - - // @todo we need to catch a timeout if there are no reads/writes - $rc = $this->client->ttySelect($rd,$wd,self::TIMEOUT_TIME); - - Log::debug(sprintf('%s:- ttySelect returned [%d]',self::LOGKEY,$rc)); - - } catch (\Exception) { - $this->error_close(); - $this->error = -2; - - break; - } $this->rc = ($this->originate ? (self::S_REDIAL|self::S_ADDTRY) : self::S_BUSY); - if ($rc === 0) { - $this->error_close(); - $this->error = -1; - - break; - } - - if ($rd && ! $this->binkp_recv()) { + if (! $this->binkp_recv()) { Log::info(sprintf('%s:- BINKP finished reading',self::LOGKEY)); break; diff --git a/app/Classes/Sock/SocketClient.php b/app/Classes/Sock/SocketClient.php index 4b01a2a..4313af8 100644 --- a/app/Classes/Sock/SocketClient.php +++ b/app/Classes/Sock/SocketClient.php @@ -556,29 +556,4 @@ final class SocketClient { { return time()+$expire; } - - /** - * See if there is data waiting to collect, or if we can send - * - * @param bool $read - * @param bool $write - * @param int $timeout - * @return int - * @throws \Exception - * @deprecated use canSend or hasData - */ - public function ttySelect(bool $read,bool $write, int $timeout): int - { - if ($this->rx_left) { - if (self::DEBUG) - Log::debug(sprintf('%s:= We still have [%d] chars in the RX buffer.',self::LOGKEY,$this->rx_left)); - - return 1; - } - - $read = $read ? [$this->connection] : NULL; - $write = $write ? [$this->connection] : NULL; - - return $this->socketSelect($read,$write,NULL,$timeout); - } -} +} \ No newline at end of file