|
@@ -34,6 +34,10 @@ class ProtocolHelper():
|
|
|
"""
|
|
|
#
|
|
|
data = socket.recv(num_bytes-len(self._buffer))
|
|
|
+ #
|
|
|
+ if len(data) == 0:
|
|
|
+ raise ProtocolException('The socket was closed.')
|
|
|
+ #
|
|
|
self._buffer += data
|
|
|
if len(self._buffer) == num_bytes:
|
|
|
return True
|
|
@@ -293,6 +297,10 @@ class PullDataProtocol(Protocol):
|
|
|
block_size = min(self.recv_buffer_len, bytes_remaining)
|
|
|
#
|
|
|
data = self.socket.recv(block_size)
|
|
|
+ #
|
|
|
+ if len(data) == 0:
|
|
|
+ raise ProtocolException('The socket was closed.')
|
|
|
+ #
|
|
|
self.bytes_read += len(data)
|
|
|
#
|
|
|
if self.bytes_read != 0 and self._time_of_first_byte is None:
|