Read ahead over SFTP: take answers phpseclib has read already instead of waiting up to 10 s on the socket

This commit is contained in:
2026-10-19 05:28:26 +02:00
parent 88b719879d
commit 43a71684f9
3 changed files with 37 additions and 4 deletions
@@ -468,6 +468,10 @@ final class FakeSftpConnection {
public array $openHandles = [];
/** @var list<string> paths of every OPEN request */
public array $opened = [];
/** @var resource|null like phpseclib's socket (SftpRangeFetcher waits on it) */
public $fsock = null;
/** like phpseclib's: what came in with the last packet and is not read yet */
public string $packet_buffer = '';
/** Whether the SFTP channel is open: phpseclib 2 opens it on the first SFTP call. */
public bool $initialised = false;
/** Packets sent */