prevent division by zero when computing filetransfer ETA. Fixes #4359

This commit is contained in:
Yann Leboulanger 2008-10-01 16:11:59 +00:00
parent 349f8bd276
commit 81c5b05943
1 changed files with 2 additions and 0 deletions

View File

@ -449,6 +449,8 @@ _('Connection with peer cannot be established.'))
last = file_props['transfered_size'][-1]
transfered = last[1] - first[1]
tim = last[0] - first[0]
if time == 0:
return 0., 0.
speed = round(float(transfered) / tim)
if speed == 0.:
return 0., 0.