import enum12# After the connection is lost, log warnings after this many write()s.3LOG_THRESHOLD_FOR_CONNLOST_WRITES = 545# Seconds to wait before retrying accept().6ACCEPT_RETRY_DELAY = 178# Number of stack entries to capture in debug mode.9# The larger the number, the slower the operation in debug mode10# (see extract_stack() in format_helpers.py).11DEBUG_STACK_DEPTH = 101213# Number of seconds to wait for SSL handshake to complete14# The default timeout matches that of Nginx.15SSL_HANDSHAKE_TIMEOUT = 60.01617# Number of seconds to wait for SSL shutdown to complete18# The default timeout mimics lingering_time19SSL_SHUTDOWN_TIMEOUT = 30.02021# Used in sendfile fallback code. We use fallback for platforms22# that don't support sendfile, or for TLS connections.23SENDFILE_FALLBACK_READBUFFER_SIZE = 1024 * 2562425FLOW_CONTROL_HIGH_WATER_SSL_READ = 256 # KiB26FLOW_CONTROL_HIGH_WATER_SSL_WRITE = 512 # KiB2728# Default timeout for joining the threads in the threadpool29THREAD_JOIN_TIMEOUT = 3003031# The enum should be here to break circular dependencies between32# base_events and sslproto33class _SendfileMode(enum.Enum):34UNSUPPORTED = enum.auto()35TRY_NATIVE = enum.auto()36FALLBACK = enum.auto()373839