Skip to content
Snippets Groups Projects
Commit 7f834d9c authored by Phil's avatar Phil
Browse files

Raise an exception when underlying socket used in a StreamSocket dies (ticket #94)

parent 1a941832
No related branches found
No related tags found
No related merge requests found
......@@ -489,6 +489,8 @@ class StreamSocket(SimpleSocket):
def recv(self, x=MTU):
pkt = self.ins.recv(x, socket.MSG_PEEK)
x = len(pkt)
if x == 0:
raise socket.error((100,"Underlying stream socket tore down"))
pkt = self.basecls(pkt)
pad = pkt[Padding]
if pad is not None and pad.underlayer is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment