forked from premiere/premiere-libtorrent
*** empty log message ***
This commit is contained in:
parent
87222ebf3f
commit
8d9e73cf76
|
@ -438,8 +438,8 @@ public:
|
|||
|
||||
torrent_info(const entry& torrent_file)
|
||||
|
||||
typedef std::vector>file>::const_iterator file_iterator;
|
||||
typedef std::vector<file>::const_reverse_iterator reverse_file_iterator;
|
||||
typedef std::vector>file_entry>::const_iterator file_iterator;
|
||||
typedef std::vector<file_entry>::const_reverse_iterator reverse_file_iterator;
|
||||
|
||||
file_iterator begin_files() const;
|
||||
file_iterator end_files() const;
|
||||
|
@ -447,14 +447,14 @@ public:
|
|||
reverse_file_iterator rend_files() const;
|
||||
|
||||
int num_files() const;
|
||||
const file& file_at(int index) const;
|
||||
const file_entry& file_at(int index) const;
|
||||
|
||||
const std::vector<announce_entry>& trackers() const;
|
||||
|
||||
int prioritize_tracker(int index);
|
||||
|
||||
entry::integer_type total_size() const;
|
||||
entry::integer_type piece_length() const;
|
||||
size_type total_size() const;
|
||||
size_type piece_length() const;
|
||||
int num_pieces() const;
|
||||
const sha1_hash& info_hash() const;
|
||||
const std::stirng& name() const;
|
||||
|
@ -464,7 +464,7 @@ public:
|
|||
|
||||
void print(std::ostream& os) const;
|
||||
|
||||
entry::integer_type piece_size(unsigned int index) const;
|
||||
size_type piece_size(unsigned int index) const;
|
||||
const sha1_hash& hash_for_piece(unsigned int index) const;
|
||||
};
|
||||
</pre>
|
||||
|
@ -477,7 +477,7 @@ struct file_entry
|
|||
{
|
||||
std::string path;
|
||||
std::string filename;
|
||||
entry::integer_type size;
|
||||
size_type size;
|
||||
};
|
||||
</pre>
|
||||
<p>If you need index-access to files you can use the <tt class="literal"><span class="pre">num_files()</span></tt> and <tt class="literal"><span class="pre">file_at()</span></tt>
|
||||
|
@ -588,7 +588,6 @@ struct torrent_status
|
|||
{
|
||||
enum state_t
|
||||
{
|
||||
invalid_handle,
|
||||
queued_for_checking,
|
||||
checking_files,
|
||||
connecting_to_tracker,
|
||||
|
|
|
@ -406,8 +406,8 @@ The ``torrent_info`` has the following synopsis::
|
|||
|
||||
torrent_info(const entry& torrent_file)
|
||||
|
||||
typedef std::vector>file>::const_iterator file_iterator;
|
||||
typedef std::vector<file>::const_reverse_iterator reverse_file_iterator;
|
||||
typedef std::vector>file_entry>::const_iterator file_iterator;
|
||||
typedef std::vector<file_entry>::const_reverse_iterator reverse_file_iterator;
|
||||
|
||||
file_iterator begin_files() const;
|
||||
file_iterator end_files() const;
|
||||
|
@ -415,14 +415,14 @@ The ``torrent_info`` has the following synopsis::
|
|||
reverse_file_iterator rend_files() const;
|
||||
|
||||
int num_files() const;
|
||||
const file& file_at(int index) const;
|
||||
const file_entry& file_at(int index) const;
|
||||
|
||||
const std::vector<announce_entry>& trackers() const;
|
||||
|
||||
int prioritize_tracker(int index);
|
||||
|
||||
entry::integer_type total_size() const;
|
||||
entry::integer_type piece_length() const;
|
||||
size_type total_size() const;
|
||||
size_type piece_length() const;
|
||||
int num_pieces() const;
|
||||
const sha1_hash& info_hash() const;
|
||||
const std::stirng& name() const;
|
||||
|
@ -432,7 +432,7 @@ The ``torrent_info`` has the following synopsis::
|
|||
|
||||
void print(std::ostream& os) const;
|
||||
|
||||
entry::integer_type piece_size(unsigned int index) const;
|
||||
size_type piece_size(unsigned int index) const;
|
||||
const sha1_hash& hash_for_piece(unsigned int index) const;
|
||||
};
|
||||
|
||||
|
@ -447,7 +447,7 @@ iterators with the type ``file_entry``.
|
|||
{
|
||||
std::string path;
|
||||
std::string filename;
|
||||
entry::integer_type size;
|
||||
size_type size;
|
||||
};
|
||||
|
||||
If you need index-access to files you can use the ``num_files()`` and ``file_at()``
|
||||
|
@ -586,7 +586,6 @@ It contains the following fields::
|
|||
{
|
||||
enum state_t
|
||||
{
|
||||
invalid_handle,
|
||||
queued_for_checking,
|
||||
checking_files,
|
||||
connecting_to_tracker,
|
||||
|
|
|
@ -564,6 +564,15 @@ namespace libtorrent
|
|||
r.start = detail::read_int32(ptr);
|
||||
r.length = detail::read_int32(ptr);
|
||||
|
||||
if (m_requests.size() > 40)
|
||||
{
|
||||
// don't allow clients to abuse our
|
||||
// memory consumption.
|
||||
// ignore requests if the client
|
||||
// is making too many of them.
|
||||
return;
|
||||
}
|
||||
|
||||
// make sure this request
|
||||
// is legal and taht the peer
|
||||
// is not choked
|
||||
|
|
Loading…
Reference in New Issue