next-share: fix download/upload limit enable code
authorP2P-Next <p2p-next@cs.pub.ro>
Mon, 20 Sep 2010 09:44:09 +0000 (12:44 +0300)
committerP2P-Next <p2p-next@cs.pub.ro>
Mon, 20 Sep 2010 09:44:09 +0000 (12:44 +0300)
instrumentation/next-share/BaseLib/Tools/cmdlinedl.py

index a6b8cc6..e1f309e 100644 (file)
@@ -124,8 +124,10 @@ def main():
     # setup and start download
     dscfg = DownloadStartupConfig()
     dscfg.set_dest_dir(output_dir);
-    dscfg.set_max_speed(DOWNLOAD, download_limit)
-    dscfg.set_max_speed(UPLOAD, upload_limit)
+    if download_limit > 0:
+        dscfg.set_max_speed(DOWNLOAD, download_limit)
+    if upload_limit > 0:
+        dscfg.set_max_speed(UPLOAD, upload_limit)
 
     if torrentfile_or_url.startswith("http") or torrentfile_or_url.startswith(P2PURL_SCHEME):
         tdef = TorrentDef.load_from_url(torrentfile_or_url)