the file pool has been moved to the session and its size can be controlled via session_settings. Added untested option to allow multiple connections from the same IP.

This commit is contained in:
Arvid Norberg
2006-11-14 15:53:38 +00:00
parent 247b8ae443
commit 51e3261dd0
16 changed files with 172 additions and 83 deletions

View File

@@ -1,6 +1,6 @@
/*
Copyright (c) 2003, Arvid Norberg
Copyright (c) 2006, Arvid Norberg
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/file.hpp"
#include "libtorrent/storage.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/file_pool.hpp"
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
@@ -94,7 +95,8 @@ int main(int argc, char* argv[])
add_files(t, full_path.branch_path(), full_path.leaf());
t.set_piece_size(piece_size);
storage st(t, full_path.branch_path());
file_pool fp;
storage st(t, full_path.branch_path(), fp);
t.add_tracker(argv[2]);
// calculate the hash for all pieces