def cmd_eprt(param)
      send_unauthorised and return unless logged_in?
      send_param_required and return if param.nil?

      delim = param[0,1]
      m, af, host, port = *param.match(/#{delim}(.+?)#{delim}(.+?)#{delim}(.+?)#{delim}/)
      port = port.to_i
      close_datasocket

      if af.to_i != 1 && ad.to_i != 2
        send_response "522 Network protocol not supported, use (1,2)"
      else
        debug "connecting to client #{host} on #{port}"
        @datasocket = FTPActiveDataSocket.open(host, port)

        puts "Opened active connection at #{host}:#{port}"
        send_response "200 Connection established (#{port})"
      end
    rescue
      warn "Error opening data connection to #{host}:#{port}"
      send_response "425 Data connection failed"
    end
def cmd_eprt(param)
      send_unauthorised and return unless logged_in?
      send_param_required and return if param.nil?

      delim = param[0,1]
      m, af, host, port = *param.match(/#{delim}(.+?)#{delim}(.+?)#{delim}(.+?)#{delim}/)
      port = port.to_i
      close_datasocket

      if af.to_i != 1 && ad.to_i != 2
        send_response "522 Network protocol not supported, use (1,2)"
      else
        debug "connecting to client #{host} on #{port}"
        @datasocket = FTPActiveDataSocket.open(host, port)

        puts "Opened active connection at #{host}:#{port}"
        send_response "200 Connection established (#{port})"
      end
    rescue
      warn "Error opening data connection to #{host}:#{port}"
      send_response "425 Data connection failed"
    end
Active FTP.