Sha256: e3fbdacbfc7d958dcc23c4074b6079aba9c01913fd5c49a6b8a0400ebab4f9a3

Contents?: true

Size: 763 Bytes

Versions: 7

Compression:

Stored size: 763 Bytes

Contents

# frozen_string_literal: true

require_relative 'command_handler'
require_relative 'data_server_factory'

module Ftpd

  class CmdEpsv < CommandHandler

    def cmd_epsv(argument)
      ensure_logged_in
      if data_server
        reply "200 Already in passive mode"
      else
        if argument == 'ALL'
          self.epsv_all = true
          reply "220 EPSV now required for port setup"
        else
          protocol_code = argument && argument.to_i
          if protocol_code
            ensure_protocol_supported protocol_code
          end
          self.data_server = data_server_factory.make_tcp_server
          port = data_server.addr[1]
          reply "229 Entering extended passive mode (|||#{port}|)"
        end
      end
    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ftpd-2.1.0 lib/ftpd/cmd_epsv.rb
ftpd-2.0.5 lib/ftpd/cmd_epsv.rb
ftpd-2.0.4 lib/ftpd/cmd_epsv.rb
ftpd-2.0.3 lib/ftpd/cmd_epsv.rb
ftpd-2.0.2 lib/ftpd/cmd_epsv.rb
ftpd-2.0.1 lib/ftpd/cmd_epsv.rb
ftpd-2.0.0 lib/ftpd/cmd_epsv.rb