land libtorrent_aio branch in trunk

This commit is contained in:
Arvid Norberg
2014-07-06 19:18:00 +00:00
parent 6ef1b98717
commit 7351389ce8
357 changed files with 58707 additions and 40644 deletions

View File

@@ -31,6 +31,7 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include <boost/make_shared.hpp>
#include "libtorrent/entry.hpp"
#include "libtorrent/bencode.hpp"
#include "libtorrent/session.hpp"
@@ -38,6 +39,7 @@ POSSIBILITY OF SUCH DAMAGE.
int main(int argc, char* argv[])
{
using namespace libtorrent;
namespace lt = libtorrent;
if (argc != 2)
{
@@ -46,9 +48,10 @@ int main(int argc, char* argv[])
return 1;
}
session s;
settings_pack sett;
sett.set_str(settings_pack::listen_interfaces, "0.0.0.0:6881");
lt::session s(sett);
error_code ec;
s.listen_on(std::make_pair(6881, 6889), ec);
if (ec)
{
fprintf(stderr, "failed to open listen socket: %s\n", ec.message().c_str());
@@ -56,7 +59,7 @@ int main(int argc, char* argv[])
}
add_torrent_params p;
p.save_path = "./";
p.ti = new torrent_info(argv[1], ec);
p.ti = boost::make_shared<torrent_info>(std::string(argv[1]), boost::ref(ec), 0);
if (ec)
{
fprintf(stderr, "%s\n", ec.message().c_str());