mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Small correct for handle_error.
1. client.getpeername() can raise "error: [Errno 107] Transport endpoint is not connected" if a client has unexpectedly disconnected. 2. I guess we do not need worry about sending error message to client.
This commit is contained in:
parent
12a0e55bcf
commit
9dba6bf7ec
@ -148,8 +148,8 @@ class Worker(object):
|
|||||||
mesg = "<p>Error parsing headers: '%s'</p>" % str(exc)
|
mesg = "<p>Error parsing headers: '%s'</p>" % str(exc)
|
||||||
|
|
||||||
self.log.debug("Invalid request from ip={ip}: {error}"\
|
self.log.debug("Invalid request from ip={ip}: {error}"\
|
||||||
"".format(ip=client.getpeername()[0],
|
"".format(ip=addr[0],
|
||||||
error=repr(exc),
|
error=str(exc),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@ -176,7 +176,7 @@ class Worker(object):
|
|||||||
try:
|
try:
|
||||||
util.write_error(client, status_int, reason, mesg)
|
util.write_error(client, status_int, reason, mesg)
|
||||||
except:
|
except:
|
||||||
self.log.warning("Failed to send error message.")
|
self.log.debug("Failed to send error message.")
|
||||||
|
|
||||||
def handle_winch(self, sig, fname):
|
def handle_winch(self, sig, fname):
|
||||||
# Ignore SIGWINCH in worker. Fixes a crash on OpenBSD.
|
# Ignore SIGWINCH in worker. Fixes a crash on OpenBSD.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user