Permalink
Browse files

Correcting ::Generator->_piece_count and adding ...->_set_piece_count

  • Loading branch information...
1 parent 848d438 commit 16bf4f6fdbcd02881fdbea32bc64601ebd0aaa5f @sanko committed Sep 17, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/Net/BitTorrent/Torrent/Generator.pm
@@ -86,6 +86,10 @@ package Net::BitTorrent::Torrent::Generator;
handles => {
_piece_count => sub {
my ($s, $v) = @_;
+ int ($s->total_size / $s->piece_length) + 1;
+ },
+ _set_piece_count => sub {
+ my ($s, $v) = @_;
$s->_set_piece_length(int($s->total_size / $v) + 1);
}
}

0 comments on commit 16bf4f6

Please sign in to comment.