Troubles accessing same files through different networks (LAN/SFTP)
This is my first contribution here, so I hope I'll provide relevant and required information to make a clear presentation of the bug I think I found.
Vocabulary In this bug description, I use the wording "SFTP connection". In the context of this bug report it means: SFTP connection created in VLC. Unless specified otherwise the wording "SFTP connection" always means "SFTP connection created in VLC".
Description of the bug Accessing the same video file through two different local network, using two SFTP connections (one for each network) can lead to VLC not being able to read the video file.
If you access a video file with VLC for Android through Network "A" then later on, through another SFTP connection you access the video file but this time through network "B" VLC will not read the file and the error message will actually say that VLC is still trying to access the file through network "A"!! Despite the facts that: the android device is NOT connected anymore to network "A", AND the SFTP connection used in VLC is NOT the one using network "A".
Ok, I realize that it might be difficult to understand what I mean here. So lets go straight to the next section: how to reproduce the bug.
How to reproduce the bug
- Have a SSH server with some video files on it
- Have two local networks: In our example the networks will be Network A: 192.168.1.* and Network B: 192.168.42.*
- Have the server connected to these two networks (in my case one connection is done through 8P8C cable (https://en.wikipedia.org/wiki/Modular_connector#8P8C) the other one via Wifi)
- Pick up your favorite Android device (see "Technical information" to see which versions I am using)
- Connect your Android device to network A
- Start VLC
- In VLC, access and or create a SFTP connection through Network A to the SSH server
- Access a video file "F" on it
- Mind your own business for a little while (doesn't matter if you wait long or not)
- Switch your Android device to Network B
- Optional: kill VLC and restart it > should not change anything
- In VLC, access and or create a SFTP connection through Network B to the SSH Server
- Through the connection using Network B, try to access the same file "F" as before
- BOOM > VLC will try to read the file > and throw an error message stating CLEARLY that it is trying to access the file through Network A and that the file can't be read
Technical information Android Device and version of VLC
- Android Device: Honor 9
- OS: Android 9
- Kernel version: 4.9.148
- VLC version: 13e15aa9 VLC 38efa645 (2021-01-20)
Linux server
- Linux 4.19.0-13-amd64 vlc#1 (closed) SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux
- OpenSSH_7.9p1 Debian-10+deb10u2, OpenSSL 1.1.1d
My guesses VLC "recognizes" the file name and put it in some sort of cache Despite the caching, VLC does not "realize" that the network connection is not the same, and that the SFTP connection is not the same either! So it tries to read the file as it did before using, for instance, Network A when the android device is connected through Network B and when a different SFTP connection is used (in VLC)
Why in the hell would you have two networks pointing to the same local server? The reason is simple: network A, is both local AND connected to the internet; network B is fully local. Before going to sleep, I enjoy watching videos from my local server, BUT I want to disable all possible interactions with the outside world (i.e. internet) so my best way to do that is to have another network. Plus, in case of issues with one network, the other one is likely to be operational, which guarantees me SSH access to my Linux server and allows me to not go through the hassle of having to plug, keyboard and screen to know what's going on on my server