.flush can raise NetlibDisconnect. This fixes a traceback found in fuzzing.

This commit is contained in:
Aldo Cortesi 2014-11-07 16:01:41 +13:00
parent 9ce2f473f6
commit 0811a9ebde

View File

@ -253,7 +253,10 @@ class _Connection(object):
# Closing the socket is not our task, therefore we don't call close then. # Closing the socket is not our task, therefore we don't call close then.
if type(self.connection) != SSL.Connection: if type(self.connection) != SSL.Connection:
if not getattr(self.wfile, "closed", False): if not getattr(self.wfile, "closed", False):
try:
self.wfile.flush() self.wfile.flush()
except NetLibDisconnect:
pass
self.wfile.close() self.wfile.close()
self.rfile.close() self.rfile.close()