Merge bitfield fix from r1548 to the trunk.
This commit is contained in:
parent
df6877d104
commit
67bfe9af61
|
@ -128,6 +128,7 @@ static void fastResumeSave( tr_io_t * io )
|
||||||
uint8_t * buf;
|
uint8_t * buf;
|
||||||
uint64_t total;
|
uint64_t total;
|
||||||
int size;
|
int size;
|
||||||
|
tr_bitfield_t * bitfield;
|
||||||
|
|
||||||
buf = malloc( FR_PROGRESS_LEN( tor ) );
|
buf = malloc( FR_PROGRESS_LEN( tor ) );
|
||||||
|
|
||||||
|
@ -152,8 +153,9 @@ static void fastResumeSave( tr_io_t * io )
|
||||||
fwrite( &version, 4, 1, file );
|
fwrite( &version, 4, 1, file );
|
||||||
|
|
||||||
/* Build and copy the bitfield for blocks */
|
/* Build and copy the bitfield for blocks */
|
||||||
memcpy(buf + FR_MTIME_LEN( tor ), tr_cpBlockBitfield( tor->completion ),
|
bitfield = tr_cpBlockBitfield( tor->completion );
|
||||||
FR_BLOCK_BITFIELD_LEN( tor ) );
|
assert( FR_BLOCK_BITFIELD_LEN( tor ) == bitfield->len );
|
||||||
|
memcpy(buf + FR_MTIME_LEN( tor ), bitfield->bits, bitfield->len );
|
||||||
|
|
||||||
/* Copy the 'slotPiece' table */
|
/* Copy the 'slotPiece' table */
|
||||||
memcpy(buf + FR_MTIME_LEN( tor ) + FR_BLOCK_BITFIELD_LEN( tor ),
|
memcpy(buf + FR_MTIME_LEN( tor ) + FR_BLOCK_BITFIELD_LEN( tor ),
|
||||||
|
|
Loading…
Reference in New Issue