Author: andar
Revision: 5678
Log:
Fix piece size calculation
Diff:
Modified: trunk/deluge/maketorrent.py
===================================================================
--- trunk/deluge/maketorrent.py 2009-08-19 01:45:55 UTC (rev 5677)
+++ trunk/deluge/maketorrent.py 2009-08-19 02:14:29 UTC (rev 5678)
@@ -127,12 +127,10 @@
piece_size = piece_size * 1024
else:
# We need to calculate a piece size
- psize = 16384
- while (datasize / psize) > 1024 and psize < 8192 * 1024:
- psize *= 2
+ piece_size = 16384
+ while (datasize / piece_size) > 1024 and piece_size < (8192 *
1024):
+ piece_size *= 2
- piece_size = psize / 1024
-
# Calculate the number of pieces we will require for the data
num_pieces = datasize / piece_size
torrent["info"]["piece length"] = piece_size
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---