fixed documentation and client_test code when waiting for resume_data_alert

This commit is contained in:
Arvid Norberg 2008-11-18 10:30:57 +00:00
parent 70119a6b53
commit 1c1ba2b383
2 changed files with 14 additions and 0 deletions

View File

@ -2224,6 +2224,14 @@ Example code to pause and save resume data for all torrents and wait for the ale
if (a == 0) break; if (a == 0) break;
std::auto_ptr<alert> holder = ses.pop_alert(); std::auto_ptr<alert> holder = ses.pop_alert();
if (dynamic_cast<save_resume_data_failed_alert const*>(a))
{
process_alert(a);
--num_resume_data;
continue;
}
save_resume_data_alert const* rd = dynamic_cast<save_resume_data_alert const*>(a); save_resume_data_alert const* rd = dynamic_cast<save_resume_data_alert const*>(a);
if (rd == 0) if (rd == 0)
{ {

View File

@ -1142,6 +1142,12 @@ int main(int ac, char* av[])
::print_alert(holder.get(), std::cout); ::print_alert(holder.get(), std::cout);
std::cout << std::endl; std::cout << std::endl;
if (dynamic_cast<save_resume_data_failed_alert const*>(a))
{
--num_resume_data;
continue;
}
save_resume_data_alert const* rd = dynamic_cast<save_resume_data_alert const*>(a); save_resume_data_alert const* rd = dynamic_cast<save_resume_data_alert const*>(a);
if (!rd) continue; if (!rd) continue;
--num_resume_data; --num_resume_data;