File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -445,6 +445,12 @@ func (f *ftpPoolFactory) ValidateObject(ctx context.Context, object *pool.Pooled
445445 // Validate connection by sending NOOP command
446446 conn := object .Object .(* ftp.ServerConn )
447447 if err := conn .NoOp (); err != nil {
448+ // Some FTP servers (like pure-ftpd) don't support NOOP command and return "500 Unknown command"
449+ // This still means the connection is alive (server received and responded to command)
450+ if strings .HasPrefix (err .Error (), "500" ) {
451+ log .Debug ().Msgf ("ftpPoolFactory->ValidateObject NoOp returned 500 (command not supported), connection still valid" )
452+ return true
453+ }
448454 log .Debug ().Msgf ("ftpPoolFactory->ValidateObject NoOp failed: %v" , err )
449455 return false
450456 }
You can’t perform that action at this time.
0 commit comments