mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
parent
9673b970d0
commit
e77d47cb97
@ -108,8 +108,12 @@ class AsyncWorker(base.Worker):
|
|||||||
if resp.headers_sent:
|
if resp.headers_sent:
|
||||||
# If the requests have already been sent, we should close the
|
# If the requests have already been sent, we should close the
|
||||||
# connection to indicate the error.
|
# connection to indicate the error.
|
||||||
sock.shutdown(socket.SHUT_RDWR)
|
try:
|
||||||
sock.close()
|
sock.shutdown(socket.SHUT_RDWR)
|
||||||
|
sock.close()
|
||||||
|
except socket.error:
|
||||||
|
pass
|
||||||
|
return
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -142,8 +142,13 @@ class SyncWorker(base.Worker):
|
|||||||
if resp.headers_sent:
|
if resp.headers_sent:
|
||||||
# If the requests have already been sent, we should close the
|
# If the requests have already been sent, we should close the
|
||||||
# connection to indicate the error.
|
# connection to indicate the error.
|
||||||
client.shutdown(socket.SHUT_RDWR)
|
try:
|
||||||
client.close()
|
client.shutdown(socket.SHUT_RDWR)
|
||||||
|
client.close()
|
||||||
|
except socket.error:
|
||||||
|
pass
|
||||||
|
|
||||||
|
return
|
||||||
# Only send back traceback in HTTP in debug mode.
|
# Only send back traceback in HTTP in debug mode.
|
||||||
self.handle_error(req, client, addr, e)
|
self.handle_error(req, client, addr, e)
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user