Kaydet (Commit) 51a035e3 authored tarafından Kristján Valur Jónsson's avatar Kristján Valur Jónsson

Issue 4929: Handle socket errors when receiving

üst a200dd55
......@@ -334,7 +334,10 @@ class SMTP:
if self.file is None:
self.file = self.sock.makefile('rb')
while 1:
line = self.file.readline()
try:
line = self.file.readline()
except socket.error:
line = ''
if line == '':
self.close()
raise SMTPServerDisconnected("Connection unexpectedly closed")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment