fixed problems introduced in previous debugging session
This commit is contained in:
parent
e4265d1a56
commit
fd3da79c6c
|
@ -403,16 +403,19 @@ namespace libtorrent
|
|||
assert(ph.offset == 0 || partial_copy.final() == partial.final());
|
||||
#endif
|
||||
int slot_size = piece_size - ph.offset;
|
||||
if (slot_size == 0)
|
||||
if (slot_size > 0)
|
||||
{
|
||||
assert(ph.h.final() == whole.final());
|
||||
return ph.h.final();
|
||||
m_scratch_buffer.resize(slot_size);
|
||||
read_impl(&m_scratch_buffer[0], slot, ph.offset, slot_size, true);
|
||||
ph.h.update(&m_scratch_buffer[0], slot_size);
|
||||
}
|
||||
m_scratch_buffer.resize(slot_size);
|
||||
read_impl(&m_scratch_buffer[0], slot, ph.offset, slot_size, true);
|
||||
ph.h.update(&m_scratch_buffer[0], slot_size);
|
||||
assert(whole.final() == ph.h.final());
|
||||
#ifndef NDEBUG
|
||||
sha1_hash ret = ph.h.final();
|
||||
assert(ret == whole.final());
|
||||
return ret;
|
||||
#else
|
||||
return ph.h.final();
|
||||
#endif
|
||||
}
|
||||
|
||||
void storage::initialize(bool allocate_files)
|
||||
|
|
Loading…
Reference in New Issue