Browse Source

Fixed possible division by 0

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
0ec6af03c0
  1. 2
      src/bittorrent.cpp

2
src/bittorrent.cpp

@ -84,11 +84,13 @@ void bittorrent::updateETAs(){
}else{ }else{
torrent_status torrentStatus = h.status(); torrent_status torrentStatus = h.status();
torrent_info ti = h.get_torrent_info(); torrent_info ti = h.get_torrent_info();
if(torrentStatus.download_payload_rate != 0){
listEtas << (long)((ti.total_size()-torrentStatus.total_done)/(double)torrentStatus.download_payload_rate); listEtas << (long)((ti.total_size()-torrentStatus.total_done)/(double)torrentStatus.download_payload_rate);
ETAstats[hash] = listEtas; ETAstats[hash] = listEtas;
} }
} }
} }
}
} }
long bittorrent::getETA(QString hash) const{ long bittorrent::getETA(QString hash) const{

Loading…
Cancel
Save