What steps will reproduce the problem?
1. Create a new torrent using rutorrent/php/Torrent.php for a single file of
which the length is an exact multiple of the selected piece size.
What is the expected output? What do you see instead?
I expect all hash pieces to be hashes of some part of the data, instead there
is one extra piece which is the hash of nothing
(da39a3ee5e6b4b0d3255bfef95601890afd80709). In my testing, such a torrent file
was rejected by Transmission, qTorrent, Deluge, uTorrent, and BitTornado. It
appears to work, however, in rtorrent and Vuze.
What environment are you using?
Someone else generated the torrent file, and I don't know the details of their
environment.
Are some errors present in the web-server log?
Probably not.
Are some errors present in the browser error console?
Probably not.
Please provide any additional information below.
feof() only returns true after you have tried to read past the EOF (see
http://www.php.net/manual/en/function.feof.php#67261 ). One solution should be
to change lines 438-439 in
https://code.google.com/p/rutorrent/source/browse/trunk/rutorrent/php/Torrent.ph
p?r=2115 to something like (not tested):
while( $piece = fread( $handle, $piece_length ) )
$pieces .= self::pack( $piece ) );
The multiple file case looks like it works correctly already.
Original issue reported on code.google.com by ringoka...@yahoo.com on 15 Mar 2013 at 8:11
Original issue reported on code.google.com by
ringoka...@yahoo.com
on 15 Mar 2013 at 8:11