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.
|
restarting workers.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class Sendfile(Setting):
|
class Sendfile(Setting):
|
||||||
name = "sendfile"
|
name = "sendfile"
|
||||||
section = "Server Mechanics"
|
section = "Server Mechanics"
|
||||||
cli = ["--no-sendfile"]
|
cli = ["--no-sendfile"]
|
||||||
validator = validate_bool
|
validator = validate_bool
|
||||||
action = "store_false"
|
action = "store_const"
|
||||||
default = True
|
const = False
|
||||||
desc = """\
|
desc = """\
|
||||||
Disables the use of ``sendfile()``.
|
Disables the use of ``sendfile()``.
|
||||||
|
|
||||||
@ -837,6 +838,7 @@ class Sendfile(Setting):
|
|||||||
disabling.
|
disabling.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class Chdir(Setting):
|
class Chdir(Setting):
|
||||||
name = "chdir"
|
name = "chdir"
|
||||||
section = "Server Mechanics"
|
section = "Server Mechanics"
|
||||||
|
|||||||
@ -347,7 +347,7 @@ class Response(object):
|
|||||||
util.write(self.sock, arg, self.chunked)
|
util.write(self.sock, arg, self.chunked)
|
||||||
|
|
||||||
def can_sendfile(self):
|
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):
|
def sendfile(self, respiter):
|
||||||
if self.cfg.is_ssl or not self.can_sendfile():
|
if self.cfg.is_ssl or not self.can_sendfile():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user