mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
update readme
This commit is contained in:
parent
33cf5dab01
commit
d21254edfc
@ -1,20 +0,0 @@
|
|||||||
bind='unix:/tmp/gunicorn.sock',
|
|
||||||
daemon=True,
|
|
||||||
debug=False,
|
|
||||||
logfile='/var/log/gunicorn.log',
|
|
||||||
loglevel='info',
|
|
||||||
pidfile='/var/run/gunicorn.pid',
|
|
||||||
workers=1,
|
|
||||||
umask=0,
|
|
||||||
|
|
||||||
# for systems with nobody and no group
|
|
||||||
user="nobody",
|
|
||||||
group="nogroup",
|
|
||||||
|
|
||||||
after_fork=lambda server, worker: server.log.info(
|
|
||||||
"worker=%s spawned pid=%s" % (worker.id, str(worker.pid))),
|
|
||||||
|
|
||||||
before_fork=lambda server, worker: server.log.info(
|
|
||||||
"worker=%s spawning" % worker.id),
|
|
||||||
|
|
||||||
before_exec=lambda server: server.log.info("forked child, reexecuting")
|
|
||||||
@ -412,5 +412,5 @@ class Arbiter(object):
|
|||||||
worker.tmp.close()
|
worker.tmp.close()
|
||||||
os.unlink(worker.tmpname)
|
os.unlink(worker.tmpname)
|
||||||
except (KeyError, OSError):
|
except (KeyError, OSError):
|
||||||
pass
|
return
|
||||||
raise
|
raise
|
||||||
|
|||||||
@ -74,6 +74,8 @@ class Request(object):
|
|||||||
|
|
||||||
self.log.debug("%s", self.parser.status)
|
self.log.debug("%s", self.parser.status)
|
||||||
self.log.debug("Headers:\n%s" % headers)
|
self.log.debug("Headers:\n%s" % headers)
|
||||||
|
if not headers:
|
||||||
|
return
|
||||||
|
|
||||||
if self.parser.headers_dict.get('Expect','').lower() == "100-continue":
|
if self.parser.headers_dict.get('Expect','').lower() == "100-continue":
|
||||||
self._sock.send("HTTP/1.1 100 Continue\r\n\r\n")
|
self._sock.send("HTTP/1.1 100 Continue\r\n\r\n")
|
||||||
|
|||||||
@ -34,7 +34,9 @@ class TeeInput(object):
|
|||||||
self._is_socket = True
|
self._is_socket = True
|
||||||
self._len = parser.content_len
|
self._len = parser.content_len
|
||||||
|
|
||||||
if self._len and self._len < util.MAX_BODY:
|
if not self.parser.content_len and not self.parser.is_chunked:
|
||||||
|
self.tmp = StringIO()
|
||||||
|
elif self._len and self._len < util.MAX_BODY:
|
||||||
self.tmp = StringIO()
|
self.tmp = StringIO()
|
||||||
else:
|
else:
|
||||||
self.tmp = tempfile.TemporaryFile(dir=self.conf['tmp_upload_dir'])
|
self.tmp = tempfile.TemporaryFile(dir=self.conf['tmp_upload_dir'])
|
||||||
|
|||||||
@ -33,9 +33,9 @@ class BaseSocket(object):
|
|||||||
|
|
||||||
def set_options(self, sock, bound=False):
|
def set_options(self, sock, bound=False):
|
||||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||||
|
sock.setblocking(0)
|
||||||
if not bound:
|
if not bound:
|
||||||
self.bind(sock)
|
self.bind(sock)
|
||||||
sock.setblocking(0)
|
|
||||||
sock.listen(self.conf['backlog'])
|
sock.listen(self.conf['backlog'])
|
||||||
return sock
|
return sock
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user