From 1c1ba2b38304c99b99ead4fc0b5e1fa8777b55b2 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 18 Nov 2008 10:30:57 +0000 Subject: [PATCH] fixed documentation and client_test code when waiting for resume_data_alert --- docs/manual.rst | 8 ++++++++ examples/client_test.cpp | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/docs/manual.rst b/docs/manual.rst index e8b472403..22f31b4fc 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -2224,6 +2224,14 @@ Example code to pause and save resume data for all torrents and wait for the ale if (a == 0) break; std::auto_ptr holder = ses.pop_alert(); + + if (dynamic_cast(a)) + { + process_alert(a); + --num_resume_data; + continue; + } + save_resume_data_alert const* rd = dynamic_cast(a); if (rd == 0) { diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 6d78d457f..aade3c33e 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -1142,6 +1142,12 @@ int main(int ac, char* av[]) ::print_alert(holder.get(), std::cout); std::cout << std::endl; + if (dynamic_cast(a)) + { + --num_resume_data; + continue; + } + save_resume_data_alert const* rd = dynamic_cast(a); if (!rd) continue; --num_resume_data;