|
@@ -323,7 +323,11 @@ class PullDataProtocol(Protocol):
|
|
|
def calc_transfer_rate(self):
|
|
|
""" Returns bytes/s. """
|
|
|
assert self.data_size is not None and self.time_of_first_byte is not None and self.time_of_last_byte is not None
|
|
|
- return self.data_size/(self.time_of_last_byte-self.time_of_first_byte)
|
|
|
+ try:
|
|
|
+ return self.data_size/(self.time_of_last_byte-self.time_of_first_byte)
|
|
|
+ except ZeroDivisionError:
|
|
|
+ return float('nan')
|
|
|
+ #
|
|
|
#
|
|
|
#
|
|
|
class SendDataProtocol(Protocol):
|