Better support of peek in SocketClient
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 37s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m34s
Create Docker Image / Final Docker Image Manifest (push) Successful in 10s

This commit is contained in:
Deon George 2025-01-31 16:22:43 +11:00
parent 21519d680b
commit 3ed4907296

View File

@ -494,6 +494,12 @@ final class SocketClient {
$this->rx_buf .= $buf;
if ($flags === MSG_PEEK) {
Log::debug(sprintf('%s:- Returning [%d] chars as a result of a PEEK operation, buffer would have [%d], but still has [%d]',self::LOGKEY,$len,strlen($this->rx_buf.$buf),strlen($this->rx_buf)),['rx_buf'=>hex_dump($this->rx_buf),'buf'=>$buf]);
return substr($this->rx_buf.$buf,0,$len);
}
if (self::DEBUG)
Log::debug(sprintf('%s:- Added [%d] chars to the RX buffer',self::LOGKEY,strlen($buf)),['rx_buf'=>hex_dump($this->rx_buf)]);