logo       

Re: On the logic of the file checking: msg#00041

network.bit-torrent.libtorrent

Subject: Re: On the logic of the file checking


On Apr 24, 2006, at 14:47, Arvid Norberg wrote:

On Apr 24, 2006, at 10:39, Echaozh Zhang wrote:
Hi everyone,

We've been so happy using libtorrent, having everything going smooth
and good, before we suddenly bumped into some strange problem.

Before we met the problem, we just download each file... then one day
the downloading is quite ok to us, so we try to seed the file. Seeding
is quite ok before we close the program and restart it. When we
restart the program with no resume data, the program crashes due to
the failure of an assertion.

// if we're not in compact mode, make sure the
// pieces are spread out and placed at their
// final position.
assert(!m_unallocated_slots.empty()); // Line 1401,
storage.cpp, version 0.9.1

The fix is quite simple.

just move the assert and the allocate_slot(1); right below the termination condition. Like this:

if (m_compact_mode)
{
m_state = state_finished;
return std::make_pair(true, 1.f);
}

if (m_unallocated_slots.empty())
{
m_state = state_finished;
return std::make_pair(true, 1.f);
}

// if we're not in compact mode, make sure the
// pieces are spread out and placed at their
// final position.
assert(!m_unallocated_slots.empty());
allocate_slots(1);

I will check this into the development branch on the cvs, so it will be in the next release.


--
Arvid Norberg




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise