Skip to content

Commit

Permalink
- Fixed a ratio assert in libtorrent because we sent it -1 for unlimi…
Browse files Browse the repository at this point in the history
…ted instead of 0
  • Loading branch information
Christophe Dumez committed Sep 16, 2007
1 parent 9cdcd53 commit 9062266
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
- Wait that http:https://pastebin.ca/690649 is fixed

LANGUAGES UPDATED:
- French *BETA7*
- English *BETA6*
- French *OK*
- English *OK*
- Japanese *BETA6*
- Swedish *BETA6*
- Slovak *BETA6*
Expand Down
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ public:
QString shortname() const { return "Qt 4.3"; }
bool exec()
{
qWarning("QT VERSION: %s", QT_VERSION);
return(QT_VERSION >= 0x040300);
}
};
Expand Down
4 changes: 4 additions & 0 deletions src/bittorrent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,10 @@ void bittorrent::setUploadRateLimit(long rate) {
// This function will apply to same ratio to all torrents
void bittorrent::setGlobalRatio(float ratio) {
if(ratio != -1 && ratio < 1.) ratio = 1.;
if(ratio == -1) {
// 0 means unlimited for libtorrent
ratio = 0;
}
std::vector<torrent_handle> handles = s->get_torrents();
unsigned int nbHandles = handles.size();
for(unsigned int i=0; i<nbHandles; ++i) {
Expand Down

0 comments on commit 9062266

Please sign in to comment.