optimized file_pool lookups and string handling

This commit is contained in:
Arvid Norberg
2010-08-23 08:48:02 +00:00
parent b747cdab8a
commit b7b542f587
8 changed files with 73 additions and 42 deletions

View File

@@ -52,7 +52,9 @@ struct peer_conn
: s(ios)
, read_pos(0)
, state(handshaking)
, pieces(num_pieces)
// don't request anything from the last piece
// to keep things simple
, pieces(num_pieces - 1)
, block(0)
, blocks_per_piece(blocks_pp)
, info_hash(ih)
@@ -248,6 +250,7 @@ int main(int argc, char const* argv[])
conns.push_back(new peer_conn(ios, ti.num_pieces(), ti.piece_length() / 16 / 1024
, ep, (char const*)&ti.info_hash()[0]));
libtorrent::sleep(1);
ios.poll_one();
}
ios.run();