FIX: isConnected() does not detect that the server closed the connection#95
FIX: isConnected() does not detect that the server closed the connection#95pvgnd wants to merge 1 commit intothephpleague:masterfrom
Conversation
|
@frankdejonge this PR is ready for review :) |
|
@frankdejonge Any chance this is going to get merged? This problem was described in #66 but that issue was closed while the problem still exists. In phpseclib the connection is only marked as closed after an operation has failed. So when iterating over a list of files and calling The solution of calling ping to check if a connection is open is very similar to the FTP adapter which sends a NOOP package in the This PR is for v1 though the same problem exists in v2 when using the simple connectivity checker. |
|
This PR is on my list for this weekend to review. |
|
Hello guys, |
Hi, any news on this? |
|
We actually had to implement our own retry layer due to this issue. @frankdejonge Any problems with this solution? I can rebase it on v2. |
|
Hello it seems like @frankdejonge worked on it can't wait for that feature thanks man |
|
Hi, |
use League\Flysystem\PhpseclibV2\ConnectivityChecker;
use phpseclib\Net\SFTP;
class SftpPingConnectivityChecker implements ConnectivityChecker
{
public function isConnected(SFTP $connection): bool
{
return $connection->ping() && $connection->isConnected();
}
}@kiropowered We just register our own connectivity checker that performs pinging. Depends on your project/configuration but if you're by chance using oneup/flysystem-bundle, the connectivity checker can be overridden directly in the configuration. oneup_flysystem:
adapters:
sftp_adapter:
sftp:
options:
connectivityChecker: Fulfillment\CommonBundle\SFTP\SftpPingConnectivityChecker |
|
Thank you for the answer. |
|
@kiropowered check this out https://stackoverflow.com/questions/70436411/how-to-override-a-file-in-vendor-directory |
|
This Pr could be closed since this fonctions has been implemented. This is usable like this on Laravel 6+ Thanks @pvgnd for your contribution. |
No description provided.