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 the requests have already been sent, we should close the
|
||||
# connection to indicate the error.
|
||||
sock.shutdown(socket.SHUT_RDWR)
|
||||
sock.close()
|
||||
try:
|
||||
sock.shutdown(socket.SHUT_RDWR)
|
||||
sock.close()
|
||||
except socket.error:
|
||||
pass
|
||||
return
|
||||
raise
|
||||
finally:
|
||||
try:
|
||||
|
||||
@ -142,8 +142,13 @@ class SyncWorker(base.Worker):
|
||||
if resp.headers_sent:
|
||||
# If the requests have already been sent, we should close the
|
||||
# connection to indicate the error.
|
||||
client.shutdown(socket.SHUT_RDWR)
|
||||
client.close()
|
||||
try:
|
||||
client.shutdown(socket.SHUT_RDWR)
|
||||
client.close()
|
||||
except socket.error:
|
||||
pass
|
||||
|
||||
return
|
||||
# Only send back traceback in HTTP in debug mode.
|
||||
self.handle_error(req, client, addr, e)
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user