2018-01-27 19:22:47 +00:00
|
|
|
import enum
|
|
|
|
|
2013-11-01 21:12:50 +00:00
|
|
|
# After the connection is lost, log warnings after this many write()s.
|
2013-10-17 20:40:50 +00:00
|
|
|
LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5
|
2013-11-01 21:12:50 +00:00
|
|
|
|
|
|
|
# Seconds to wait before retrying accept().
|
|
|
|
ACCEPT_RETRY_DELAY = 1
|
2017-11-07 16:23:29 +00:00
|
|
|
|
|
|
|
# Number of stack entries to capture in debug mode.
|
2017-11-07 17:05:15 +00:00
|
|
|
# The larger the number, the slower the operation in debug mode
|
2017-12-15 05:04:38 +00:00
|
|
|
# (see extract_stack() in format_helpers.py).
|
2017-11-07 16:23:29 +00:00
|
|
|
DEBUG_STACK_DEPTH = 10
|
2017-12-19 19:45:42 +00:00
|
|
|
|
|
|
|
# Number of seconds to wait for SSL handshake to complete
|
2018-06-04 15:32:35 +00:00
|
|
|
# The default timeout matches that of Nginx.
|
|
|
|
SSL_HANDSHAKE_TIMEOUT = 60.0
|
2018-01-27 19:22:47 +00:00
|
|
|
|
2018-05-28 22:31:55 +00: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
|
|
|
|
|
2018-01-27 19:22:47 +00: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()
|