serve: fix VFS instance leaks on server startup failures and shutdown

This commit is contained in:
Hakan İSMAİL
2026-08-18 09:03:12 +01:00
committed by Nick Craig-Wood
parent 45ddf3a5f2
commit 216d2a8c76
5 changed files with 41 additions and 4 deletions
+6 -1
View File
@@ -354,7 +354,12 @@ func (d *driver) CheckPasswd(sctx *ftp.Context, user, pass string) (ok bool, err
return true, nil
}
// Get the VFS for this connection
// getVFS returns the VFS for this connection.
//
// In proxy mode, getVFS calls proxy.Call on each FTP command which refreshes
// the proxy cache timer (like http/webdav). Therefore, connection-level pinning
// is not used; only individual transfers exceeding the cache expiry window
// could be affected.
func (d *driver) getVFS(sctx *ftp.Context) (VFS *vfs.VFS, err error) {
if !d.provider.IsProxy() {
// If no proxy always use the same VFS