blob: d7ba496942896999524c370dfae9ee56a6d652a4 [file] [log] [blame]
Andrew Svetlov7c684072018-01-27 21:22:47 +02001import enum
2
Guido van Rossum3317a132013-11-01 14:12:50 -07003# After the connection is lost, log warnings after this many write()s.
Guido van Rossum27b7c7e2013-10-17 13:40:50 -07004LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5
Guido van Rossum3317a132013-11-01 14:12:50 -07005
6# Seconds to wait before retrying accept().
7ACCEPT_RETRY_DELAY = 1
Antoine Pitrou921e9432017-11-07 17:23:29 +01008
9# Number of stack entries to capture in debug mode.
Barry Warsawc060c7e2017-11-07 09:05:15 -080010# The larger the number, the slower the operation in debug mode
Andrew Svetlovf74ef452017-12-15 07:04:38 +020011# (see extract_stack() in format_helpers.py).
Antoine Pitrou921e9432017-11-07 17:23:29 +010012DEBUG_STACK_DEPTH = 10
Neil Aspinallf7686c12017-12-19 19:45:42 +000013
14# Number of seconds to wait for SSL handshake to complete
15SSL_HANDSHAKE_TIMEOUT = 10.0
Andrew Svetlov7c684072018-01-27 21:22:47 +020016
Miss Islington (bot)420092e2018-05-28 18:42:45 -070017# Used in sendfile fallback code. We use fallback for platforms
18# that don't support sendfile, or for TLS connections.
19SENDFILE_FALLBACK_READBUFFER_SIZE = 1024 * 256
20
Andrew Svetlov7c684072018-01-27 21:22:47 +020021# The enum should be here to break circular dependencies between
22# base_events and sslproto
23class _SendfileMode(enum.Enum):
24 UNSUPPORTED = enum.auto()
25 TRY_NATIVE = enum.auto()
26 FALLBACK = enum.auto()