mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Clarify --no-sendfile default
The --no-sendfile option had a confusing entry in the usage message. Even though sendfile is enabled by default, the --no-sendfile flag showed a true value as the default, which could be interpreted to mean that by default sendfile support is disabled. This change makes the default "None", meaning sendfile is not disabled, which is hopefully slightly more clear. Close #1156
This commit is contained in:
parent
2ac41c406b
commit
d8b6f0afff
@ -821,13 +821,14 @@ class PreloadApp(Setting):
|
||||
restarting workers.
|
||||
"""
|
||||
|
||||
|
||||
class Sendfile(Setting):
|
||||
name = "sendfile"
|
||||
section = "Server Mechanics"
|
||||
cli = ["--no-sendfile"]
|
||||
validator = validate_bool
|
||||
action = "store_false"
|
||||
default = True
|
||||
action = "store_const"
|
||||
const = False
|
||||
desc = """\
|
||||
Disables the use of ``sendfile()``.
|
||||
|
||||
@ -837,6 +838,7 @@ class Sendfile(Setting):
|
||||
disabling.
|
||||
"""
|
||||
|
||||
|
||||
class Chdir(Setting):
|
||||
name = "chdir"
|
||||
section = "Server Mechanics"
|
||||
|
||||
@ -347,7 +347,7 @@ class Response(object):
|
||||
util.write(self.sock, arg, self.chunked)
|
||||
|
||||
def can_sendfile(self):
|
||||
return self.cfg.sendfile and sendfile is not None
|
||||
return self.cfg.sendfile is not False and sendfile is not None
|
||||
|
||||
def sendfile(self, respiter):
|
||||
if self.cfg.is_ssl or not self.can_sendfile():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user