2018-01-27 15:22:47 -04:00
|
|
|
import enum
|
|
|
|
|
2013-11-01 18:12:50 -03:00
|
|
|
# After the connection is lost, log warnings after this many write()s.
|
2013-10-17 17:40:50 -03:00
|
|
|
LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5
|
2013-11-01 18:12:50 -03:00
|
|
|
|
|
|
|
# Seconds to wait before retrying accept().
|
|
|
|
ACCEPT_RETRY_DELAY = 1
|
2017-11-07 12:23:29 -04:00
|
|
|
|
|
|
|
# Number of stack entries to capture in debug mode.
|
2017-11-07 13:05:15 -04:00
|
|
|
# The larger the number, the slower the operation in debug mode
|
2017-12-15 01:04:38 -04:00
|
|
|
# (see extract_stack() in format_helpers.py).
|
2017-11-07 12:23:29 -04:00
|
|
|
DEBUG_STACK_DEPTH = 10
|
2017-12-19 15:45:42 -04:00
|
|
|
|
|
|
|
# Number of seconds to wait for SSL handshake to complete
|
2018-06-04 12:32:35 -03:00
|
|
|
# The default timeout matches that of Nginx.
|
|
|
|
SSL_HANDSHAKE_TIMEOUT = 60.0
|
2018-01-27 15:22:47 -04:00
|
|
|
|
2020-01-12 15:13:38 -04:00
|
|
|
# Number of seconds to wait for SSL shutdown to complete
|
|
|
|
# The default timeout mimics lingering_time
|
|
|
|
SSL_SHUTDOWN_TIMEOUT = 30.0
|
|
|
|
|
2018-05-28 19:31:55 -03:00
|
|
|
# Used in sendfile fallback code. We use fallback for platforms
|
|
|
|
# that don't support sendfile, or for TLS connections.
|
|
|
|
SENDFILE_FALLBACK_READBUFFER_SIZE = 1024 * 256
|
|
|
|
|
2020-01-12 15:13:38 -04:00
|
|
|
FLOW_CONTROL_HIGH_WATER_SSL_READ = 256 # KiB
|
|
|
|
FLOW_CONTROL_HIGH_WATER_SSL_WRITE = 512 # KiB
|
|
|
|
|
2018-01-27 15:22:47 -04:00
|
|
|
# The enum should be here to break circular dependencies between
|
|
|
|
# base_events and sslproto
|
|
|
|
class _SendfileMode(enum.Enum):
|
|
|
|
UNSUPPORTED = enum.auto()
|
|
|
|
TRY_NATIVE = enum.auto()
|
|
|
|
FALLBACK = enum.auto()
|