# - scons: Cross-platform build system http://www.scons.org/
# - googletest: Google C++ Test Framework http://code.google.com/p/googletest/
# * Install in ..\gtest-1.4.0
-# - OpenSSL: http://www.slproweb.com/products/Win32OpenSSL.html
-# * Install non-light Win32 binary in \openssl
-# * Using a openssl-0.9.8k tar-ball doesn't work as the includes there
-# are symbolic links which get turned into 0 length files by 7Zip.
#
import os
int file = p2tp::Open(filename,root_hash);
printf("Downloading %s\n",root_hash.hex().c_str());
- while (true) {//!p2tp::IsComplete(file)) {
+ tint start = NOW;
+
+ while (!p2tp::IsComplete(file) && NOW-start<TINT_SEC*60) {
p2tp::Loop(TINT_SEC);
eprintf("done %lli of %lli (seq %lli) %lli dgram %lli bytes up, %lli dgram %lli bytes down\n",
p2tp::Complete(file), p2tp::Size(file), p2tp::SeqComplete(file),
Datagram::dgrams_down, Datagram::bytes_down );
}
+ bool complete = p2tp::IsComplete(file);
+
p2tp::Close(file);
p2tp::Shutdown();
+ return !complete;
}