merged RC_1_1 into master

This commit is contained in:
arvidn 2017-06-21 00:50:14 -04:00
commit f85c01cc0a
35 changed files with 62980 additions and 115 deletions

View File

@ -64,7 +64,7 @@ before_install:
echo ''import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")'' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth;
easy_install --user Pygments;
easy_install --user aafigure;
travis_retry brew install graphviz;
travis_retry brew install graphviz hunspell;
easy_install --user Pillow;
fi'
@ -134,7 +134,7 @@ script:
- cd docs
- 'if [ "$docs" == "1" ]; then
make RST2HTML=/Users/travis/Library/Python/2.7/bin/rst2html.py AAFIGURE=echo;
make spell-check RST2HTML=/Users/travis/Library/Python/2.7/bin/rst2html.py AAFIGURE=echo;
fi'
- cd ..

View File

@ -74,6 +74,8 @@
* require C++11 to build libtorrent
* fix re-check issue after move_storage
* handle invalid arguments to set_piece_deadline()
* move_storage did not work for torrents without metadata
* improve shutdown time by only announcing to trackers whose IP we know
* fix python3 portability issue in python binding

View File

@ -66,7 +66,7 @@ are mandatory. However, RSS items will be used as examples in this BEP::
+---------+
The ``next`` pointer is at least 20 byte ID in the DHT key space pointing to where the next
item in the list is announced. The list is terminated with an ID of all zeroes.
item in the list is announced. The list is terminated with an ID of all zeros.
The ID an items is announced to is determined by the SHA1 hash of the bencoded representation
of the item iteself. This contains all fields in the item, except the signature.

View File

@ -7,6 +7,10 @@ import sys
verbose = '--verbose' in sys.argv
dump = '--dump' in sys.argv
internal = '--internal' in sys.argv
plain_output = '--plain-output' in sys.argv
if plain_output:
plain_file = open('plain_text_out.txt', 'w+')
in_code = None
paths = ['include/libtorrent/*.hpp', 'include/libtorrent/kademlia/*.hpp', 'include/libtorrent/extensions/*.hpp']
@ -329,6 +333,24 @@ def parse_class(lno, lines, filename):
if l.startswith('//'):
if verbose: print 'desc %s' % l
# plain output prints just descriptions and filters out c++ code.
# it's used to run spell checker over
if plain_output:
line = l.split('//')[1]
# if the first character is a space, strip it
if len(line) > 0 and line[0] == ' ': line = line[1:]
global in_code
if in_code != None and not line.startswith(in_code) and len(line) > 1:
in_code = None
if line.strip().startswith('.. code::'):
in_code = line.split('.. code::')[0] + '\t'
# strip out C++ code from the plain text output since it's meant for
# running spell checking over
if not line.strip().startswith('.. ') and in_code == None:
plain_file.write(line + '\n')
l = l[2:]
if len(l) and l[0] == ' ': l = l[1:]
context += l + '\n'

466
docs/hunspell/en_US.aff Normal file
View File

@ -0,0 +1,466 @@
SET ISO8859-1
KEY qwertyuiop|asdfghjkl|zxcvbnm
TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ'-
NOSUGGEST !
# ordinal numbers (1st, 2nd, 3th, 11th) and decads (0s, 10s, 1990s)
COMPOUNDMIN 1
# only in compounds: 1th, 2th, 3th
ONLYINCOMPOUND c
# compound rules:
# 1. [0-9]*1[0-9]th (10th, 11th, 12th, 56714th, etc.)
# 2. [0-9]*[02-9](1st|2nd|3rd|[4-9]th) (21st, 22nd, 123rd, 1234th, etc.)
COMPOUNDRULE 2
COMPOUNDRULE n*1t
COMPOUNDRULE n*mp
WORDCHARS 0123456789'
PFX A Y 1
PFX A 0 re .
PFX I Y 1
PFX I 0 in .
PFX U Y 1
PFX U 0 un .
PFX C Y 1
PFX C 0 de .
PFX E Y 1
PFX E 0 dis .
PFX F Y 1
PFX F 0 con .
PFX K Y 1
PFX K 0 pro .
SFX V N 2
SFX V e ive e
SFX V 0 ive [^e]
SFX N Y 3
SFX N e ion e
SFX N y ication y
SFX N 0 en [^ey]
SFX X Y 3
SFX X e ions e
SFX X y ications y
SFX X 0 ens [^ey]
SFX H N 2
SFX H y ieth y
SFX H 0 th [^y]
SFX Y Y 1
SFX Y 0 ly .
SFX G Y 2
SFX G e ing e
SFX G 0 ing [^e]
SFX J Y 2
SFX J e ings e
SFX J 0 ings [^e]
SFX D Y 4
SFX D 0 d e
SFX D y ied [^aeiou]y
SFX D 0 ed [^ey]
SFX D 0 ed [aeiou]y
SFX T N 4
SFX T 0 st e
SFX T y iest [^aeiou]y
SFX T 0 est [aeiou]y
SFX T 0 est [^ey]
SFX R Y 4
SFX R 0 r e
SFX R y ier [^aeiou]y
SFX R 0 er [aeiou]y
SFX R 0 er [^ey]
SFX Z Y 4
SFX Z 0 rs e
SFX Z y iers [^aeiou]y
SFX Z 0 ers [aeiou]y
SFX Z 0 ers [^ey]
SFX S Y 4
SFX S y ies [^aeiou]y
SFX S 0 s [aeiou]y
SFX S 0 es [sxzh]
SFX S 0 s [^sxzhy]
SFX P Y 3
SFX P y iness [^aeiou]y
SFX P 0 ness [aeiou]y
SFX P 0 ness [^y]
SFX M Y 1
SFX M 0 's .
SFX B Y 3
SFX B 0 able [^aeiou]
SFX B 0 able ee
SFX B e able [^aeiou]e
SFX L Y 1
SFX L 0 ment .
REP 97
REP nt n't
REP alot a_lot
REP avengence a_vengeance
REP ninties 1990s
REP teached taught
REP rised rose
REP a ei
REP ei a
REP a ey
REP ey a
REP ai ie
REP ie ai
REP are air
REP are ear
REP are eir
REP air are
REP air ere
REP ere air
REP ere ear
REP ere eir
REP ear are
REP ear air
REP ear ere
REP eir are
REP eir ere
REP ch te
REP te ch
REP ch ti
REP ti ch
REP ch tu
REP tu ch
REP ch s
REP s ch
REP ch k
REP k ch
REP f ph
REP ph f
REP gh f
REP f gh
REP i igh
REP igh i
REP i uy
REP uy i
REP i ee
REP ee i
REP j di
REP di j
REP j gg
REP gg j
REP j ge
REP ge j
REP s ti
REP ti s
REP s ci
REP ci s
REP k cc
REP cc k
REP k qu
REP qu k
REP kw qu
REP o eau
REP eau o
REP o ew
REP ew o
REP oo ew
REP ew oo
REP ew ui
REP ui ew
REP oo ui
REP ui oo
REP ew u
REP u ew
REP oo u
REP u oo
REP u oe
REP oe u
REP u ieu
REP ieu u
REP ue ew
REP ew ue
REP uff ough
REP oo ieu
REP ieu oo
REP ier ear
REP ear ier
REP ear air
REP air ear
REP w qu
REP qu w
REP z ss
REP ss z
REP shun tion
REP shun sion
REP shun cion
REP tion ssion
REP ys ies
REP u ough
# PHONEtic_english.h - #PHONEtic transformation rules for use with #PHONEtic.c
# Copyright (C) 2000 Björn Jacke
#
# This rule set is based on Lawrence Phillips original metaPHONE
# algorithm with modifications made by Michael Kuhn in his
# C implantation, more modifications by Björn Jacke when
# converting the algorithm to a rule set and minor
# touch ups by Kevin Atkinson
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation;
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Björn Jacke may be reached by email at bjoern.jacke@gmx.de
#
# Changelog:
#
# 2000-01-05 Björn Jacke <bjoern.jacke@gmx.de>
# - first version with translation rules derived from
# metaPHONE.cc distributed with aspell 0.28.3
# - "TH" is now representated as "@" because "0" is a
# meta character
# - removed TH(!vowel) --> T; always use TH --> # instead
# - dropped "^AE" -> "E" (redundant)
# - "ing" is transformed to "N", not "NK"
# - "SCH(EO)" transforms to "SK" now
# - added R --> SILENT if (after a vowel) and no (vowel or
# "y" follows) like in "Marcy" or "abort"
# - H is SILENT in RH at beginning of words
# - H is SILENT if vowel leads and "Y" follows
# - some ".OUGH.." --> ...F exceptions added
# - "^V" transforms to "W"
# 2000-01-07 Kevin Atkinson <kevinatk@home.com>
# Converted from header to data file.
#
# 2007-08-23 László Németh <nemeth AT OOo>
# Add PHONE header and #PHONE keywords
#
# version 1.1
# Documentation: http://aspell.net/man-html/PHONEtic-Code.html
PHONE 105
PHONE AH(AEIOUY)-^ *H
PHONE AR(AEIOUY)-^ *R
PHONE A(HR)^ *
PHONE A^ *
PHONE AH(AEIOUY)- H
PHONE AR(AEIOUY)- R
PHONE A(HR) _
PHONE BB- _
PHONE B B
PHONE CQ- _
PHONE CIA X
PHONE CH X
PHONE C(EIY)- S
PHONE CK K
PHONE COUGH^ KF
PHONE CC< C
PHONE C K
PHONE DG(EIY) K
PHONE DD- _
PHONE D T
PHONE É< E
PHONE EH(AEIOUY)-^ *H
PHONE ER(AEIOUY)-^ *R
PHONE E(HR)^ *
PHONE ENOUGH^$ *NF
PHONE E^ *
PHONE EH(AEIOUY)- H
PHONE ER(AEIOUY)- R
PHONE E(HR) _
PHONE FF- _
PHONE F F
PHONE GN^ N
PHONE GN$ N
PHONE GNS$ NS
PHONE GNED$ N
PHONE GH(AEIOUY)- K
PHONE GH _
PHONE GG9 K
PHONE G K
PHONE H H
PHONE IH(AEIOUY)-^ *H
PHONE IR(AEIOUY)-^ *R
PHONE I(HR)^ *
PHONE I^ *
PHONE ING6 N
PHONE IH(AEIOUY)- H
PHONE IR(AEIOUY)- R
PHONE I(HR) _
PHONE J K
PHONE KN^ N
PHONE KK- _
PHONE K K
PHONE LAUGH^ LF
PHONE LL- _
PHONE L L
PHONE MB$ M
PHONE MM M
PHONE M M
PHONE NN- _
PHONE N N
PHONE OH(AEIOUY)-^ *H
PHONE OR(AEIOUY)-^ *R
PHONE O(HR)^ *
PHONE O^ *
PHONE OH(AEIOUY)- H
PHONE OR(AEIOUY)- R
PHONE O(HR) _
PHONE PH F
PHONE PN^ N
PHONE PP- _
PHONE P P
PHONE Q K
PHONE RH^ R
PHONE ROUGH^ RF
PHONE RR- _
PHONE R R
PHONE SCH(EOU)- SK
PHONE SC(IEY)- S
PHONE SH X
PHONE SI(AO)- X
PHONE SS- _
PHONE S S
PHONE TI(AO)- X
PHONE TH @
PHONE TCH-- _
PHONE TOUGH^ TF
PHONE TT- _
PHONE T T
PHONE UH(AEIOUY)-^ *H
PHONE UR(AEIOUY)-^ *R
PHONE U(HR)^ *
PHONE U^ *
PHONE UH(AEIOUY)- H
PHONE UR(AEIOUY)- R
PHONE U(HR) _
PHONE V^ W
PHONE V F
PHONE WR^ R
PHONE WH^ W
PHONE W(AEIOU)- W
PHONE X^ S
PHONE X KS
PHONE Y(AEIOU)- Y
PHONE ZZ- _
PHONE Z S
#The rules in a different view:
#
# Exceptions:
#
# Beginning of word: "gn", "kn-", "pn-", "wr-" ----> drop first letter
# "Aebersold", "Gnagy", "Knuth", "Pniewski", "Wright"
#
# Beginning of word: "x" ----> change to "s"
# as in "Deng Xiaopeng"
#
# Beginning of word: "wh-" ----> change to "w"
# as in "Whalen"
# Beginning of word: leading vowels are transformed to "*"
#
# "[crt]ough" and "enough" are handled separately because of "F" sound
#
#
# A --> A at beginning
# _ otherwise
#
# B --> B unless at the end of word after "m", as in "dumb", "McComb"
#
# C --> X (sh) if "-cia-" or "-ch-"
# S if "-ci-", "-ce-", or "-cy-"
# SILENT if "-sci-", "-sce-", or "-scy-", or "-cq-"
# K otherwise, including in "-sch-"
#
# D --> K if in "-dge-", "-dgy-", or "-dgi-"
# T otherwise
#
# E --> A at beginnig
# _ SILENT otherwise
#
# F --> F
#
# G --> SILENT if in "-gh-" and not at end or before a vowel
# in "-gn" or "-gned" or "-gns"
# in "-dge-" etc., as in above rule
# K if before "i", or "e", or "y" if not double "gg"
#
# K otherwise (incl. "GG"!)
#
# H --> SILENT if after vowel and no vowel or "Y" follows
# or after "-ch-", "-sh-", "-ph-", "-th-", "-gh-"
# or after "rh-" at beginning
# H otherwise
#
# I --> A at beginning
# _ SILENT otherwise
#
# J --> K
#
# K --> SILENT if after "c"
# K otherwise
#
# L --> L
#
# M --> M
#
# N --> N
#
# O --> A at beginning
# _ SILENT otherwise
#
# P --> F if before "h"
# P otherwise
#
# Q --> K
#
# R --> SILENT if after vowel and no vowel or "Y" follows
# R otherwise
#
# S --> X (sh) if before "h" or in "-sio-" or "-sia-"
# SK if followed by "ch(eo)" (SCH(EO))
# S otherwise
#
# T --> X (sh) if "-tia-" or "-tio-"
# 0 (th) if before "h"
# silent if in "-tch-"
# T otherwise
#
# U --> A at beginning
# _ SILENT otherwise
#
# V --> V if first letter of word
# F otherwise
#
# W --> SILENT if not followed by a vowel
# W if followed by a vowel
#
# X --> KS
#
# Y --> SILENT if not followed by a vowel
# Y if followed by a vowel
#
# Z --> S

62155
docs/hunspell/en_US.dic Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,203 @@
'
's
libtorrent
API
APIs
ABI
SHA-1
ed25519
const
BEP
bdecode
bdecoded
bencode
bencoding
bencoded
int64
uint64
enum
enums
struct
structs
bool
realloc
merkle
hpp
bittyrant
bittorrent
bitmask
bitmasks
SSL
asio
uTP
TCP
UDP
IP
IPv4
IPv6
QoS
TOS
unchoke
unchoked
dict
kiB
MiB
DHT
adler32
LRU
UPnP
NAT
PMP
Arvid
Norberg
RTT
internet
TODO
UNC
plugin
plugins
symlink
symlinks
CRC32
UTF
bitfield
RSS
socks5
socks4
metadata
posix
downloaders
bitset
kB
hostname
indices
dht
noseed
BFpe
BFsd
i2p
async
uTorrent
pred
sha1
pread
preadv
pwrite
pwritev
ftruncate
iovec
uint8
addr
iov
reannounce
PEM
pem
dh_params
outform
pex
trackerless
sig
ip
HTTP
URL
URLs
username
auth
idx
num
passphrase
UUID
UUIDs
uuid
performant
preformatted
SHA
buf
bufs
sizeof
params
ptr
msvc
mutex
eventfd
uint32
HWND
IPs
CIDR
kademlia
userdata
dont
OR
ORed
Diffie
OpenSSL
openssl
libtorrent's
filesystem
url
fs
io
ssl
errc
dh
dhparam
dhparams
0x01
0x02
0x04
0x08
http
failcount
superseeding
foo
baz
JSON
HTTPS
v4
v6
upnp
x509
process'
crc32
mtime
fallback
accessor
utf
str
bw
trackerid
timestamp
prioritisation
filehash
len
partfile
prepended
vec
dir
ut
ih
ec
cb
cid
mj
prio
src
'put'
'mtime'
'fingerprints'
'query'
'ro'
GCC
prioritization
nullptr
nothrow
precompute
recomputation
RPC
unchoking
ep
nid
crypto
uri
infohashes
rw

View File

@ -96,8 +96,12 @@ ifneq ($(STAGE),)
cp $@ $(WEB_PATH)/$@
endif
$(REFERENCE_TARGETS:=.rst):gen_reference_doc.py ../include/libtorrent/*.hpp ../include/libtorrent/kademlia/*.hpp manual.rst settings.rst stats_counters.rst
python gen_reference_doc.py
$(REFERENCE_TARGETS:=.rst) plain_text_out.txt:gen_reference_doc.py ../include/libtorrent/*.hpp ../include/libtorrent/kademlia/*.hpp manual.rst settings.rst stats_counters.rst
python gen_reference_doc.py --plain-output
spell-check:plain_text_out.txt
hunspell -d hunspell/en_US -p hunspell/libtorrent.dic -l plain_text_out.txt >hunspell-report.txt
@if [ -s hunspell-report.txt ]; then echo 'spellcheck failed, fix words or add to dictionary:'; cat hunspell-report.txt; false; fi;
%.epub:%.rst
rst2epub --exit-status=2 $? $@

View File

@ -62,7 +62,7 @@ how to find out about it and what to do about it.
Make sure to keep track of the paused state, the error state and the upload
mode of your torrents. By default, torrents are auto-managed, which means
libtorrent will pause them, unpause them, scrape them and take them out
libtorrent will pause, resume, scrape them and take them out
of upload-mode automatically.
Whenever a torrent encounters a fatal error, it will be stopped, and the
@ -315,7 +315,7 @@ It limits the number of started seeds to settings_pack::active_seeds.
On top of this basic bias, *seed priority* can be controller by specifying a
seed ratio (the upload to download ratio), a seed-time ratio (the download
time to seeding time ratio) and a seed-time (the abosulte time to be seeding a
time to seeding time ratio) and a seed-time (the absolute time to be seeding a
torrent). Until all those targets are hit, the torrent will be prioritized for
seeding.
@ -350,7 +350,7 @@ anything. If peers are allowed, torrents may:
2. announce to the DHT
3. announce to local peer discovery (local service discovery)
Each of those actions are associated with a cost and hence may need a seprarate
Each of those actions are associated with a cost and hence may need a separate
limit. These limits are controlled by settings_pack::active_tracker_limit,
settings_pack::active_dht_limit and settings_pack::active_lsd_limit
respectively.
@ -564,7 +564,7 @@ It will of course still check for existing pieces and fast resume data. The main
drawbacks of this mode are:
* It may take longer to start the torrent, since it will need to fill the files
with zeroes. This delay is linear to the size of the download.
with zeros. This delay is linear to the size of the download.
* The download may occupy unnecessary disk space between download sessions.
@ -765,7 +765,9 @@ rate limits.
When the rate limits are adjusted for a specific torrent, a class is created
implicitly for that torrent.
The default peer class IDs are defined as enums in the ``session`` class::
The default peer class IDs are defined as enums in the ``session`` class:
.. code:: c++
enum {
global_peer_class_id,

View File

@ -1592,7 +1592,7 @@ CLIENT OPTIONS
[q] quit client [m] add magnet link
TORRENT ACTIONS
[p] pause/unpause selected torrent [C] toggle disk cache
[p] pause/resume selected torrent [C] toggle disk cache
[s] toggle sequential download [j] force recheck
[space] toggle session pause [c] clear error
[v] scrape [D] delete torrent and data

View File

@ -308,7 +308,7 @@ namespace libtorrent {
// paths. This means they must use backslashes as directory separators
// and may not contain the special directories "." or "..".
//
// Setting this to an absolute path is slightly more performant than a
// Setting this to an absolute path performs slightly better than a
// relative path.
std::string save_path;
@ -366,7 +366,7 @@ namespace libtorrent {
// set this to the info hash of the torrent to add in case the info-hash
// is the only known property of the torrent. i.e. you don't have a
// .torrent file nor a magnet link.
// To add a magnet link, use parse_magnet_uri() to populatefields in the
// To add a magnet link, use parse_magnet_uri() to populate fields in the
// add_torrent_params object.
sha1_hash info_hash;

View File

@ -545,7 +545,7 @@ namespace libtorrent {
virtual std::string message() const override;
// tells how many peers the tracker returned in this response. This is
// not expected to be more thant the ``num_want`` settings. These are not necessarily
// not expected to be greater than the ``num_want`` settings. These are not necessarily
// all new peers, some of them may already be connected.
int const num_peers;
};
@ -748,7 +748,7 @@ namespace libtorrent {
bool const peer_interested;
// if this is true, the peer is not allowed to download this piece because
// of superseeding rules.
// of super-seeding rules.
bool const withheld;
};
@ -1298,11 +1298,11 @@ namespace libtorrent {
libtorrent::socket_type_t const socket_type;
// the address libtorrent attempted to listen on
// see alert's documentation for validity of this value
// see alert documentation for validity of this value
aux::noexcept_movable<libtorrent::address> address;
// the port libtorrent attempted to listen on
// see alert's documentation for validity of this value
// see alert documentation for validity of this value
int const port;
private:
@ -2032,7 +2032,7 @@ namespace libtorrent {
virtual std::string message() const override;
// the target hash of the immutable item. This must
// match the sha-1 hash of the bencoded form of ``item``.
// match the SHA-1 hash of the bencoded form of ``item``.
sha1_hash target;
// the data for this item
@ -2635,7 +2635,7 @@ namespace libtorrent {
time_duration const interval;
// This field indicates how many infohash keys are currently in the node's storage.
// This field indicates how many info-hash keys are currently in the node's storage.
// If the value is larger than the number of returned samples it indicates that the
// indexer may obtain additional samples after waiting out the interval.
int const num_infohashes;
@ -2648,8 +2648,9 @@ namespace libtorrent {
// This is the set of more DHT nodes returned by the request.
//
// The information is included so that indexing nodes can perform a keyspace
// traversal with a single RPC per node by adjusting the target value for each RPC.
// The information is included so that indexing nodes can perform a key
// space traversal with a single RPC per node by adjusting the target
// value for each RPC.
std::vector<std::pair<sha1_hash, udp::endpoint>> nodes() const;
private:

View File

@ -348,7 +348,7 @@ struct TORRENT_EXPORT bdecode_node
// Swap contents.
void swap(bdecode_node& n);
// pre-allocate memory for the specified numbers of tokens. This is
// preallocate memory for the specified numbers of tokens. This is
// useful if you know approximately how many tokens are in the file
// you are about to parse. Doing so will save realloc operations
// while parsing. You should only call this on the root node, before

View File

@ -112,7 +112,7 @@ namespace aux {
partial_hash(): offset(0) {}
// the number of bytes in the piece that has been hashed
int offset;
// the sha-1 context
// the SHA-1 context
hasher h;
};

View File

@ -136,10 +136,10 @@ namespace libtorrent {
symlinks = 8,
// to create a torrent that can be updated via a *mutable torrent*
// (see BEP38_). This also needs to be enabled for torrents that update
// (see `BEP 38`_). This also needs to be enabled for torrents that update
// another torrent.
//
// .. _BEP38: http://www.bittorrent.org/beps/bep_0038.html
// .. _`BEP 38`: http://www.bittorrent.org/beps/bep_0038.html
mutable_torrent_support = 16
};
@ -151,7 +151,7 @@ namespace libtorrent {
// the specified number of bytes will be preceded by a pad file to align it
// with the start of a piece. The pad_file_limit is ignored unless the
// ``optimize_alignment`` flag is passed. Typically it doesn't make sense
// to set this any lower than 4kiB.
// to set this any lower than 4 kiB.
//
// The overload that takes a ``torrent_info`` object will make a verbatim
// copy of its info dictionary (to preserve the info-hash). The copy of
@ -300,7 +300,7 @@ namespace libtorrent {
// the info dictionary
entry m_info_dict;
// the urls to the trackers
// the URLs to the trackers
std::vector<std::pair<std::string, int>> m_urls;
std::vector<std::string> m_url_seeds;
@ -344,7 +344,7 @@ namespace libtorrent {
// this is used when creating a torrent. If there's
// only one file there are cases where it's impossible
// to know if it should be written as a multifile torrent
// to know if it should be written as a multi-file torrent
// or not. e.g. test/test there's one file and one directory
// and they have the same name.
bool m_multifile:1;

View File

@ -311,12 +311,12 @@ namespace libtorrent {
// easy for plugins to do timed events, for sending messages or whatever.
virtual void tick() {}
// These hooks are called when the torrent is paused and unpaused respectively.
// These hooks are called when the torrent is paused and resumed respectively.
// The return value indicates if the event was handled. A return value of
// ``true`` indicates that it was handled, and no other plugin after this one
// will have this hook function called, and the standard handler will also not be
// invoked. So, returning true effectively overrides the standard behavior of
// pause or unpause.
// pause or resume.
//
// Note that if you call ``pause()`` or ``resume()`` on the torrent from your
// handler it will recurse back into your handler, so in order to invoke the
@ -390,10 +390,10 @@ namespace libtorrent {
// throwing an exception from any of the handlers (except add_handshake)
// closes the connection
// this is called when the initial BT handshake is received. Returning false
// means that the other end doesn't support this extension and will remove
// it from the list of plugins.
// this is not called for web seeds
// this is called when the initial bittorrent handshake is received.
// Returning false means that the other end doesn't support this extension
// and will remove it from the list of plugins. this is not called for web
// seeds
virtual bool on_handshake(span<char const> /*reserved_bits*/) { return true; }
// called when the extension handshake from the other end is received
@ -489,7 +489,7 @@ namespace libtorrent {
// are now ready to be sent to the lower layer. This must be at least
// as large as the number of bytes passed in and may be larger if there
// is additional data to be inserted at the head of the send buffer.
// The additional data is returned as the second tupled value. Any
// The additional data is returned as the second tuple value. Any
// returned buffer as well as the iovec itself, to be prepended to the
// send buffer, must be owned by the crypto plugin and guaranteed to stay
// alive until the crypto_plugin is destructed or this function is called

View File

@ -115,7 +115,7 @@ namespace libtorrent {
};
// maps storage pointer, file index pairs to the
// lru entry for the file
// LRU entry for the file
std::map<std::pair<storage_index_t, file_index_t>, lru_file_entry> m_files;
#if TORRENT_USE_ASSERTS
std::vector<std::pair<std::string, void const*>> m_deleted_storages;

View File

@ -81,7 +81,7 @@ namespace libtorrent {
// the modification time of this file specified in posix time.
std::time_t mtime;
// a sha-1 hash of the content of the file, or zeroes, if no
// a SHA-1 hash of the content of the file, or zeros, if no
// file hash was present in the torrent file. It can be used to potentially
// find alternative sources for the file.
sha1_hash filehash;
@ -217,7 +217,7 @@ namespace libtorrent {
// file attribute flags
enum flags_t
{
// the file is a pad file. It's required to contain zeroes
// the file is a pad file. It's required to contain zeros
// at it will not be saved to disk. Its purpose is to make
// the following file start on a piece boundary.
pad_file = 1,
@ -322,7 +322,7 @@ namespace libtorrent {
// returns a peer_request representing the piece index, byte offset
// and size the specified file range overlaps. This is the inverse
// mapping ove map_block(). Note that the ``peer_request`` return type
// mapping over map_block(). Note that the ``peer_request`` return type
// is meant to hold bittorrent block requests, which may not be larger
// than 16 kiB. Mapping a range larger than that may return an overflown
// integer.
@ -394,7 +394,7 @@ namespace libtorrent {
{ return piece_index_t(m_num_pieces - 1); }
// set and get the size of each piece in this torrent. This size is typically an even power
// of 2. It doesn't have to be though. It should be divisible by 16kiB however.
// of 2. It doesn't have to be though. It should be divisible by 16 kiB however.
void set_piece_length(int l) { m_piece_length = l; }
int piece_length() const { TORRENT_ASSERT(m_piece_length > 0); return m_piece_length; }
@ -437,7 +437,7 @@ namespace libtorrent {
// These functions are used to query attributes of files at
// a given index.
//
// The ``hash()`` is a sha-1 hash of the file, or 0 if none was
// The ``hash()`` is a SHA-1 hash of the file, or 0 if none was
// provided in the torrent file. This can potentially be used to
// join a bittorrent network with other file sharing networks.
//
@ -485,7 +485,7 @@ namespace libtorrent {
{
// this file is a pad file. The creator of the
// torrent promises the file is entirely filled with
// zeroes and does not need to be downloaded. The
// zeros and does not need to be downloaded. The
// purpose is just to align the next file to either
// a block or piece boundary.
flag_pad_file = 1,

View File

@ -204,18 +204,18 @@ namespace libtorrent { namespace dht {
, span<char const> salt
, address const& addr) = 0;
// This function retrieves a sample infohashes
// This function retrieves a sample info-hashes
//
// For implementers:
// The infohashes should be stored in ["samples"] (N × 20 bytes).
// The info-hashes should be stored in ["samples"] (N × 20 bytes).
// the following keys should be filled
// item["interval"] - the subset refresh interval in seconds.
// item["num"] - number of infohashes in storage.
// item["num"] - number of info-hashes in storage.
//
// Internally, this function is allowed to lazily evaluate, cache
// and modify the actual sample to put in ``item``
//
// returns the number of infohashes in the sample.
// returns the number of info-hashes in the sample.
//
virtual int get_infohashes_sample(entry& item) = 0;

View File

@ -1020,7 +1020,7 @@ namespace aux {
// by sending choke, unchoke.
int m_num_invalid_requests = 0;
// if [0] is -1, superseeding is not active. If it is >= 0
// if [0] is -1, super-seeding is not active. If it is >= 0
// this is the piece that is available to this peer. Only
// these two pieces can be downloaded from us by this peer.
// This will remain the current piece for this peer until

View File

@ -261,7 +261,7 @@ namespace libtorrent {
// download queue
int timed_out_requests;
// the number of busy requests in the download queue. A budy request is a
// the number of busy requests in the download queue. A busy request is a
// request for a block we've also requested from a different peer
int busy_requests;
@ -337,7 +337,7 @@ namespace libtorrent {
int receive_quota;
// an estimated round trip time to this peer, in milliseconds. It is
// estimated by timing the the tcp ``connect()``. It may be 0 for
// estimated by timing the the TCP ``connect()``. It may be 0 for
// incoming connections.
int rtt;

View File

@ -136,7 +136,7 @@ namespace aux {
{
// This constructor can be used to start with the default plugins
// (ut_metadata, ut_pex and smart_ban). The default values in the
// settings is to start the default features like upnp, nat-pmp,
// settings is to start the default features like upnp, NAT-PMP,
// and dht for example.
explicit session_params(settings_pack sp = settings_pack());
// This constructor helps to configure the set of initial plugins
@ -217,8 +217,8 @@ namespace aux {
// settings_pack object. Its settings will take effect before the session
// starts up.
//
// The ``flags`` parameter can be used to start default features (upnp &
// nat-pmp) and default plugins (ut_metadata, ut_pex and smart_ban). The
// The ``flags`` parameter can be used to start default features (UPnP &
// NAT-PMP) and default plugins (ut_metadata, ut_pex and smart_ban). The
// default is to start those features. If you do not want them to start,
// pass 0 as the flags parameter.
session(settings_pack pack
@ -228,11 +228,11 @@ namespace aux {
start(flags, std::move(pack), nullptr);
}
// moveable
// movable
session(session&&) = default;
session& operator=(session&&) = default;
// noncopyable
// non-copyable
session(session const&) = delete;
session& operator=(session const&) = delete;

View File

@ -394,7 +394,7 @@ namespace libtorrent {
// store the given bencoded data as an immutable item in the DHT.
// the returned hash is the key that is to be used to look the item
// up again. It's just the sha-1 hash of the bencoded form of the
// up again. It's just the SHA-1 hash of the bencoded form of the
// structure.
sha1_hash dht_put_item(entry data);
@ -411,7 +411,7 @@ namespace libtorrent {
// to be set to the value to be stored by the function.
//
// std::array<char,64>& signature
// the signature authenticating the current value. This may be zeroes
// the signature authenticating the current value. This may be zeros
// if there is currently no value stored. The function is expected to
// fill in this buffer with the signature of the new value to store.
// To generate the signature, you may want to use the
@ -431,7 +431,7 @@ namespace libtorrent {
// it is critical to not perform any blocking operations. Ideally not
// even locking a mutex. Pass any data required for this function along
// with the function object's context and make the function entirely
// self-contained. The only reason data blobs' values are computed
// self-contained. The only reason data blob's value is computed
// via a function instead of just passing in the new value is to avoid
// race conditions. If you want to *update* the value in the DHT, you
// must first retrieve it, then modify it, then write it back. The way
@ -453,9 +453,9 @@ namespace libtorrent {
void dht_live_nodes(sha1_hash const& nid);
// Query the DHT node specified by ``ep`` to retrieve a sample of the
// infohashes that the node currently have in their storage.
// info-hashes that the node currently have in their storage.
// The ``target`` is included for iterative lookups so that indexing nodes
// can perform a keyspace traversal with a single RPC per node by adjusting
// can perform a key space traversal with a single RPC per node by adjusting
// the target value for each RPC. It has no effect on the returned sample value.
// The result is posted as a ``dht_sample_infohashes_alert``.
void dht_sample_infohashes(udp::endpoint const& ep, sha1_hash const& target);
@ -489,7 +489,7 @@ namespace libtorrent {
// directly. Makes it possible to join a swarm with just a tracker and
// info-hash.
//
// ::
// .. code:: c++
//
// #include <libtorrent/extensions/ut_metadata.hpp>
// ses.add_extension(&libtorrent::create_ut_metadata_plugin);
@ -497,7 +497,7 @@ namespace libtorrent {
// uTorrent peer exchange
// Exchanges peers between clients.
//
// ::
// .. code:: c++
//
// #include <libtorrent/extensions/ut_pex.hpp>
// ses.add_extension(&libtorrent::create_ut_pex_plugin);
@ -507,7 +507,7 @@ namespace libtorrent {
// that sends bad data with very high accuracy. Should
// eliminate most problems on poisoned torrents.
//
// ::
// .. code:: c++
//
// #include <libtorrent/extensions/smart_ban.hpp>
// ses.add_extension(&libtorrent::create_smart_ban_plugin);
@ -621,7 +621,9 @@ namespace libtorrent {
// For more info, see ip_filter.
//
// For example, to make all peers in the range 200.1.1.0 - 200.1.255.255
// belong to their own peer class, apply the following filter::
// belong to their own peer class, apply the following filter:
//
// .. code:: c++
//
// ip_filter f;
// peer_class_t my_class = ses.create_peer_class("200.1.x.x IP range");
@ -661,7 +663,7 @@ namespace libtorrent {
void set_peer_class_type_filter(peer_class_type_filter const& f);
// Creates a new peer class (see peer-classes_) with the given name. The
// returned integer is the new peer class' identifier. Peer classes may
// returned integer is the new peer class identifier. Peer classes may
// have the same name, so each invocation of this function creates a new
// class and returns a unique identifier.
//
@ -777,7 +779,7 @@ namespace libtorrent {
// the torrent is deleted, a torrent_deleted_alert is posted.
//
// Note that when a queued or downloading torrent is removed, its position
// in the download queue is vacated and avery subsequent torrent in the
// in the download queue is vacated and every subsequent torrent in the
// queue has their queue positions updated. This can potentially cause a
// large state_update to be posted. When removing all torrents, it is
// advised to remove them from the back of the queue, to minimize the
@ -973,7 +975,7 @@ namespace libtorrent {
std::uint32_t get_alert_mask() const;
// Starts and stops Local Service Discovery. This service will broadcast
// the infohashes of all the non-private torrents on the local network to
// the info-hashes of all the non-private torrents on the local network to
// look for peers on the same swarm within multicast reach.
//
// deprecated. use settings_pack::enable_lsd instead

View File

@ -189,13 +189,13 @@ namespace libtorrent {
// incoming requests will be dropped until the quota has been replenished.
int upload_rate_limit;
// the infohashes sample recomputation interval (in seconds).
// The node will precompute a subset of the tracked infohashes and return
// the info-hashes sample recomputation interval (in seconds).
// The node will precompute a subset of the tracked info-hashes and return
// that instead of calculating it upon each request. The permissible range
// is between 0 and 21600 seconds (inclusive).
int sample_infohashes_interval = 21600;
// the maximum number of elements in the sampled subset of infohashes.
// the maximum number of elements in the sampled subset of info-hashes.
// If this number is too big, expect the DHT storage implementations
// to clamp it in order to allow UDP packets go through
int max_infohashes_sample_count = 20;

View File

@ -670,7 +670,7 @@ namespace libtorrent {
enable_natpmp,
// Starts and stops Local Service Discovery. This service will
// broadcast the infohashes of all the non-private torrents on the
// broadcast the info-hashes of all the non-private torrents on the
// local network to look for peers on the same swarm within multicast
// reach.
enable_lsd,

View File

@ -129,7 +129,7 @@ namespace aux {
char const* data() const { return reinterpret_cast<char const*>(&m_number[0]); }
char* data() { return reinterpret_cast<char*>(&m_number[0]); }
// set the digest to all zeroes.
// set the digest to all zeros.
void clear() noexcept { std::memset(m_number, 0, size()); }
// return true if the digest is all zero.

View File

@ -110,7 +110,7 @@ POSSIBILITY OF SUCH DAMAGE.
// // if there are padding files, those blocks will be considered
// // completed even though they haven't been written to the storage.
// // in this case, just extend the piece buffer to its full size
// // and fill it with zeroes.
// // and fill it with zeros.
// if (data.size() < piece_size) data.resize(piece_size, 0);
// ph.h.update(&data[ph.offset], left);
// }
@ -143,7 +143,7 @@ namespace libtorrent {
// the torrent in the way one would assume a torrent is saved to disk.
// Implementing your own storage interface makes it possible to store all
// data in RAM, or in some optimized order on disk (the order the pieces are
// received for instance), or saving multifile torrents in a single file in
// received for instance), or saving multi file torrents in a single file in
// order to be able to take advantage of optimized disk-I/O.
//
// It is also possible to write a thin class that uses the default storage
@ -266,7 +266,7 @@ namespace libtorrent {
//
virtual void release_files(storage_error& ec) = 0;
// Rename file with index ``index`` to the name ``new_filename``.
// Rename the file with index ``file`` to name ``new_name``.
//
// If an error occurs, ``storage_error`` should be set to reflect it.
//
@ -281,21 +281,22 @@ namespace libtorrent {
// If an error occurs, ``storage_error`` should be set to reflect it.
//
// The ``disk_buffer_pool`` is used to allocate and free disk buffers. It
// has the following members::
// has the following members:
//
// struct disk_buffer_pool : boost::noncopyable
// {
// char* allocate_buffer(char const* category);
// void free_buffer(char* buf);
// .. code:: c++
//
// char* allocate_buffers(int blocks, char const* category);
// void free_buffers(char* buf, int blocks);
// struct disk_buffer_pool : boost::noncopyable
// {
// char* allocate_buffer(char const* category);
// void free_buffer(char* buf);
//
// int block_size() const { return m_block_size; }
// char* allocate_buffers(int blocks, char const* category);
// void free_buffers(char* buf, int blocks);
//
// void release_memory();
// };
// int block_size() const { return m_block_size; }
//
// void release_memory();
// };
virtual void delete_files(int options, storage_error& ec) = 0;
// called periodically (useful for deferred flushing). When returning

View File

@ -380,7 +380,7 @@ namespace libtorrent { namespace aux {
//
// If the piece is already downloaded when this call is made, nothing
// happens, unless the alert_when_available flag is set, in which case it
// will do the same thing as calling read_piece() for ``index``.
// will have the same effect as calling read_piece() for ``index``.
//
// ``deadline`` is the number of milliseconds until this piece should be
// completed.
@ -413,7 +413,7 @@ namespace libtorrent { namespace aux {
// priority, but the priority is used as a weight.
//
// Peers whose Torrent has a higher priority will take precedence when
// distributing unchoke slots. This is a strict prioritization where
// distributing unchoke slots. This is a strict prioritisation where
// every interested peer on a high priority torrent will be unchoked
// before any other, lower priority, torrents have any peers unchoked.
// deprecated in 1.2
@ -503,7 +503,7 @@ namespace libtorrent { namespace aux {
// pieces from it, unless it's paused, queued, checking or seeding.
// ``remove_url_seed()`` removes the given url if it exists already.
// ``url_seeds()`` return a set of the url seeds currently in this
// torrent. Note that urls that fails may be removed automatically from
// torrent. Note that URLs that fails may be removed automatically from
// the list.
//
// See http-seeding_ for more information.
@ -577,7 +577,7 @@ namespace libtorrent { namespace aux {
// .. note::
// Torrents that are auto-managed may be automatically resumed again. It
// does not make sense to pause an auto-managed torrent without making it
// not automanaged first. Torrents are auto-managed by default when added
// not auto-managed first. Torrents are auto-managed by default when added
// to the session. For more information, see queuing_.
//
void pause(int flags = 0) const;
@ -881,7 +881,7 @@ namespace libtorrent { namespace aux {
//
// Note that when a torrent first starts up, and it needs a certificate,
// it will suspend connecting to any peers until it has one. It's
// typically desirable to resume the torrent after setting the ssl
// typically desirable to resume the torrent after setting the SSL
// certificate.
//
// If you receive a torrent_need_cert_alert, you need to call this to
@ -1118,7 +1118,7 @@ namespace libtorrent { namespace aux {
// Magnet links, and other torrents that start out without having
// metadata are pinned automatically. This is to give the client a chance
// to get the metadata and save it before it's unloaded. In this case, it
// may be useful to un-pin the torrent once its metadata has been saved
// may be useful to unpin the torrent once its metadata has been saved
// to disk.
//
// For more information about dynamically loading and unloading torrents,
@ -1143,7 +1143,7 @@ namespace libtorrent { namespace aux {
// can be done by using this other than an unnecessary connection attempt
// is made. If the torrent is uninitialized or in queued or checking
// mode, this will throw system_error. The second (optional)
// argument will be bitwised ORed into the source mask of this peer.
// argument will be bitwise ORed into the source mask of this peer.
// Typically this is one of the source flags in peer_info. i.e.
// ``tracker``, ``pex``, ``dht`` etc.
//
@ -1157,7 +1157,7 @@ namespace libtorrent { namespace aux {
// 0x04 supports uTP. If this is not set, the peer will only be contacted
// over TCP.
//
// 0x08 supports holepunching protocol. If this
// 0x08 supports hole punching protocol. If this
// flag is received from a peer, it can be
// used as a rendezvous point in case direct
// connections to the peer fail

View File

@ -202,7 +202,7 @@ namespace libtorrent {
// filename is reflected by the ``file_storage`` returned by ``files()``
// but not by the one returned by ``orig_files()``.
//
// If you want to rename the base name of the torrent (for a multifile
// If you want to rename the base name of the torrent (for a multi file
// torrent), you can copy the ``file_storage`` (see files() and
// orig_files() ), change the name, and then use `remap_files()`_.
//
@ -249,13 +249,13 @@ namespace libtorrent {
void add_tracker(std::string const& url, int tier = 0);
std::vector<announce_entry> const& trackers() const { return m_urls; }
// These two functions are related to BEP38_ (mutable torrents). The
// These two functions are related to `BEP 38`_ (mutable torrents). The
// vectors returned from these correspond to the "similar" and
// "collections" keys in the .torrent file. Both info-hashes and
// collections from within the info-dict and from outside of it are
// included.
//
// .. _BEP38: http://www.bittorrent.org/beps/bep_0038.html
// .. _`BEP 38`: http://www.bittorrent.org/beps/bep_0038.html
std::vector<sha1_hash> similar_torrents() const;
std::vector<std::string> collections() const;
@ -358,8 +358,9 @@ namespace libtorrent {
file_entry file_at(int index) const { return m_files.at_deprecated(index); }
#endif // TORRENT_NO_DEPRECATE
// If you need index-access to files you can use the ``num_files()`` and
// ``file_path()`` et.al. to access files using indices.
// If you need index-access to files you can use the ``num_files()`` along
// with the ``file_path()``, ``file_size()``-family of functions to access
// files using indices.
int num_files() const { return m_files.num_files(); }
// This function will map a piece index, a byte offset within that piece
@ -523,7 +524,7 @@ namespace libtorrent {
std::map<int, sha1_hash> build_merkle_list(piece_index_t piece) const;
// returns whether or not this is a merkle torrent.
// see BEP30__.
// see `BEP 30`__.
//
// __ http://bittorrent.org/beps/bep_0030.html
bool is_merkle_torrent() const { return !m_merkle_tree.empty(); }
@ -557,7 +558,7 @@ namespace libtorrent {
// instance
copy_ptr<const file_storage> m_orig_files;
// the urls to the trackers
// the URLs to the trackers
aux::vector<announce_entry> m_urls;
std::vector<web_seed_entry> m_web_seeds;
// dht nodes to add to the routing table/bootstrap from
@ -596,7 +597,7 @@ namespace libtorrent {
boost::shared_array<char> m_info_section;
// this is a pointer into the m_info_section buffer
// pointing to the first byte of the first sha-1 hash
// pointing to the first byte of the first SHA-1 hash
char const* m_piece_hashes = nullptr;
// if a comment is found in the torrent file
@ -630,7 +631,7 @@ namespace libtorrent {
{
// this is used when creating a torrent. If there's
// only one file there are cases where it's impossible
// to know if it should be written as a multifile torrent
// to know if it should be written as a multi file torrent
// or not. e.g. test/test there's one file and one directory
// and they have the same name.
multifile = 1,

View File

@ -2041,7 +2041,7 @@ namespace {
// and don't send a bitfield
m_sent_bitfield = true;
// bootstrap superseeding by sending two have message
// bootstrap super-seeding by sending two have message
piece_index_t piece = t->get_piece_to_super_seed(get_bitfield());
if (piece >= piece_index_t(0)) superseed_piece(piece_index_t(-1), piece);
piece = t->get_piece_to_super_seed(get_bitfield());

View File

@ -77,7 +77,7 @@ struct ip_change_notifier_impl final : ip_change_notifier
, netlink::endpoint(netlink(NETLINK_ROUTE), RTMGRP_IPV4_IFADDR | RTMGRP_IPV6_IFADDR))
{}
// noncopyable
// non-copyable
ip_change_notifier_impl(ip_change_notifier_impl const&) = delete;
ip_change_notifier_impl& operator=(ip_change_notifier_impl const&) = delete;
@ -199,7 +199,7 @@ struct ip_change_notifier_impl final : ip_change_notifier
cancel();
}
// noncopyable
// non-copyable
ip_change_notifier_impl(ip_change_notifier_impl const&) = delete;
ip_change_notifier_impl& operator=(ip_change_notifier_impl const&) = delete;
@ -291,7 +291,7 @@ struct ip_change_notifier_impl final : ip_change_notifier
cancel();
}
// noncopyable
// non-copyable
ip_change_notifier_impl(ip_change_notifier_impl const&) = delete;
ip_change_notifier_impl& operator=(ip_change_notifier_impl const&) = delete;
@ -335,7 +335,7 @@ struct ip_change_notifier_impl final : ip_change_notifier
m_ovl.hEvent = m_hnd.native_handle();
}
// noncopyable
// non-copyable
ip_change_notifier_impl(ip_change_notifier_impl const&) = delete;
ip_change_notifier_impl& operator=(ip_change_notifier_impl const&) = delete;

View File

@ -1840,9 +1840,9 @@ namespace libtorrent {
if (t->super_seeding() && !m_settings.get_bool(settings_pack::strict_super_seeding))
{
// if we're superseeding and the peer just told
// us that it completed the piece we're superseeding
// to it, change the superseeding piece for this peer
// if we're super-seeding and the peer just told
// us that it completed the piece we're super-seeding
// to it, change the super-seeding piece for this peer
// if the peer optimizes out redundant have messages
// this will be handled when the peer sends not-interested
// instead.

View File

@ -4386,7 +4386,7 @@ namespace libtorrent {
{
if (pc->super_seeded_piece(i))
{
// avoid superseeding the same piece to more than one
// avoid super-seeding the same piece to more than one
// peer if we can avoid it. Do this by artificially
// increase the availability
availability = 999;
@ -4554,7 +4554,13 @@ namespace libtorrent {
{
INVARIANT_CHECK;
if (m_abort)
TORRENT_ASSERT_PRECOND(piece >= piece_index_t(0));
TORRENT_ASSERT_PRECOND(valid_metadata());
TORRENT_ASSERT_PRECOND(valid_metadata() && piece < m_torrent_file->end_piece());
if (m_abort || !valid_metadata()
|| piece < piece_index_t(0)
|| piece >= m_torrent_file->end_piece())
{
// failed
if (flags & torrent_handle::alert_when_available)

View File

@ -1015,7 +1015,7 @@ namespace libtorrent {
file_storage files;
files.set_piece_length(piece_length);
// extract file name (or the directory name if it's a multifile libtorrent)
// extract file name (or the directory name if it's a multi file libtorrent)
bdecode_node name_ent = info.dict_find_string("name.utf-8");
if (!name_ent) name_ent = info.dict_find_string("name");
if (!name_ent)
@ -1059,7 +1059,7 @@ namespace libtorrent {
}
TORRENT_ASSERT(!files.name().empty());
// extract sha-1 hashes for all pieces
// extract SHA-1 hashes for all pieces
// we want this division to round upwards, that's why we have the
// extra addition

View File

@ -165,7 +165,7 @@ namespace libtorrent {namespace {
// 0x04 - supports uTP. This is only a positive flags
// passing 0 doesn't mean the peer doesn't
// support uTP
// 0x08 - supports holepunching protocol. If this
// 0x08 - supports hole punching protocol. If this
// flag is received from a peer, it can be
// used as a rendezvous point in case direct
// connections to the peer fail
@ -552,7 +552,7 @@ namespace libtorrent {namespace {
// 0x04 - supports uTP. This is only a positive flags
// passing 0 doesn't mean the peer doesn't
// support uTP
// 0x08 - supports holepunching protocol. If this
// 0x08 - supports hole punching protocol. If this
// flag is received from a peer, it can be
// used as a rendezvous point in case direct
// connections to the peer fail