<commit_before>#!/usr/bin/env ruby

module Ftpd
  class FtpServer < TlsServer

    extend Forwardable

    DEFAULT_SERVER_NAME = 'wconrad/ftpd'
    DEFAULT_SESSION_TIMEOUT = 300 # seconds

    # The number of seconds to delay before replying.  This is for
    # testing, when you need to test, for example, client timeouts.
    # Defaults to 0 (no delay).
    #
    # Set this before calling #start.

    attr_accessor :response_delay

    # The class for formatting for LIST output.  Defaults to
    # {Ftpd::ListFormat::Ls}.
    #
    # Set this before calling #start.

    attr_accessor :list_formatter

    # @return [Integer] The authentication level
    # One of:
    # * Ftpd::AUTH_USER
    # * Ftpd::AUTH_PASSWORD (default)
    # * Ftpd::AUTH_ACCOUNT

    attr_accessor :auth_level

    # The session timeout.  When a session is awaiting a command, if
    # one is not received in this many seconds, the session is
    # disconnected.  Defaults to {DEFAULT_SESSION_TIMEOUT}.  If nil,
    # then timeout is disabled.
    # @return [Numeric]
    #
    # Set this before calling #start.

    attr_accessor :session_timeout

    # The server's name, sent in a STAT reply.  Defaults to
    # {DEFAULT_SERVER_NAME}.
    #
    # Set this before calling #start.

    attr_accessor :server_name

    # The server's version, sent in a STAT reply.  Defaults to the
    # contents of the VERSION file.
    #
    # Set this before calling #start.

    attr_accessor :server_version

    # The logger.  Defaults to nil (no logging).
    # @return [Logger]
    #
    # Set this before calling #start.

    attr_accessor :log

    # Allow PORT command to specify data ports below 1024.  Defaults
    # to false.  Setting this to true makes it easier for an attacker
    # to use the server to attack another server.  See RFC 2577
    # section 3.
    # @return [Boolean]
    #
    # Set this before calling #start.

    attr_accessor :allow_low_data_ports

    # The maximum number of connections the server will allow
    # Defaults to {ConnectionThrottle::DEFAULT_MAX_CONNECTIONS}.
    #
    # Set this before calling #start.
    #
    # @!attribute max_connections
    # @return [Integer]

    def_delegator :@connection_throttle, :'max_connections'
    def_delegator :@connection_throttle, :'max_connections='

    # The maximum number of connections the server will allow from a
    # given IP.
    # Defaults to {ConnectionThrottle::DEFAULT_MAX_CONNECTIONS_PER_IP}.
    #
    # Set this before calling #start.
    #
    # @!attribute max_connections_per_ip
    # @return [Integer]

    def_delegator :@connection_throttle, :'max_connections_per_ip'
    def_delegator :@connection_throttle, :'max_connections_per_ip='

    # Create a new FTP server.  The server won't start until the
    # #start method is called.
    #
    # @param driver A driver for the server's dynamic behavior such as
    #               authentication and file system access.
    #
    # The driver should expose these public methods:
    # * {Example::Driver#authenticate authenticate}
    # * {Example::Driver#file_system file_system}

    def initialize(driver)
      super()
      @driver = driver<commit_msg>FtpServer attributes in alphabetical order<commit_after>#!/usr/bin/env ruby

module Ftpd
  class FtpServer < TlsServer

    extend Forwardable

    DEFAULT_SERVER_NAME = 'wconrad/ftpd'
    DEFAULT_SESSION_TIMEOUT = 300 # seconds

    # Allow PORT command to specify data ports below 1024.  Defaults
    # to false.  Setting this to true makes it easier for an attacker
    # to use the server to attack another server.  See RFC 2577
    # section 3.
    # @return [Boolean]
    #
    # Set this before calling #start.

    attr_accessor :allow_low_data_ports

    # @return [Integer] The authentication level
    # One of:
    # * Ftpd::AUTH_USER
    # * Ftpd::AUTH_PASSWORD (default)
    # * Ftpd::AUTH_ACCOUNT

    attr_accessor :auth_level

    # The class for formatting for LIST output.  Defaults to
    # {Ftpd::ListFormat::Ls}.
    #
    # Set this before calling #start.

    attr_accessor :list_formatter

    # The logger.  Defaults to nil (no logging).
    # @return [Logger]
    #
    # Set this before calling #start.

    attr_accessor :log

    # The maximum number of connections the server will allow
    # Defaults to {ConnectionThrottle::DEFAULT_MAX_CONNECTIONS}.
    #
    # Set this before calling #start.
    #
    # @!attribute max_connections
    # @return [Integer]

    def_delegator :@connection_throttle, :'max_connections'
    def_delegator :@connection_throttle, :'max_connections='

    # The maximum number of connections the server will allow from a
    # given IP.
    # Defaults to {ConnectionThrottle::DEFAULT_MAX_CONNECTIONS_PER_IP}.
    #
    # Set this before calling #start.
    #
    # @!attribute max_connections_per_ip
    # @return [Integer]

    def_delegator :@connection_throttle, :'max_connections_per_ip'
    def_delegator :@connection_throttle, :'max_connections_per_ip='

    # The number of seconds to delay before replying.  This is for
    # testing, when you need to test, for example, client timeouts.
    # Defaults to 0 (no delay).
    #
    # Set this before calling #start.

    attr_accessor :response_delay

    # The server's name, sent in a STAT reply.  Defaults to
    # {DEFAULT_SERVER_NAME}.
    #
    # Set this before calling #start.

    attr_accessor :server_name

    # The server's version, sent in a STAT reply.  Defaults to the
    # contents of the VERSION file.
    #
    # Set this before calling #start.

    attr_accessor :server_version

    # The session timeout.  When a session is awaiting a command, if
    # one is not received in this many seconds, the session is
    # disconnected.  Defaults to {DEFAULT_SESSION_TIMEOUT}.  If nil,
    # then timeout is disabled.
    # @return [Numeric]
    #
    # Set this before calling #start.

    attr_accessor :session_timeout

    # Create a new FTP server.  The server won't start until the
    # #start method is called.
    #
    # @param driver A driver for the server's dynamic behavior such as
    #               authentication and file system access.
    #
    # The driver should expose these public methods:
    # * {Example::Driver#authenticate authenticate}
    # * {Example::Driver#file_system file_system}

    def initialize(driver)
      super()
      @driver = driver
{'fraction_non_alphanumeric': 0.07657446476011877, 'fraction_numerical': 0.004063134864822629, 'mean_word_length': 2.8905775075987843, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1166958', 'n_tokens_mistral': 1987, 'n_tokens_neox': 1875, 'n_words': 651}