diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..3e35d68e --- /dev/null +++ b/.clang-format @@ -0,0 +1,65 @@ +--- +Language: Cpp +# BasedOnStyle: LLVM +AccessModifierOffset: -2 +AlignAfterOpenBracket: true +AlignEscapedNewlinesLeft: false +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AlwaysBreakAfterDefinitionReturnType: false +AlwaysBreakTemplateDeclarations: false +AlwaysBreakBeforeMultilineStrings: false +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BinPackParameters: true +BinPackArguments: true +ColumnLimit: 80 +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +DerivePointerAlignment: false +ExperimentalAutoDetectBinPacking: false +IndentCaseLabels: false +IndentWrappedFunctionNames: false +IndentFunctionDeclarationAfterType: false +MaxEmptyLinesToKeep: 1 +KeepEmptyLinesAtTheStartOfBlocks: true +NamespaceIndentation: None +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakString: 1000 +PenaltyBreakFirstLessLess: 120 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Left +SpacesBeforeTrailingComments: 1 +Cpp11BracedListStyle: true +Standard: Cpp11 +IndentWidth: 2 +TabWidth: 8 +UseTab: Never +BreakBeforeBraces: Stroustrup +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpacesInAngles: false +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +SpaceAfterCStyleCast: false +SpacesInContainerLiterals: true +SpaceBeforeAssignmentOperators: true +ContinuationIndentWidth: 4 +CommentPragmas: '^ IWYU pragma:' +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +SpaceBeforeParens: ControlStatements +DisableFormat: false +... + diff --git a/AUTHORS b/AUTHORS index ffc04126..43ee47d4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,40 @@ -Tatsuhiro Tsujikawa +These are people who made lots of contributions: + +Tatsuhiro Tsujikawa Ross Smith II (Windows port) Nils Maier + +The aria2 contributor's list extracted from commit logs [1]: + +Alexander Amanuel +Anthony Bryan +Athmane Madjoudj +Cristian Rodríguez +Dan Fandrich +David Macek +ITriskTI +Igor Khomyakov +Jarda Snajdr +Kcchouette +Nils Maier +ORiON- +Ross Smith II +Ryan Steinmetz +Ryo ONODERA +Sarim Khan +Sergey Zolotarev +Tatsuhiro Tsujikawa +Vasilij Schneidermann +Zoltan Toth-Czifra +amtlib-dot-dll +c3mb0 +diadistis +gilberto dos santos alves +gt +kwkam +luokar +mozillazg +multisnow +oliviercommelarbre + +[1] https://gist.github.com/tatsuhiro-t/deaffeb064652104ad11 diff --git a/Dockerfile.mingw b/Dockerfile.mingw index 80129259..2fbf6562 100644 --- a/Dockerfile.mingw +++ b/Dockerfile.mingw @@ -4,9 +4,12 @@ # $ sudo docker build -t aria2-mingw - < Dockerfile.mingw # # After successful build, windows binary is located at -# /aria2/src/aria2c.exe. You can copy the binary using +# /aria2/src/aria2c.exe. You can copy the binary using following +# commands: # -# $ sudo docker cp :/aria2/src/aria2c.exe +# $ id=$(sudo docker create aria2-mingw) +# $ sudo docker cp $id:/aria2/src/aria2c.exe +# $ sudo docker rm -v $id FROM ubuntu @@ -24,15 +27,15 @@ RUN apt-get install -y make binutils autoconf automake autotools-dev libtool \ pkg-config git curl dpkg-dev gcc-mingw-w64 \ autopoint libcppunit-dev libxml2-dev libgcrypt11-dev lzip -RUN curl -L -O https://gmplib.org/download/gmp/gmp-6.0.0a.tar.lz +RUN curl -L -O https://gmplib.org/download/gmp/gmp-6.1.0.tar.lz RUN curl -L -O http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz -RUN curl -L -O http://www.sqlite.org/2015/sqlite-autoconf-3080803.tar.gz +RUN curl -L -O http://www.sqlite.org/2016/sqlite-autoconf-3100200.tar.gz RUN curl -L -O http://zlib.net/zlib-1.2.8.tar.xz RUN curl -L -O http://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz -RUN curl -L -O http://libssh2.org/download/libssh2-1.5.0.tar.gz +RUN curl -L -O http://libssh2.org/download/libssh2-1.6.0.tar.gz -RUN tar xf gmp-6.0.0a.tar.lz -RUN cd gmp-6.0.0 && \ +RUN tar xf gmp-6.1.0.tar.lz +RUN cd gmp-6.1.0 && \ ./configure \ --disable-shared \ --enable-static \ @@ -53,8 +56,8 @@ RUN cd expat-2.1.0 && \ --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \ make install -RUN tar xf sqlite-autoconf-3080803.tar.gz -RUN cd sqlite-autoconf-3080803 && \ +RUN tar xf sqlite-autoconf-3100200.tar.gz +RUN cd sqlite-autoconf-3100200 && \ ./configure \ --disable-shared \ --enable-static \ @@ -89,8 +92,8 @@ RUN cd c-ares-1.10.0 && \ LIBS="-lws2_32" && \ make install -RUN tar xf libssh2-1.5.0.tar.gz -RUN cd libssh2-1.5.0 && \ +RUN tar xf libssh2-1.6.0.tar.gz +RUN cd libssh2-1.6.0 && \ ./configure \ --disable-shared \ --enable-static \ diff --git a/Dockerfile.raspberrypi b/Dockerfile.raspberrypi index d702ceb6..b6da64dc 100644 --- a/Dockerfile.raspberrypi +++ b/Dockerfile.raspberrypi @@ -17,7 +17,7 @@ ENV TOOL_BIN_DIR /tools/arm-bcm2708/gcc-linaro-$HOST-raspbian-x64/bin ENV PATH ${TOOL_BIN_DIR}:$PATH RUN mkdir $LOCAL_DIR && mkdir zlib && cd zlib && \ - curl -Ls -o - 'http://prdownloads.sourceforge.net/libpng/zlib-1.2.8.tar.gz?download' | \ + curl -Ls -o - 'http://zlib.net/zlib-1.2.8.tar.gz' | \ tar xzf - --strip-components=1 && \ prefix=${LOCAL_DIR} \ CC=$HOST-gcc \ @@ -43,7 +43,7 @@ RUN mkdir -p expat && cd expat && \ make -s install RUN mkdir c-ares && cd c-ares && \ - curl -Ls -o - http://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz | \ + curl -Ls -o - 'http://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz' | \ tar xzf - --strip-components=1 && \ ./configure \ --host=$HOST \ @@ -55,7 +55,7 @@ RUN mkdir c-ares && cd c-ares && \ make -s install RUN mkdir gmp && cd gmp && \ - curl -Ls -o - 'https://gmplib.org/download/gmp/gmp-6.0.0a.tar.lz' | \ + curl -Ls -o - 'https://gmplib.org/download/gmp/gmp-6.1.0.tar.lz' | \ lzip -d | tar xf - --strip-components=1 && \ ./configure \ --disable-shared \ @@ -68,7 +68,7 @@ RUN mkdir gmp && cd gmp && \ make -s install RUN mkdir sqlite && cd sqlite && \ - curl -Ls -o - https://www.sqlite.org/2015/sqlite-autoconf-3080900.tar.gz | \ + curl -Ls -o - 'https://www.sqlite.org/2016/sqlite-autoconf-3100100.tar.gz' | \ tar xzf - --strip-components=1 && \ ./configure \ --disable-shared \ @@ -78,10 +78,11 @@ RUN mkdir sqlite && cd sqlite && \ --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` && \ make -s && \ make -s install - + RUN mkdir aria && cd aria && \ - curl -Ls -o - http://sourceforge.net/projects/aria2/files/latest/download | \ - tar xjf - --strip-components=1 && \ + curl -s 'https://api.github.com/repos/tatsuhiro-t/aria2/releases/latest' | \ + grep 'browser_download_url.*[0-9]\.tar\.bz2' | sed -e 's/^[[:space:]]*//' | \ + cut -d ' ' -f 2 | xargs -I % curl -Ls -o - '%' | tar xjf - --strip-components=1 && \ ./configure \ --host=$HOST \ --build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \ diff --git a/Makefile.am b/Makefile.am index c6b7c4cd..0804f14c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,8 @@ EXTRA_DIST = config.rpath \ dist_doc_DATA = README README.rst README.html +.PHONY: clang-format + if HAVE_RST2HTML README.html: README.rst $(RST2HTML) $< > $@ @@ -27,3 +29,11 @@ endif # !HAVE_RST2HTML dist_noinst_DATA = LICENSE.OpenSSL +# Format source files using clang-format. Don't format source files +# under deps directory since we are not responsible for thier coding +# style. +clang-format: + CLANGFORMAT=`git config --get clangformat.binary`; \ + test -z $${CLANGFORMAT} && CLANGFORMAT="clang-format"; \ + $${CLANGFORMAT} -i $(top_srcdir)/src/*.{c,cc,h} $(top_srcdir)/src/includes/aria2/*.h \ + $(top_srcdir)/examples/*.cc $(top_srcdir)/test/*.{cc,h} diff --git a/NEWS b/NEWS index c2b6afd9..61b35602 100644 --- a/NEWS +++ b/NEWS @@ -1,170 +1,40 @@ -aria2 1.19.1 +aria2 1.21.0 ============ Release Note ------------ -This release fixes TLS handshake error with servers which only support -RSA-SHA1 signature algorithm. We removed RSA-SHA1 for enchanced -security, but many users reported there were servers which could not -talk aria2 1.19.0, so added it again for compatibility reasons. For -Windows build, we fixed potential infinite loop bug when TLS is used. - -We changed the location where dht.dat and aria2.conf are looked up. -The aria2 manual page described details. Basically we now follow XDG -specification (http://standards.freedesktop.org/basedir-spec/latest/). -For dht.dat, the default location is $XDG_CACHE_HOME/aria2/ directory. -For aria2.conf, the default location is $XDG_CONFIG_HOME/aria2/ -directory. To keep the current user configuration working, if aria2 -detects dht.dat under $HOME/.aria2/ directory, it is used instead. -Similarly, if aria2.conf exists under $HOME/.aria2/ directory, it is -used instead. - -Previously, we return 500 HTTP status if RPC method execution -encountered error. Now it returns with 400 HTTP status with error -code. This is more natural because server processed request and found -an error, and returned error reply correctly. This is not something -server crashed or something. Also, there is RPC libraries which -throws exception if it sees 5XX status code, where 400 is better -because we can examine the error. +This release fixes several bugs, see the Changes for details. We +added "following" key to the response of aria2.tellStatus RPC method +as reverse link for followedBy. Changes ------- -* Update README.android +* SessionSerializer: Fix bug that pause=true is added to wrong item - Providing some workarounds about CA certificates and standard output + This change also defers writing metadata download to the location + where first its follower download is written. - Patch from amtlib-dot-dll +* Add "following" to aria2.tellStatus response key as reverse link for + followedBy -* Return 400 HTTP status code if exception was caught while executing - RPC method +* mingw: Add warning for falloc - Previously, we returned 500 HTTP status code. I think the found in - RPC level, not in HTTP protocol, so 500 is not appropriate. +* Update ciphers in AppleTLS -* WinTLS: Fix potential infinite loop + Also enable fast start while at it -* Fix on-download-error is executed even if download succeeded +* OSX: Enable libssh2 and sftp -* Update Dockerfile.mingw + Closes GH-468 - Patch from Adam Baxter +* Update OSX dependencies -* Increase --select-file upper bound to 1m for torrent containing lots - of files + Closes GH-466 -* Fix busy loop with --dry-run and 4xx response for URI listed in - metalink +* Fix compile error without TLS support - See GH-430 +* Add support for using gnutls system wide crypto policy -* Update sqlite in OSX build to 3.8.10.2 - -* Make LibuvEventPoll compatible with the latest libuv again - -* gnutls: Allow SIGN-RSA-SHA1 for compatibility reason - -* Make script compatible with both Python 2 and 3 - - Patch from Vasilij Schneidermann - -* Make config and cache files conform to XDG - - See http://standards.freedesktop.org/basedir-spec/latest/ for - further details. This implementation decides the default based on - whether a file exists at the legacy location, if it doesn't, it - picks the XDG-conforming location instead. - - Patch from Vasilij Schneidermann - -* ftp, sftp: Fix heap-after-free bug on exception - -* ftp: Fix timeout when reusing FTP connection - -* Various MinGW-w64 build improvements - - - Fix detection of localtime_r and asctime_r on MinGW-w64 - - Fix linking with libintl on MinGW-w64 - - Patch from David Macek - - - -aria2 1.19.0 -============ - -Release Note ------------- - -This releases adds SFTP support, and fixes several bugs. SFTP support -has been implemented using libssh2. We added several new options. ---multiple-interface option is like --interface option, but can take -several interfaces. They are used in round-robin manner, and it works -like link aggregation. Previously, .netrc search path is fixed under -$HOME directory, and cannot be changed. In this release, --netrc-path -option has been added to override the search path. The runtime bug -concerning getrandom has been fixed in this release. Previously if -download failed because checksum error, aria2 exited with error code 1 -(unknown error). Now it exits with dedicated error code 32. We fixed -long outstanding bug that aria2 crashes when downloading multi-file -torrent. - -Changes -------- - -* android: Build and link with zlib - - Previously, we linked with zlib shipped with NDK, but it seems this - is not part of NDK API, and thus could break our app. - -* Allow netrc-path to be specified in the config file - - Adds --netrc-path to override default .netrc search path. Patch - from Ryan Steinmetz - -* Exit with 32 status code if checksum verification failed - -* Add SFTP support using libssh2 - - aria2 can now download files via sftp protocol: aria2c sftp://.... - --ssh-host-key-md option is added to specify expected server's - fingerprint. - -* Added Dockerfile to cross complile aria2 for RaspberryPI (armhf) - - Patch from Igor Khomyakov - -* multiple interface support for link aggregation - - Adds --multiple-interface option. Patch from Sarim Khan - -* Run on-bt-download-complete command when -V reports download finished - - Fixes GH-355 - -* Use dedicated DiskWriter in MultiDiskFileAllocationIterator - - We have to use dedicated DiskWriter instead of - (*entryItr_)->getDiskWriter(). This is because - SingleFileAllocationIterator cannot reopen file if file is closed by - OpenedFileCounter. Fixes GH-350 - -* Fix getrandom for system with libc not including errno or systems - - not supporting ENOSYS in the first place. Fixes GH-347 - -* Don't send back rpc-secret option value in aria2.getGlobalOption RPC - method - -* Make libuv default off - - See GH-241 for discussion - -* Fixed slow RPC response - - Fxies GH-345 - -* Fix getrandom interface detection - - Fixes GH-346 + Patch from Athmane Madjoudj diff --git a/README.android b/README.android index 38d62764..017750e5 100644 --- a/README.android +++ b/README.android @@ -33,7 +33,7 @@ How to use ---------- See `the online manual -`_. +`_. Notes ----- @@ -42,10 +42,10 @@ aria2c executable was generated using android-ndk-r10d. The following libraries were statically linked. -* openssl 1.0.2d +* openssl 1.0.2g * expat 2.1.0 -* c-ares 1.10.0 -* libssh2 1.6.0 +* c-ares 1.11.0 +* libssh2 1.7.0 Since Android does not have ``/etc/resolv.conf``, c-ares (asynchronous DNS resolver) is disabled by default. But name resolution is sometimes diff --git a/README.mingw b/README.mingw index e303472c..315028d9 100644 --- a/README.mingw +++ b/README.mingw @@ -5,21 +5,19 @@ aria2 Windows build is provided in 2 flavors: 32bit version and 64bit version. The executable was compiled using mingw-w64 cross compiler on Debian Linux. -* gcc-mingw-w64 4.9.2-21+15.4 -* binutils-mingw-w64-i686 2.25-8+6.2 -* binutils-mingw-w64-x86-64 2.25-8+6.2 +* gcc-mingw-w64 5.2.1-26+16 +* binutils-mingw-w64-i686 2.25.90.20151209-1+6.5+b1 +* binutils-mingw-w64-x86-64 2.25.90.20151209-1+6.5+b1 The executable is statically linked, so no extra DLLs are necessary. The linked libraries are: -* gmp 6.0.0 +* gmp 6.1.0 * expat 2.1.0 -* sqlite 3.8.11.1 +* sqlite 3.10.2 * zlib 1.2.8 -* c-ares 1.10.0 with the dns.patch [1] applied -* libssh2 1.6.0 - -[1] http://c-ares.haxx.se/mail/c-ares-archive-2014-05/0008.shtml +* c-ares 1.11.0 +* libssh2 1.7.0 This build has the following difference from the original release: @@ -29,6 +27,12 @@ This build has the following difference from the original release: Known Issues ------------ +* --file-allocation=falloc uses SetFileValidData function to allocate + disk space without filling zero. But it has security + implications. Refer to + https://msdn.microsoft.com/en-us/library/windows/desktop/aa365544%28v=vs.85%29.aspx + for more details. + * When Ctrl-C is pressed, aria2 shows "Shutdown sequence commencing... Press Ctrl-C again for emergency shutdown." But mingw32 build cannot handle second Ctrl-C properly. The second diff --git a/README.rst b/README.rst index cd38df46..2ca1f173 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ aria2 - The ultra fast download utility ======================================= :Author: Tatsuhiro Tsujikawa -:Email: t-tujikawa_at_users_dot_sourceforge_dot_net +:Email: tatsuhiro.t_at_gmail_dot_com Disclaimer ---------- @@ -20,12 +20,12 @@ downloaded from HTTP(S)/FTP/SFTP is uploaded to the BitTorrent swarm. Using Metalink's chunk checksums, aria2 automatically validates chunks of data while downloading a file like BitTorrent. -The project page is located at http://aria2.sourceforge.net/. +The project page is located at https://aria2.github.io/. See `aria2 Online Manual -`_ (`Russian translation -`_, `Portuguese -translation `_) to learn +`_ (`Russian translation +`_, `Portuguese +translation `_) to learn how to use aria2. Features @@ -78,6 +78,22 @@ Here is a list of features: * IPv6 support with Happy Eyeballs * Disk cache to reduce disk activity + +Versioning and release schedule +------------------------------- + +We use 3 numbers for aria2 version: MAJOR.MINOR.PATCH. We will ship +MINOR update on 15th of every month. We may skip a release if we have +no changes since the last release. The feature and documentation +freeze happens 10 days before the release day (5th day of the month) +for translation teams. We will raise an issue about the upcoming +release around that day. + +We may release PATCH releases between regular releases if we have +security issues. + +MAJOR version will stay at 1 for the time being. + How to get source code ---------------------- @@ -214,6 +230,11 @@ following packages to get autoconf macros: * libxml2-dev * libcppunit-dev +* autoconf +* automake +* autotools-dev +* autopoint +* libtool And run following command to generate configure script and other files necessary to build the program:: @@ -395,10 +416,10 @@ Building documentation documentation. aria2 man pages will be build when you run ``make`` if they are not up-to-date. You can also build HTML version of aria2 man page by ``make html``. The HTML version manual is also available at -`online `_ (`Russian -translation `_, +`online `_ (`Russian +translation `_, `Portuguese translation -`_). +`_). BitTorrent ----------- @@ -534,9 +555,8 @@ documentation to know how to use API. References ---------- -* `aria2 Online Manual `_ -* http://aria2.sourceforge.net/ -* https://github.com/tatsuhiro-t/aria2 +* `aria2 Online Manual `_ +* https://aria2.github.io/ * `RFC 959 FILE TRANSFER PROTOCOL (FTP) `_ * `RFC 1738 Uniform Resource Locators (URL) `_ * `RFC 2428 FTP Extensions for IPv6 and NATs `_ diff --git a/configure.ac b/configure.ac index 02c73230..920a2c78 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. # AC_PREREQ([2.67]) -AC_INIT([aria2],[1.19.1],[https://github.com/tatsuhiro-t/aria2/issues],[aria2],[http://aria2.sourceforge.net/]) +AC_INIT([aria2],[1.21.0],[https://github.com/tatsuhiro-t/aria2/issues],[aria2],[https://aria2.github.io/]) AC_CANONICAL_HOST AC_CANONICAL_TARGET @@ -21,21 +21,29 @@ AC_SUBST(LT_REVISION, 0) AC_SUBST(LT_AGE, 0) AC_CONFIG_MACRO_DIR([m4]) -AM_PATH_CPPUNIT(1.10.2) +m4_ifdef([AM_PATH_CPPUNIT], [AM_PATH_CPPUNIT(1.10.2)]) AC_CONFIG_SRCDIR([src/a2io.h]) AC_CONFIG_HEADERS([config.h]) +# extra flags +EXTRACFLAGS= +EXTRACXXFLAGS= +EXTRACPPFLAGS= +EXTRALDFLAGS= +EXTRALIBS= + case "$host" in *mingw*) win_build=yes - LIBS="$LIBS -lws2_32 -lwsock32 -lgdi32 -lwinmm -liphlpapi -lpsapi" - # Define _POSIX_C_SOURCE to 1. This makes {asc,local}time_r available - # from even without (un)helpful interference from , - # and also defines __USE_MINGW_ANSI_STDIO. - CPPFLAGS="-D_POSIX_C_SOURCE=1 $CPPFLAGS" + EXTRALIBS="-lws2_32 -lwsock32 -lgdi32 -lwinmm -liphlpapi -lpsapi $EXTRALIBS" + # Define _POSIX_C_SOURCE to 1. This makes {asc,local}time_r + # available from even without (un)helpful interference + # from , and also defines __USE_MINGW_ANSI_STDIO. + EXTRACPPFLAGS="$EXTRACPPFLAGS -D_POSIX_C_SOURCE=1" # Build with ASLR (dynamicbase) and NX compatiblity (nxcompat) - # Enable pie once upstream/binutils gets fixed to produce correct binaries with it. - LDFLAGS="$LDFLAGS -Wl,--dynamicbase -Wl,--nxcompat" + # Enable pie once upstream/binutils gets fixed to produce correct + # binaries with it. + EXTRALDFLAGS="$EXTRALDFLAGS -Wl,--dynamicbase -Wl,--nxcompat" ;; esac @@ -67,6 +75,7 @@ ARIA2_ARG_DISABLE([metalink]) ARIA2_ARG_DISABLE([websocket]) ARIA2_ARG_DISABLE([epoll]) ARIA2_ARG_ENABLE([libaria2]) +ARIA2_ARG_ENABLE([werror]) AC_ARG_WITH([ca-bundle], AS_HELP_STRING([--with-ca-bundle=FILE],[Use FILE as default CA bundle.]), @@ -86,6 +95,13 @@ AC_ARG_WITH([bashcompletiondir], AC_ARG_VAR([ARIA2_STATIC], [Set 'yes' to build a statically linked aria2]) +AC_ARG_ENABLE([gnutls-system-crypto-policy], + AS_HELP_STRING([--enable-gnutls-system-crypto-policy], [Enable gnutls system wide crypto policy])) + +AS_IF([test "x$enable_gnutls_system_crypto_policy" = "xyes"], [ + AC_DEFINE([USE_GNUTLS_SYSTEM_CRYPTO_POLICY], [1], [Define to 1 if using gnutls system wide crypto policy .]) +]) + # Checks for programs. AC_PROG_CXX AC_PROG_CC @@ -96,10 +112,10 @@ AM_PROG_AS # Speed GCC compilation up. if test "$GCC" = yes; then - CFLAGS="$CFLAGS -pipe" + EXTRACFLAGS="$EXTRACFLAGS -pipe" fi if test "$GXX" = yes; then - CXXFLAGS="$CXXFLAGS -pipe" + EXTRACXXFLAGS="$EXTRACXXFLAGS -pipe" fi AC_CHECK_TOOL([AR], [ar], [:]) @@ -123,9 +139,19 @@ AC_LANG([C++]) PKG_PROG_PKG_CONFIG([0.20]) # Check C++ compiler supports C++0x/C++11 feature +save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS= + AX_CXX_COMPILE_STDCXX_11([noext], [mandatory]) +CXX1XCXXFLAGS="$CXXFLAGS" +CXXFLAGS="$save_CXXFLAGS" +AC_SUBST([CXX1XCXXFLAGS]) + # Check C++ compiler actually supports nullptr +save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="$CXXFLAGS $CXX1XCXXFLAGS" + AC_MSG_CHECKING([whether the c++ compiler supports nullptr]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], @@ -156,20 +182,22 @@ Derived x; AC_DEFINE_UNQUOTED([CXX11_OVERRIDE], [$cxx11_override], [Define `override` keyword if the compiler supports it]) +CXXFLAGS=$save_CXXFLAGS + # Check static build is requested if test "x$ARIA2_STATIC" = "xyes"; then case "$host" in i686*mingw*) dnl Define _USE_32BIT_TIME_T because 32bit library of MinGW-w64 dnl does not implement many 64bit version functions. - CPPFLAGS="-D_USE_32BIT_TIME_T $CPPFLAGS" + EXTRACPPFLAGS="$EXTRACPPFLAGS -D_USE_32BIT_TIME_T" ;; esac # Make pkg-config produce static linking variables PKG_CONFIG="$PKG_CONFIG --static" else dnl Make variable empty to avoid confusion - ARIA2_STATIC= + ARIA2_STATIC=no fi # Checks for libraries. @@ -177,14 +205,15 @@ fi # Check availability of libz if test "x$with_libz" = "xyes"; then PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no]) - if test "x$have_zlib" = "xyes"; then - LIBS="$ZLIB_LIBS $LIBS" - CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS" - else + if test "x$have_zlib" != "xyes"; then AC_MSG_WARN([$ZLIB_PKG_ERRORS]) AC_CHECK_LIB([z], [zlibVersion], [have_zlib=yes], [have_zlib=no]) + if test "x$have_zlib" = "xyes"; then - LIBS="-lz $LIBS" + ZLIB_CFLAGS= + ZLIB_LIBS="-lz" + AC_SUBST([ZLIB_CFLAGS]) + AC_SUBST([ZLIB_LIBS]) elif test "x$with_libz_requested" = "xyes"; then ARIA2_DEP_NOT_MET([libz]) fi @@ -193,64 +222,82 @@ if test "x$with_libz" = "xyes"; then AC_DEFINE([HAVE_ZLIB], [1], [Define to 1 if you have zlib.]) # Android NDK arch-mips contains gzbuffer symbol but it is missing # in zlib.h + save_CFLAGS=$CFLAGS + save_LIBS=$LIBS + CFLAGS="$CFLAGS $ZLIB_CFLAGS" + LIBS="$ZLIB_LIBS $LIBS" AC_CHECK_DECL([gzbuffer], [have_decl_gzbuffer=yes], [], [[#include ]]) if test "x$have_decl_gzbuffer" = "xyes"; then AC_CHECK_FUNC([gzbuffer]) fi AC_CHECK_FUNCS([gzsetparams]) + CFLAGS=$save_CFLAGS + LIBS=$save_LIBS fi fi +have_libuv=no if test "x$with_libuv" = "xyes"; then case "$host" in *mingw*|*msvc*) - old_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0600" + libuv_cflags="-D_WIN32_WINNT=0x0600" + save_CPPFLAGS=$CPPFLAGS + save_LIBS=$LIBS + CPPFLAGS="$CPPFLAGS $libuv_cflags" AC_SEARCH_LIBS([uv_poll_init_socket], [uv], [ AC_CHECK_HEADER([uv.h], [have_libuv=yes], [have_libuv=no]) - break; ], [have_libuv=no]) - if test "x$have_libuv" != "xyes"; then - CPPFLAGS=$old_CPPFLAGS + if test "x$have_libuv" = "xyes"; then + LIBUV_CFLAGS=$libuv_cflags + LIBUV_LIBS=-luv + AC_SUBST([LIBUV_CFLAGS]) + AC_SUBST([LIBUV_LIBS]) fi + CPPFLAGS=$save_CPPFLAGS + CPPLIBS=$save_LIBS ;; *darwin*) - old_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -framework Foundation -framework CoreServices -framework ApplicationServices" - old_LIBS=$LIBS - LIBS="$LIBS -lm" + libuv_ldflags="-framework Foundation -framework CoreServices -framework ApplicationServices" + save_LDFLAGS=$LDFLAGS + save_LIBS=$LIBS + LDFLAGS="$LDFLAGS $libuv_ldflags" AC_SEARCH_LIBS([uv_poll_init_socket], [uv], [ AC_CHECK_HEADER([uv.h], [have_libuv=yes], [have_libuv=no]) - break; - ], [have_libuv=no]) - if test "x$have_libuv" != "xyes"; then - LDFLAGS=$old_LDFLAGS - LIBS=$old_LIBS + ], [have_libuv=no], [-lm]) + if test "x$have_libuv" = "xyes"; then + LIBUV_CFLAGS= + LIBUV_LIBS="$libuv_ldflags -luv -lm" + AC_SUBST([LIBUV_CFLAGS]) + AC_SUBST([LIBUV_LIBS]) fi + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS ;; *) dnl Yeah, sucks that luv does not bring a pkg-config or config-tool AC_MSG_CHECKING([for libuv]) + save_LIBS=$LIBS for combo in "" "-lrt" "-ldl -lrt" "-ldl -lrt -lpthread" "-lkvm"; do - old_LIBS=$LIBS - LIBS="-luv $combo $LIBS -lm" + LIBS="-luv $combo $save_LIBS -lm" AC_LINK_IFELSE([AC_LANG_SOURCE([ extern "C" int uv_poll_init_socket(void); int main() { return uv_poll_init_socket(); } ])], [ AC_MSG_RESULT(-luv $combo -lm) AC_CHECK_HEADER([uv.h], [have_libuv=yes], [have_libuv=no]) - break; ], [have_libuv=no]) if test "x$have_libuv" = "xyes"; then + LIBUV_CFLAGS= + LIBUV_LIBS="-luv $combo -lm" + AC_SUBST([LIBUV_CFLAGS]) + AC_SUBST([LIBUV_LIBS]) break; - else - LIBS=$old_LIBS fi done + LIBS=$save_LIBS if test "x$have_libuv" != "xyes"; then AC_MSG_RESULT("no") fi @@ -259,41 +306,56 @@ int main() { return uv_poll_init_socket(); } if test "x$have_libuv" = "xyes"; then AC_DEFINE([HAVE_LIBUV], [1], [Define to 1 if you have libuv.]) + save_LIBS=$LIBS + LIBS="$LIBUV_LIBS $LIBS" AC_CHECK_FUNCS([uv_last_error]) + LIBS=$save_LIBS elif test "x$with_libuv_requested" = "xyes"; then ARIA2_DEP_NOT_MET([libuv]) fi fi AM_CONDITIONAL([HAVE_LIBUV], [test "x$have_libuv" = "xyes"]) +have_libxml2=no if test "x$with_libxml2" = "xyes"; then - AM_PATH_XML2([2.6.24], [have_libxml2=yes]) + m4_ifdef([AM_PATH_XML2], [AM_PATH_XML2([2.6.24], [have_libxml2=yes])], [ + AC_MSG_WARN([configure was generated without libxml2 detection. libxml2 detection is disabled]) + XML_CPPFLAGS= + XML_LIBS= + AC_SUBST([XML_CPPFLAGS]) + AC_SUBST([XML_LIBS]) + ]) if test "x$have_libxml2" = "xyes"; then AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have libxml2.]) - LIBS="$XML_LIBS $LIBS" - CPPFLAGS="$XML_CPPFLAGS $CPPFLAGS" elif test "x$with_libxml2_requested" = "xyes"; then ARIA2_DEP_NOT_MET([libxml2]) fi fi +have_libexpat=no if test "x$with_libexpat" = "xyes" && test "x$have_libxml2" != "xyes"; then - AM_PATH_LIBEXPAT - if test "x$have_libexpat" = "xyes"; then - LIBS="$EXPAT_LIBS $LIBS" - CPPFLAGS="$EXPAT_CFLAGS $CPPFLAGS" - elif test "x$with_libexpat_requested" = "xyes"; then + m4_ifdef([AM_PATH_LIBEXPAT], [AM_PATH_LIBEXPAT], [ + AC_MSG_WARN([configure was generated without libexpat detection. libexpat detection is disabled]) + EXPAT_CFLAGS= + EXPAT_LIBS= + AC_SUBST([EXPAT_CFLAGS]) + AC_SUBST([EXPAT_LIBS]) + ]) + if test "x$have_libexpat" != "xyes" && + test "x$with_libexpat_requested" = "xyes"; then ARIA2_DEP_NOT_MET([libexpat]) fi fi +have_sqlite3=no if test "x$with_sqlite3" = "xyes"; then PKG_CHECK_MODULES([SQLITE3],[sqlite3],[have_sqlite3=yes],[have_sqlite3=no]) if test "x$have_sqlite3" = "xyes"; then AC_DEFINE([HAVE_SQLITE3], [1], [Define to 1 if you have sqlite3.]) + save_LIBS=$LIBS LIBS="$SQLITE3_LIBS $LIBS" - CPPFLAGS="$SQLITE3_CFLAGS $CPPFLAGS" AC_CHECK_FUNCS([sqlite3_open_v2]) + LIBS=$save_LIBS else AC_MSG_WARN([$SQLITE3_PKG_ERRORS]) if test "x$with_sqlite3_requested" = "xyes"; then @@ -339,11 +401,13 @@ if test "x$enable_ssl" != "xyes"; then with_openssl=no fi +have_appletls=no if test "x$with_appletls" = "xyes"; then AC_MSG_CHECKING([whether to enable Mac OS X native SSL/TLS]) if test "x$have_osx" = "xyes"; then AC_DEFINE([HAVE_APPLETLS], [1], [Define to 1 if you have Apple TLS]) - LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security" + APPLETLS_LDFLAGS="-framework CoreFoundation -framework Security" + AC_SUBST([APPLETLS_LDFLAGS]) have_appletls="yes" have_ssl=yes have_nativetls=yes @@ -356,6 +420,7 @@ if test "x$with_appletls" = "xyes"; then fi fi +have_wintls=no if test "x$with_wintls" = "xyes"; then AC_HAVE_LIBRARY([crypt32],[have_wintls_libs=yes],[have_wintls_libs=no]) AC_HAVE_LIBRARY([secur32],[have_wintls_libs=$have_wintls_libs],[have_wintls_libs=no]) @@ -377,7 +442,8 @@ if test "x$with_wintls" = "xyes"; then if test "x$have_wintls_libs" = "xyes" && test "x$have_wintls_headers" = "xyes"; then AC_DEFINE([SECURITY_WIN32], [1], [Use security.h in WIN32 mode]) - LIBS="$LIBS -lcrypt32 -lsecur32 -ladvapi32" + WINTLS_LIBS="-lcrypt32 -lsecur32 -ladvapi32" + AC_SUBST([WINTLS_LIBS]) have_wintls=yes have_ssl=yes have_nativetls=yes @@ -391,6 +457,7 @@ if test "x$with_wintls" = "xyes"; then fi fi +have_libgnutls=no if test "x$with_gnutls" = "xyes" && test "x$have_ssl" != "xyes"; then # gnutls >= 2.8 doesn't have libgnutls-config anymore. We require # 2.2.0 because we use gnutls_priority_set_direct() @@ -399,9 +466,10 @@ if test "x$with_gnutls" = "xyes" && test "x$have_ssl" != "xyes"; then if test "x$have_libgnutls" = "xyes"; then have_ssl=yes AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define to 1 if you have libgnutls.]) + save_LIBS=$LIBS LIBS="$LIBGNUTLS_LIBS $LIBS" - CPPFLAGS="$LIBGNUTLS_CFLAGS $CPPFLAGS" AC_CHECK_FUNCS([gnutls_certificate_set_x509_system_trust]) + LIBS=$save_LIBS else AC_MSG_WARN([$LIBGNUTLS_PKG_ERRORS]) if test "x$with_gnutls_requested" = "xyes"; then @@ -410,15 +478,16 @@ if test "x$with_gnutls" = "xyes" && test "x$have_ssl" != "xyes"; then fi fi +have_openssl=no if test "x$with_openssl" = "xyes" && test "x$have_ssl" != "xyes"; then PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.8], [have_openssl=yes], [have_openssl=no]) if test "x$have_openssl" = "xyes"; then have_ssl=yes AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have openssl.]) - LIBS="$OPENSSL_LIBS $LIBS" - CPPFLAGS="$OPENSSL_CFLAGS $CPPFLAGS" + save_LIBS=$LIBS + LIBS="$OPENSSL_LIBS $LIBS" AC_CHECK_FUNCS([EVP_DigestInit_ex], [have_digestinit_ex=yes]) if test "x$have_digestinit_ex" = "x"; then AC_DEFINE([HAVE_OLD_OPENSSL], [1], [Define to 1 if you have old openssl.]) @@ -427,6 +496,7 @@ if test "x$with_openssl" = "xyes" && test "x$have_ssl" != "xyes"; then AC_CHECK_FUNCS([EVP_sha256]) AC_CHECK_FUNCS([EVP_sha384]) AC_CHECK_FUNCS([EVP_sha512]) + LIBS=$save_LIBS else AC_MSG_WARN([$OPENSSL_PKG_ERRORS]) if test "x$with_openssl_requested" = "xyes"; then @@ -435,12 +505,19 @@ if test "x$with_openssl" = "xyes" && test "x$have_ssl" != "xyes"; then fi fi +have_libnettle=no +have_libgmp=no +have_libgcrypt=no if test "x$have_openssl" != "xyes"; then if test "x$with_libnettle" = "xyes" && test "x$have_nativetls" != "xyes"; then - AC_SEARCH_LIBS([nettle_sha1_init], [nettle], - [have_libnettle=yes], [have_libnettle=no]) + AC_CHECK_LIB([nettle], [nettle_sha1_init], + [have_libnettle=yes], [have_libnettle=no]) if test "x$have_libnettle" = "xyes"; then + LIBNETTLE_CFLAGS= + LIBNETTLE_LIBS="-lnettle" + AC_SUBST([LIBNETTLE_CFLAGS]) + AC_SUBST([LIBNETTLE_LIBS]) AC_DEFINE([HAVE_LIBNETTLE], [1], [Define to 1 if you have libnettle.]) fi fi @@ -448,10 +525,17 @@ if test "x$have_openssl" != "xyes"; then (test "x$have_libnettle" = "xyes" || test "x$have_nativetls" = "xyes") && test "x$enable_bittorrent" = "xyes"; then - AC_SEARCH_LIBS([__gmpz_init], [gmp], [have_libgmp=yes], [have_libgmp=no]) + AC_CHECK_LIB([gmp], [__gmpz_init], [have_libgmp=yes], [have_libgmp=no]) if test "x$have_libgmp" = "xyes"; then + LIBGMP_CFLAGS= + LIBGMP_LIBS=-lgmp + AC_SUBST([LIBGMP_CFLAGS]) + AC_SUBST([LIBGMP_LIBS]) AC_DEFINE([HAVE_LIBGMP], [1], [Define to 1 if you have libgmp.]) + save_LIBS=$LIBS + LIBS="$LIBGMP_LIBS $LIBS" AC_CHECK_FUNCS([__gmpz_powm_sec], [have_mpz_powm_sec=yes]) + LIBS=$save_LIBS if test "x$have_mpz_powm_sec" = "xyes"; then AC_DEFINE([HAVE_GMP_SEC], [1], [Define to 1 if you have a GMP with sec functions.]) fi @@ -465,21 +549,24 @@ if test "x$have_openssl" != "xyes"; then if test "x$with_libgcrypt" = "xyes" && test "x$have_nativetls" != "xyes" && test "x$have_libnettle" != "xyes"; then - AM_PATH_LIBGCRYPT([1.2.4], [have_libgcrypt=yes]) + m4_ifdef([AM_PATH_LIBGCRYPT], [AM_PATH_LIBGCRYPT([1.2.4], [have_libgcrypt=yes])], [ + AC_MSG_WARN([configure was generated without libgcrypt detection. libgcrypt detection is disabled]) + LIBGCRYPT_CFLAGS= + LIBGCRYPT_LIBS= + AC_SUBST([LIBGCRYPT_CFLAGS]) + AC_SUBST([LIBGCRYPT_LIBS]) + ]) if test "x$have_libgcrypt" = "xyes"; then AC_DEFINE([HAVE_LIBGCRYPT], [1], [Define to 1 if you have libgcrypt.]) - LIBS="$LIBGCRYPT_LIBS $LIBS" - CPPFLAGS="$LIBGCRYPT_CFLAGS $CPPFLAGS" fi fi fi +have_libssh2=no if test "x$with_libssh2" = "xyes"; then PKG_CHECK_MODULES([LIBSSH2], [libssh2], [have_libssh2=yes], [have_libssh2=no]) if test "x$have_libssh2" = "xyes"; then AC_DEFINE([HAVE_LIBSSH2], [1], [Define to 1 if you have libssh2.]) - LIBS="$LIBSSH2_LIBS $LIBS" - CPPFLAGS="$LIBSSH2_CFLAGS $CPPFLAGS" else AC_MSG_WARN([$LIBSSH2_PKG_ERRORS]) if test "x$with_libssh2_requested" = "xyes"; then @@ -488,19 +575,22 @@ if test "x$with_libssh2" = "xyes"; then fi fi +have_libcares=no if test "x$with_libcares" = "xyes"; then PKG_CHECK_MODULES([LIBCARES], [libcares >= 1.7.0], [have_libcares=yes], [have_libcares=no]) if test "x$have_libcares" = "xyes"; then AC_DEFINE([HAVE_LIBCARES], [1], [Define to 1 if you have libcares.]) + save_LIBS=$LIBS + save_CPPFLAGS=$CPPFLAGS LIBS="$LIBCARES_LIBS $LIBS" CPPFLAGS="$LIBCARES_CFLAGS $CPPFLAGS" AC_CHECK_TYPES([ares_addr_node], [], [], [[#include ]]) AC_CHECK_FUNCS([ares_set_servers]) + LIBS=$save_LIBS + CPPFLAGS=$save_CPPFLAGS - if test "x$ARIA2_STATIC" = "xyes"; then - CPPFLAGS="-DCARES_STATICLIB $CPPFLAGS" - fi + # -DCARES_STATICLIB is appended by pkg-config file libcares.pc else AC_MSG_WARN([$LIBCARES_PKG_ERRORS]) if test "x$with_libcares_requested" = "xyes"; then @@ -606,6 +696,8 @@ AM_CONDITIONAL([HAVE_SOME_XMLLIB], if test "x$have_libxml2" = "xyes" || test "x$have_libexpat" = "xyes"; then enable_xml_rpc=yes +else + enable_xml_rpc=no fi if test "x$enable_xml_rpc" = "xyes"; then @@ -634,11 +726,13 @@ AM_CONDITIONAL([HAVE_SQLITE3], [test "x$have_sqlite3" = "xyes"]) # Set conditional for libssh2 AM_CONDITIONAL([HAVE_LIBSSH2], [test "x$have_libssh2" = "xyes"]) -AC_SEARCH_LIBS([clock_gettime], [rt]) - case "$host" in *solaris*) - AC_SEARCH_LIBS([getaddrinfo], [nsl socket]) + save_LIBS=$LIBS + LIBS= + AC_SEARCH_LIBS([getaddrinfo], [nsl socket], [], [$save_LIBS]) + EXTRALIBS="$LIBS $EXTRALIBS" + LIBS=$save_LIBS ;; esac @@ -739,7 +833,7 @@ AC_CHECK_FUNCS([__argz_count \ getcwd \ gethostbyaddr \ gethostbyname \ - getifaddrs \ + getifaddrs \ getpagesize \ getrandom \ memchr \ @@ -750,9 +844,9 @@ AC_CHECK_FUNCS([__argz_count \ mmap \ munmap \ nl_langinfo \ - posix_fadvise \ + posix_fadvise \ posix_memalign \ - pow \ + pow \ putenv \ rmdir \ select \ @@ -774,8 +868,8 @@ AC_CHECK_FUNCS([__argz_count \ tzset \ unsetenv \ usleep \ - utime \ - utimes]) + utime \ + utimes]) AC_MSG_CHECKING([for getrandom linux syscall interface]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @@ -801,17 +895,18 @@ if test "x$with_tcmalloc_requested" = "xyes" && AC_MSG_FAILURE([Cannot use both, tcmalloc and jemalloc!]) fi +have_tcmalloc=no if test "x$with_tcmalloc" = "xyes"; then dnl Important: put malloc libs at the very end. dnl Only newish versions have a .pc, thus try CHECK_LIB as well. PKG_CHECK_MODULES([TCMALLOC], [libtcmalloc_minimal], [have_tcmalloc=yes], [have_tcmalloc=no]) - if test "x$have_tcmalloc" = "xyes"; then - CPPFLAGS="$TCMALLOC_CFLAGS $CPPFLAGS" - LIBS="$LIBS $TCMALLOC_LIBS" - else + if test "x$have_tcmalloc" != "xyes"; then AC_CHECK_LIB([tcmalloc_minimal], [malloc], [have_tcmalloc=yes], [have_tcmalloc=no]) if test "x$have_tcmalloc" = "xyes"; then - LIBS="$LIBS -ltcmalloc_minimal" + TCMALLOC_CFLAGS= + TCMALLOC_LIBS="-ltcmalloc_minimal" + AC_SUBST([TCMALLOC_CFLAGS]) + AC_SUBST([TCMALLOC_LIBS]) else if test "x$with_tcmalloc_requested" = "xyes"; then ARIA2_DEP_NOT_MET([tcmalloc_minimal]) @@ -820,18 +915,19 @@ if test "x$with_tcmalloc" = "xyes"; then fi fi -if test "x$have_tcmalloc" != "xyes" && test "x$with_jemalloc" = "xyes"; then +have_jemalloc=no +if test "x$with_jemalloc" = "xyes"; then dnl Important: put malloc libs at the very end. dnl Usually jemalloc does not come with a .pc, as the official source does not dnl generate one. PKG_CHECK_MODULES([JEMALLOC], [jemalloc], [have_jemalloc=yes], [have_jemalloc=no]) - if test "x$have_jemalloc" = "xyes"; then - CPPFLAGS="$JEMALLOC_CFLAGS $CPPFLAGS" - LIBS="$LIBS $JEMALLOC_LIBS" - else + if test "x$have_jemalloc" != "xyes"; then AC_CHECK_LIB([jemalloc], [malloc], [have_jemalloc=yes], [have_jemalloc=no]) if test "x$have_jemalloc" = "xyes"; then - LIBS="$LIBS -ljemalloc" + JEMALLOC_CFLAGS= + JEMALLOC_LIBS="-ljemalloc" + AC_SUBST([JEMALLOC_CFLAGS]) + AC_SUBST([JEMALLOC_LIBS]) else if test "x$with_jemalloc_requested" = "xyes"; then ARIA2_DEP_NOT_MET([jemalloc (unprefixed)]) @@ -840,7 +936,7 @@ if test "x$have_tcmalloc" != "xyes" && test "x$with_jemalloc" = "xyes"; then fi fi - +have_epoll=no if test "x$enable_epoll" = "xyes"; then AC_CHECK_FUNCS([epoll_create], [have_epoll=yes]) if test "x$have_epoll" = "xyes"; then @@ -862,6 +958,9 @@ AM_CONDITIONAL([HAVE_SOME_FALLOCATE], [test "x$have_posix_fallocate" = "xyes" || test "x$have_fallocate" = "xyes" \ || test "x$have_osx" = "xyes" || test "x$win_build" = "xyes"]) +# mingw needs this +save_CPPFLAGS=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $EXTRACPPFLAGS" AC_MSG_CHECKING([for asctime_r]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include @@ -887,25 +986,26 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ AC_DEFINE([HAVE_LOCALTIME_R], [1], [Define to 1 if you have the `localtime_r' function or macro.])], [AC_MSG_RESULT([no]) AM_CONDITIONAL([HAVE_LOCALTIME_R], false)]) +CPPFLAGS=$save_CPPFLAGS AC_CHECK_FUNCS([basename], - [AM_CONDITIONAL([HAVE_BASENAME], true)], - [AM_CONDITIONAL([HAVE_BASENAME], false)]) + [AM_CONDITIONAL([HAVE_BASENAME], true)], + [AM_CONDITIONAL([HAVE_BASENAME], false)]) AC_CHECK_FUNCS([gai_strerror], - [AM_CONDITIONAL([HAVE_GAI_STRERROR], true)], - [AM_CONDITIONAL([HAVE_GAI_STRERROR], false)]) + [AM_CONDITIONAL([HAVE_GAI_STRERROR], true)], + [AM_CONDITIONAL([HAVE_GAI_STRERROR], false)]) AC_CHECK_FUNCS([getaddrinfo], - [AM_CONDITIONAL([HAVE_GETADDRINFO], true)], - [AM_CONDITIONAL([HAVE_GETADDRINFO], false)]) + [AM_CONDITIONAL([HAVE_GETADDRINFO], true)], + [AM_CONDITIONAL([HAVE_GETADDRINFO], false)]) AC_CHECK_FUNCS([gettimeofday], - [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], true)], - [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], false)]) + [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], true)], + [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], false)]) AC_CHECK_FUNCS([strptime], - [AM_CONDITIONAL([HAVE_STRPTIME], true)], - [AM_CONDITIONAL([HAVE_STRPTIME], false)]) + [AM_CONDITIONAL([HAVE_STRPTIME], true)], + [AM_CONDITIONAL([HAVE_STRPTIME], false)]) AC_CHECK_FUNCS([timegm], - [AM_CONDITIONAL([HAVE_TIMEGM], true)], - [AM_CONDITIONAL([HAVE_TIMEGM], false)]) + [AM_CONDITIONAL([HAVE_TIMEGM], true)], + [AM_CONDITIONAL([HAVE_TIMEGM], false)]) AC_CHECK_FUNCS([daemon], [have_daemon=yes]) AM_CONDITIONAL([HAVE_DAEMON], [test "x$have_daemon" = "xyes"]) @@ -992,10 +1092,11 @@ if test "x$enable_websocket" = "xyes"; then enable_websocket=yes AC_DEFINE([ENABLE_WEBSOCKET], [1], [Define 1 if WebSocket support is enabled.]) - WSLAY_LIBS="\$(top_builddir)/deps/wslay/lib/libwslay.la" - AC_SUBST([WSLAY_LIBS]) # $(top_srcdir) for `make distcheck` - CPPFLAGS="-I\$(top_builddir)/deps/wslay/lib/includes -I\$(top_srcdir)/deps/wslay/lib/includes $CPPFLAGS" + WSLAY_CFLAGS="-I\$(top_builddir)/deps/wslay/lib/includes -I\$(top_srcdir)/deps/wslay/lib/includes" + WSLAY_LIBS="\$(top_builddir)/deps/wslay/lib/libwslay.la" + AC_SUBST([WSLAY_CFLAGS]) + AC_SUBST([WSLAY_LIBS]) fi AM_CONDITIONAL([ENABLE_WEBSOCKET], [test "x$enable_websocket" = "xyes"]) @@ -1031,77 +1132,108 @@ AM_CONDITIONAL([ANDROID_X86], [test "x$android_x86" = "xyes"]) if test "x$ARIA2_STATIC" = "xyes"; then # -static-libgcc and -static-libstdc++ are linker flags and not for # libtool. - LDFLAGS="$LDFLAGS -all-static" + EXTRALDFLAGS="$EXTRALDFLAGS -all-static" dnl For non-MinGW build, we need additional libs for static build. case "$host" in *mingw*|*msvc*|*darwin*) ;; *) - LIBS="$LIBS -lpthread -ldl -lrt" + EXTRALIBS="$EXTRALIBS -lpthread -ldl -lrt" ;; esac fi if test "x$win_build" = "xyes" && test "x$enable_libaria2" = "xyes"; then # Creating dll needs this - LDFLAGS="$LDFLAGS -no-undefined" + EXTRALDFLAGS="$EXTRALDFLAGS -no-undefined" fi +AC_SUBST([EXTRACFLAGS]) +AC_SUBST([EXTRACXXFLAGS]) +AC_SUBST([EXTRACPPFLAGS]) +AC_SUBST([EXTRALDFLAGS]) +AC_SUBST([EXTRALIBS]) + +save_CXXFLAGS=$CXXFLAGS +CXXFLAGS= + +if test "x$enable_werror" = "xyes"; then + AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"]) + AX_CHECK_COMPILE_FLAG([-Werror], [CXXFLAGS="$CXXFLAGS -Werror"]) + AX_CHECK_COMPILE_FLAG([-Wformat-security], [CXXFLAGS="$CXXFLAGS -Wformat-security"]) +fi + +WARNCXXFLAGS=$CXXFLAGS +CXXFLAGS=$save_CXXFLAGS + +AC_SUBST([WARNCXXFLAGS]) + AC_CONFIG_FILES([Makefile - src/Makefile - src/libaria2.pc - src/includes/Makefile - test/Makefile - po/Makefile.in - lib/Makefile - doc/Makefile - doc/manual-src/Makefile - doc/manual-src/en/Makefile - doc/manual-src/en/conf.py - doc/manual-src/ru/Makefile - doc/manual-src/ru/conf.py - doc/manual-src/pt/Makefile - doc/manual-src/pt/conf.py - deps/Makefile]) + src/Makefile + src/libaria2.pc + src/includes/Makefile + test/Makefile + po/Makefile.in + lib/Makefile + doc/Makefile + doc/manual-src/Makefile + doc/manual-src/en/Makefile + doc/manual-src/en/conf.py + doc/manual-src/ru/Makefile + doc/manual-src/ru/conf.py + doc/manual-src/pt/Makefile + doc/manual-src/pt/conf.py + deps/Makefile]) AC_OUTPUT -echo " " -echo "Build: $build" -echo "Host: $host" -echo "Target: $target" -echo "Install prefix: $prefix" -echo "CC: $CC" -echo "CXX: $CXX" -echo "CPP: $CPP" -echo "CXXFLAGS: $CXXFLAGS" -echo "CFLAGS: $CFLAGS" -echo "CPPFLAGS: $CPPFLAGS" -echo "LDFLAGS: $LDFLAGS" -echo "LIBS: $LIBS" -echo "DEFS: $DEFS" -echo "LibUV: $have_libuv" -echo "SQLite3: $have_sqlite3" -echo "SSL Support: $have_ssl" -echo "AppleTLS: $have_appletls" -echo "WinTLS: $have_wintls" -echo "GnuTLS: $have_libgnutls" -echo "OpenSSL: $have_openssl" -echo "CA Bundle: $ca_bundle" -echo "LibXML2: $have_libxml2" -echo "LibExpat: $have_libexpat" -echo "LibCares: $have_libcares" -echo "Zlib: $have_zlib" -echo "Libssh2: $have_libssh2" -echo "Epoll: $have_epoll" -echo "Bittorrent: $enable_bittorrent" -echo "Metalink: $enable_metalink" -echo "XML-RPC: $enable_xml_rpc" -echo "Message Digest: $use_md" -echo "WebSocket: $enable_websocket" -echo "Libaria2: $enable_libaria2" -if test "x$enable_libaria2" = "xyes"; then - echo "Library types: Shared=${enable_shared}, Static=${enable_static}" -fi -echo "bash_completion dir: $bashcompletiondir" -echo "Static build: $ARIA2_STATIC" +AC_MSG_NOTICE([summary of build options: + +Build: $build +Host: $host +Target: $target +Install prefix: $prefix +CC: $CC +CXX: $CXX +CPP: $CPP +CXXFLAGS: $CXXFLAGS +CFLAGS: $CFLAGS +CPPFLAGS: $CPPFLAGS +LDFLAGS: $LDFLAGS +LIBS: $LIBS +DEFS: $DEFS +CXX1XCXXFLAGS: $CXX1XCXXFLAGS +EXTRACXXFLAGS: $EXTRACXXFLAGS +EXTRACFLAGS: $EXTRACFLAGS +EXTRACPPFLAGS: $EXTRACPPFLAGS +EXTRALDFLAGS: $EXTRALDFLAGS +EXTRALIBS: $EXTRALIBS +WARNCXXFLAGS: $WARNCXXFLAGS +LibUV: $have_libuv (CFLAGS='$LIBUV_CFLAGS' LIBS='$LIBUV_LIBS') +SQLite3: $have_sqlite3 (CFLAGS='$SQLITE3_CFLAGS' LIBS='$SQLITE3_LIBS') +SSL Support: $have_ssl +AppleTLS: $have_appletls (LDFLAGS='$APPLETLS_LDFLAGS') +WinTLS: $have_wintls (LIBS='$WINTLS_LIBS') +GnuTLS: $have_libgnutls (CFLAGS='$LIBGNUTLS_CFLAGS' LIBS='$LIBGNUTLS_LIBS') +OpenSSL: $have_openssl (CFLAGS='$OPENSSL_CFLAGS' LIBS='$OPENSSL_LIBS') +CA Bundle: $ca_bundle +LibNettle: $have_libnettle (CFLAGS='$LIBNETTLE_CFLAGS' LIBS='$LIBNETTLE_LIBS') +LibGmp: $have_libgmp (CFLAGS='$LIBGMP_CFLAGS' LIBS='$LIBGMP_LIBS') +LibGcrypt: $have_libgcrypt (CFLAGS='$LIBGCRYPT_CFLAGS' LIBS='$LIBGCRYPT_LIBS') +LibXML2: $have_libxml2 (CFLAGS='$XML_CPPFLAGS' LIBS='$XML_LIBS') +LibExpat: $have_libexpat (CFLAGS='$EXPAT_CFLAGS' LIBS='$EXPAT_LIBS') +LibCares: $have_libcares (CFLAGS='$LIBCARES_CFLAGS' LIBS='$LIBCARES_LIBS') +Zlib: $have_zlib (CFLAGS='$ZLIB_CFLAGS' LIBS='$ZLIB_LIBS') +Libssh2: $have_libssh2 (CFLAGS='$LIBSSH2_CFLAGS' LIBS='$LIBSSH2_LIBS') +Tcmalloc: $have_tcmalloc (CFLAGS='$TCMALLOC_CFLAGS' LIBS='$TCMALLOC_LIBS') +Jemalloc: $have_jemalloc (CFLAGS='$JEMALLOC_CFLAGS' LIBS='$JEMALLOC_LIBS') +Epoll: $have_epoll +Bittorrent: $enable_bittorrent +Metalink: $enable_metalink +XML-RPC: $enable_xml_rpc +Message Digest: $use_md +WebSocket: $enable_websocket (CFLAGS='$WSLAY_CFLAGS' LIBS='$WSLAY_LIBS') +Libaria2: $enable_libaria2 (shared=${enable_shared} static=${enable_static}) +bash_completion dir: $bashcompletiondir +Static build: $ARIA2_STATIC +]) diff --git a/deps/wslay/COPYING b/deps/wslay/COPYING index 0550e0dc..60803303 100644 --- a/deps/wslay/COPYING +++ b/deps/wslay/COPYING @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2011, 2012 Tatsuhiro Tsujikawa +Copyright (c) 2011, 2012, 2015 Tatsuhiro Tsujikawa Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/deps/wslay/Makefile.am b/deps/wslay/Makefile.am index 8bb6f149..2e86973c 100644 --- a/deps/wslay/Makefile.am +++ b/deps/wslay/Makefile.am @@ -23,8 +23,3 @@ SUBDIRS = lib tests ACLOCAL_AMFLAGS = -I m4 - -EXTRA_DIST = examples/Makefile \ - examples/fork-echoserv.c \ - examples/echoserv.cc \ - examples/testclient.cc diff --git a/deps/wslay/NEWS b/deps/wslay/NEWS index 37b73272..550f980e 100644 --- a/deps/wslay/NEWS +++ b/deps/wslay/NEWS @@ -1,41 +1,47 @@ -wslay 0.1.1 +wslay 1.0.0 =========== Release Note ------------ -This release fixes the example programs and tutorial. It does not -change library code at all, so the library version has not been -changed. +This release fixes several build issues. Most changes were introduced +by contributors. Thank you for all the contributions in this project. +Because wslay is very stable since the previous release (more than 2 +years ago), we mark this release 1.0.0. Changes ------- -* Fixed example source code and tutorial. +* Fix NULL check in wslay_frame_context_init. - + Patch from Witchakorn Kamolpornwijit -wslay 0.1.0 -=========== +* the examples uses epoll and thus only be built on linux -Release Note ------------- + Patch from Kazuho Oku -This is the initial release of wslay WebSocket C library. +* build: allow one to build out-of-tree documentation -Wslay is a WebSocket library written in C. It implements the protocol -version 13 described in RFC 6455. This library offers 2 levels of API: -event-based API and frame-based low-level API. For event-based API, it -is suitable for non-blocking reactor pattern style. You can set -callbacks in various events. For frame-based API, you can send -WebSocket frame directly. Wslay only supports data transfer part of -WebSocket protocol and does not perform opening handshake in HTTP. + Patch from Vincent Bernat -Wslay does not perform any I/O operations for its own. Instead, it -offers callbacks for them. This makes Wslay independent on any I/O -frameworks, SSL, sockets, etc. This makes Wslay protable across -various platforms and the application authors can choose freely IO -frameworks. +* build: fix `./configure` when nettle is not present -Visit http://wslay.sourceforge.net/ for the API reference and -tutorial. + `PKG_CHECK_MODULES` will fail unless we give it an action to execute + on failure. When nettle is not available, we set `have_nettle` to + `no`. + + Patch from Vincent Bernat + +* Adds the ability to override the version header include with a + define. This enables projects to set the build version from the + compile environment and avoid the need to generate the version + header. + + Patch from Ben Vanik + +* Improve http_handshake in fork-echoserver. + + Patch from Gurjeet Singh + +* Don't send any pending control frame other than Close control frame + after Close is queued. diff --git a/deps/wslay/README.rst b/deps/wslay/README.rst index 47a4424a..1396b777 100644 --- a/deps/wslay/README.rst +++ b/deps/wslay/README.rst @@ -22,7 +22,7 @@ Wslay supports: Wslay does not perform any I/O operations for its own. Instead, it offers callbacks for them. This makes Wslay independent on any I/O -frameworks, SSL, sockets, etc. This makes Wslay protable across +frameworks, SSL, sockets, etc. This makes Wslay portable across various platforms and the application authors can choose freely I/O frameworks. @@ -30,3 +30,31 @@ See Autobahn test reports: `server `_ and `client `_. + +Requirements +------------ + +`Sphinx `_ is used to generate man pages. + +To build and run the unit test programs, the following packages are +needed: + +* cunit >= 2.1 + +To build and run the example programs, the following packages are +needed: + +* nettle >= 2.4 + + +Build from git +-------------- + +Building from git is easy, but please be sure that at least autoconf 2.68 is +used.:: + + $ autoreconf -i + $ automake + $ autoconf + $ ./configure + $ make diff --git a/deps/wslay/configure.ac b/deps/wslay/configure.ac index 91f8f29c..fc5ccdbb 100644 --- a/deps/wslay/configure.ac +++ b/deps/wslay/configure.ac @@ -21,14 +21,14 @@ dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. AC_PREREQ(2.61) -AC_INIT([wslay], [0.1.1], [t-tujikawa@users.sourceforge.net]) +AC_INIT([wslay], [1.0.1-DEV], [t-tujikawa@users.sourceforge.net]) LT_PREREQ([2.2.6]) LT_INIT() AC_CONFIG_AUX_DIR([.]) dnl See versioning rule: dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html AC_SUBST(LT_CURRENT, 0) -AC_SUBST(LT_REVISION, 0) +AC_SUBST(LT_REVISION, 1) AC_SUBST(LT_AGE, 0) AC_CANONICAL_BUILD @@ -42,15 +42,21 @@ AC_CONFIG_HEADERS([config.h]) dnl Checks for programs AC_PROG_CC +AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET +PKG_PROG_PKG_CONFIG([0.20]) AC_PATH_PROG([SPHINX_BUILD], [sphinx-build]) AC_SUBST([SPHINX_BUILD]) AM_CONDITIONAL([HAVE_SPHINX_BUILD], [ test "x$SPHINX_BUILD" != "x" ]) # Checks for libraries. + +# Nettle used in examples +PKG_CHECK_MODULES([NETTLE], [nettle >= 2.4], [have_nettle=yes], [have_nettle=no]) + AC_CHECK_LIB([cunit], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no]) AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ]) @@ -91,9 +97,6 @@ AC_CHECK_TYPES([ptrdiff_t]) AC_C_BIGENDIAN # Checks for library functions. -if test "x$cross_compiling" != "xyes"; then - AC_FUNC_MALLOC -fi AC_CHECK_FUNCS([ \ memmove \ memset \ @@ -102,6 +105,17 @@ AC_CHECK_FUNCS([ \ htons ]) +build_examples=no +if test "x${have_nettle}" = "xyes"; then + case $host_os in + linux*) + # the examples uses epoll + build_examples=yes + ;; + esac +fi +AM_CONDITIONAL([ENABLE_EXAMPLES], [ test "x${build_examples}" = "xyes" ]) + AC_CONFIG_FILES([ Makefile lib/Makefile @@ -121,4 +135,6 @@ AC_MSG_NOTICE([summary of build options: CFlags: ${CFLAGS} Library types: Shared=${enable_shared}, Static=${enable_static} CUnit: ${have_cunit} + Nettle: ${have_nettle} + Build examples: ${build_examples} ]) diff --git a/deps/wslay/examples/Makefile b/deps/wslay/examples/Makefile deleted file mode 100644 index 954e5dd7..00000000 --- a/deps/wslay/examples/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -# Wslay - The WebSocket Library - -# Copyright (c) 2011, 2012 Tatsuhiro Tsujikawa - -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: - -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -CC = gcc -CXX = g++ -CFLAGS = -g -O2 -I../lib/includes -CXXFLAGS = $(CFLAGS) -LDFLAGS = -L../lib/.libs -LIBS = -lwslay -lnettle - -PROGRAMS = fork-echoserv echoserv testclient - -.PHONY: all -all: $(PROGRAMS) - -fork-echoserv: fork-echoserv.c - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ fork-echoserv.c $(LIBS) - -echoserv: echoserv.cc - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ echoserv.cc $(LIBS) - -testclient: testclient.cc - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ testclient.cc $(LIBS) - -.PHONY: clean -clean: - rm -f *.o $(PROGRAMS) diff --git a/deps/wslay/examples/echoserv.cc b/deps/wslay/examples/echoserv.cc index 193c2d1b..961feaff 100644 --- a/deps/wslay/examples/echoserv.cc +++ b/deps/wslay/examples/echoserv.cc @@ -570,7 +570,7 @@ void reactor(int sfd) } else { perror("epoll_ctl"); delete next; - } + } } } if(eh->finish()) { diff --git a/deps/wslay/examples/fork-echoserv.c b/deps/wslay/examples/fork-echoserv.c index 910de17c..0ef5da6d 100644 --- a/deps/wslay/examples/fork-echoserv.c +++ b/deps/wslay/examples/fork-echoserv.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -159,6 +160,80 @@ void create_accept_key(char *dst, const char *client_key) dst[BASE64_ENCODE_RAW_LENGTH(20)] = '\0'; } +/* We parse HTTP header lines of the format + * \r\nfield_name: value1, value2, ... \r\n + * + * If the caller is looking for a specific value, we return a pointer to the + * start of that value, else we simply return the start of values list. + */ +static char* +http_header_find_field_value(char *header, char *field_name, char *value) +{ + char *header_end, + *field_start, + *field_end, + *next_crlf, + *value_start; + int field_name_len; + + /* Pointer to the last character in the header */ + header_end = header + strlen(header) - 1; + + field_name_len = strlen(field_name); + + field_start = header; + + do{ + field_start = strstr(field_start+1, field_name); + + field_end = field_start + field_name_len - 1; + + if(field_start != NULL + && field_start - header >= 2 + && field_start[-2] == '\r' + && field_start[-1] == '\n' + && header_end - field_end >= 1 + && field_end[1] == ':') + { + break; /* Found the field */ + } + else + { + continue; /* This is not the one; keep looking. */ + } + } while(field_start != NULL); + + if(field_start == NULL) + return NULL; + + /* Find the field terminator */ + next_crlf = strstr(field_start, "\r\n"); + + /* A field is expected to end with \r\n */ + if(next_crlf == NULL) + return NULL; /* Malformed HTTP header! */ + + /* If not looking for a value, then return a pointer to the start of values string */ + if(value == NULL) + return field_end+2; + + value_start = strstr(field_start, value); + + /* Value not found */ + if(value_start == NULL) + return NULL; + + /* Found the value we're looking for */ + if(value_start > next_crlf) + return NULL; /* ... but after the CRLF terminator of the field. */ + + /* The value we found should be properly delineated from the other tokens */ + if(isalnum(value_start[-1]) || isalnum(value_start[strlen(value)])) + return NULL; + + return value_start; +} + /* * Performs HTTP handshake. *fd* is the file descriptor of the * connection to the client. This function returns 0 if it succeeds, @@ -195,13 +270,13 @@ int http_handshake(int fd) } } } - if(strstr(header, "\r\nUpgrade: websocket\r\n") == NULL || - strstr(header, "\r\nConnection: Upgrade\r\n") == NULL || - (keyhdstart = strstr(header, "\r\nSec-WebSocket-Key:")) == NULL) { + + if(http_header_find_field_value(header, "Upgrade", "websocket") == NULL || + http_header_find_field_value(header, "Connection", "Upgrade") == NULL || + (keyhdstart = http_header_find_field_value(header, "Sec-WebSocket-Key", NULL)) == NULL) { fprintf(stderr, "HTTP Handshake: Missing required header fields"); return -1; } - keyhdstart += 20; for(; *keyhdstart == ' '; ++keyhdstart); keyhdend = keyhdstart; for(; *keyhdend != '\r' && *keyhdend != ' '; ++keyhdend); @@ -281,7 +356,7 @@ ssize_t recv_callback(wslay_event_context_ptr ctx, uint8_t *buf, size_t len, r = -1; } return r; -} +} void on_msg_recv_callback(wslay_event_context_ptr ctx, const struct wslay_event_on_msg_recv_arg *arg, diff --git a/deps/wslay/examples/testclient.cc b/deps/wslay/examples/testclient.cc index 6fbbec58..acfb4298 100644 --- a/deps/wslay/examples/testclient.cc +++ b/deps/wslay/examples/testclient.cc @@ -496,7 +496,7 @@ int update_reports(const char *host, const char *service) int main(int argc, char **argv) { - if(argc < 2) { + if(argc < 3) { std::cerr << "Usage: " << argv[0] << " HOST SERV" << std::endl; exit(EXIT_FAILURE); } diff --git a/deps/wslay/lib/includes/wslay/wslay.h b/deps/wslay/lib/includes/wslay/wslay.h index e4a6ec2f..71db0ac2 100644 --- a/deps/wslay/lib/includes/wslay/wslay.h +++ b/deps/wslay/lib/includes/wslay/wslay.h @@ -33,7 +33,15 @@ extern "C" { #include #include -#include + +/* + * wslay/wslayver.h is generated from wslay/wslayver.h.in by + * configure. The projects which do not use autotools can set + * WSLAY_VERSION macro from outside to avoid to generating wslayver.h + */ +#ifndef WSLAY_VERSION +# include +#endif /* WSLAY_VERSION */ enum wslay_error { WSLAY_ERR_WANT_READ = -100, diff --git a/deps/wslay/lib/wslay_event.c b/deps/wslay/lib/wslay_event.c index b3c4ed79..cc8b0e92 100644 --- a/deps/wslay/lib/wslay_event.c +++ b/deps/wslay/lib/wslay_event.c @@ -135,6 +135,10 @@ static int wslay_event_byte_chunk_init memset(*chunk, 0, sizeof(struct wslay_event_byte_chunk)); if(len) { (*chunk)->data = (uint8_t*)malloc(len); + if((*chunk)->data == NULL) { + free(*chunk); + return WSLAY_ERR_NOMEM; + } (*chunk)->data_length = len; } return 0; diff --git a/deps/wslay/lib/wslay_frame.c b/deps/wslay/lib/wslay_frame.c index 16359d8c..445e750c 100644 --- a/deps/wslay/lib/wslay_frame.c +++ b/deps/wslay/lib/wslay_frame.c @@ -37,7 +37,7 @@ int wslay_frame_context_init(wslay_frame_context_ptr *ctx, void *user_data) { *ctx = (wslay_frame_context_ptr)malloc(sizeof(struct wslay_frame_context)); - if(ctx == NULL) { + if(*ctx == NULL) { return -1; } memset(*ctx, 0, sizeof(struct wslay_frame_context)); diff --git a/deps/wslay/lib/wslay_stack.c b/deps/wslay/lib/wslay_stack.c index 752cf721..0e05d740 100644 --- a/deps/wslay/lib/wslay_stack.c +++ b/deps/wslay/lib/wslay_stack.c @@ -40,10 +40,11 @@ struct wslay_stack* wslay_stack_new() void wslay_stack_free(struct wslay_stack *stack) { + struct wslay_stack_cell *p; if(!stack) { return; } - struct wslay_stack_cell *p = stack->top; + p = stack->top; while(p) { struct wslay_stack_cell *next = p->next; free(p); diff --git a/doc/bash_completion/aria2c b/doc/bash_completion/aria2c index 6c9b1825..8e7d0b77 100644 --- a/doc/bash_completion/aria2c +++ b/doc/bash_completion/aria2c @@ -70,7 +70,7 @@ _aria2c() esac case $cur in -*) - COMPREPLY=( $( compgen -W '--rpc-save-upload-metadata --rpc-save-upload-metadata=false --on-download-start --metalink-language --rpc-secret --torrent-file --enable-peer-exchange --enable-peer-exchange=false --http-proxy-passwd --bt-tracker-timeout --ftp-type --seed-time --bt-tracker-connect-timeout --bt-max-open-files --no-netrc --no-netrc=false --force-sequential --force-sequential=false --metalink-base-uri --private-key --ftp-passwd --allow-overwrite --allow-overwrite=false --rpc-allow-origin-all --rpc-allow-origin-all=false --bt-detach-seed-only --bt-detach-seed-only=false --summary-interval --lowest-speed-limit --bt-tracker-interval --proxy-method --metalink-preferred-protocol --enable-http-keep-alive --enable-http-keep-alive=false --metalink-version --bt-lpd-interface --force-save --force-save=false --rpc-secure --rpc-secure=false --listen-port --rpc-private-key --server-stat-of --server-stat-timeout --https-proxy-user --piece-length --dry-run --dry-run=false --truncate-console-readout --truncate-console-readout=false --async-dns-server --bt-max-peers --max-overall-upload-limit --rpc-user --dht-entry-point6 --dir --split --on-download-pause --auto-file-renaming --auto-file-renaming=false --http-proxy --save-session-interval --daemon --daemon=false --https-proxy --min-tls-version --save-cookies --out --rlimit-nofile --max-file-not-found --on-download-stop --certificate --bt-min-crypto-level --remove-control-file --remove-control-file=false --enable-dht --enable-dht=false --file-allocation --follow-metalink --on-bt-download-complete --ftp-proxy --show-files --show-files=false --timeout --bt-hash-check-seed --bt-hash-check-seed=false --ftp-pasv --ftp-pasv=false --check-certificate --check-certificate=false --always-resume --always-resume=false --load-cookies --bt-remove-unselected-file --bt-remove-unselected-file=false --bt-stop-timeout --version --max-concurrent-downloads --quiet --quiet=false --max-download-result --max-resume-failure-tries --header --rpc-listen-all --rpc-listen-all=false --all-proxy-user --server-stat-if --dht-file-path6 --save-session --bt-external-ip --max-tries --conditional-get --conditional-get=false --ftp-reuse-connection --ftp-reuse-connection=false --gid --dscp --max-download-limit --bt-prioritize-piece --check-integrity --check-integrity=false --log-level --remote-time --remote-time=false --uri-selector --rpc-listen-port --index-out --bt-tracker --referer --ssh-host-key-md --console-log-level --connect-timeout --stream-piece-selector --dht-message-timeout --select-file --download-result --disable-ipv6 --disable-ipv6=false --rpc-max-request-size --rpc-passwd --stop-with-process --https-proxy-passwd --continue --continue=false --no-file-allocation-limit --netrc-path --ftp-proxy-user --enable-color --enable-color=false --metalink-location --allow-piece-length-change --allow-piece-length-change=false --max-connection-per-server --no-conf --no-conf=false --rpc-certificate --metalink-os --enable-http-pipelining --enable-http-pipelining=false --http-passwd --user-agent --enable-dht6 --enable-dht6=false --dht-file-path --http-auth-challenge --http-auth-challenge=false --peer-id-prefix --enable-mmap --enable-mmap=false --use-head --use-head=false --bt-require-crypto --bt-require-crypto=false --show-console-readout --show-console-readout=false --conf-path --log --no-proxy --dht-entry-point --dht-listen-port --http-user --retry-wait --on-download-complete --help --help=#basic --help=#advanced --help=#http --help=#https --help=#ftp --help=#metalink --help=#bittorrent --help=#cookie --help=#hook --help=#file --help=#rpc --help=#checksum --help=#experimental --help=#deprecated --help=#help --help=#all --max-overall-download-limit --event-poll --http-accept-gzip --http-accept-gzip=false --metalink-file --all-proxy --disk-cache --hash-check-only --hash-check-only=false --dht-listen-addr6 --human-readable --human-readable=false --ftp-user --all-proxy-passwd --bt-exclude-tracker --pause-metadata --pause-metadata=false --http-proxy-user --deferred-input --deferred-input=false --metalink-enable-unique-protocol --metalink-enable-unique-protocol=false --stop --max-upload-limit --multiple-interface --realtime-chunk-checksum --realtime-chunk-checksum=false --http-no-cache --http-no-cache=false --ca-certificate --bt-force-encryption --bt-force-encryption=false --bt-save-metadata --bt-save-metadata=false --seed-ratio --follow-torrent --pause --pause=false --checksum --auto-save-interval --async-dns --async-dns=false --bt-enable-lpd --bt-enable-lpd=false --parameterized-uri --parameterized-uri=false --ftp-proxy-passwd --enable-rpc --enable-rpc=false --min-split-size --bt-seed-unverified --bt-seed-unverified=false --input-file --interface --enable-async-dns6 --enable-async-dns6=false --reuse-uri --reuse-uri=false --bt-request-peer-speed-limit --on-download-error --bt-metadata-only --bt-metadata-only=false ' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--rpc-save-upload-metadata --rpc-save-upload-metadata=false --on-download-start --metalink-language --rpc-secret --torrent-file --enable-peer-exchange --enable-peer-exchange=false --http-proxy-passwd --bt-tracker-timeout --ftp-type --seed-time --bt-tracker-connect-timeout --bt-max-open-files --no-netrc --no-netrc=false --force-sequential --force-sequential=false --metalink-base-uri --private-key --ftp-passwd --allow-overwrite --allow-overwrite=false --rpc-allow-origin-all --rpc-allow-origin-all=false --bt-detach-seed-only --bt-detach-seed-only=false --summary-interval --lowest-speed-limit --bt-tracker-interval --proxy-method --metalink-preferred-protocol --enable-http-keep-alive --enable-http-keep-alive=false --metalink-version --bt-lpd-interface --force-save --force-save=false --rpc-secure --rpc-secure=false --listen-port --rpc-private-key --server-stat-of --server-stat-timeout --https-proxy-user --piece-length --dry-run --dry-run=false --truncate-console-readout --truncate-console-readout=false --async-dns-server --bt-max-peers --max-overall-upload-limit --rpc-user --dht-entry-point6 --dir --split --on-download-pause --auto-file-renaming --auto-file-renaming=false --http-proxy --save-session-interval --daemon --daemon=false --https-proxy --min-tls-version --save-cookies --out --rlimit-nofile --max-file-not-found --on-download-stop --certificate --bt-min-crypto-level --remove-control-file --remove-control-file=false --enable-dht --enable-dht=false --file-allocation --follow-metalink --on-bt-download-complete --ftp-proxy --show-files --show-files=false --timeout --bt-hash-check-seed --bt-hash-check-seed=false --ftp-pasv --ftp-pasv=false --check-certificate --check-certificate=false --always-resume --always-resume=false --load-cookies --bt-remove-unselected-file --bt-remove-unselected-file=false --bt-stop-timeout --version --max-concurrent-downloads --quiet --quiet=false --max-download-result --max-resume-failure-tries --header --rpc-listen-all --rpc-listen-all=false --all-proxy-user --server-stat-if --dht-file-path6 --save-session --bt-external-ip --max-tries --conditional-get --conditional-get=false --ftp-reuse-connection --ftp-reuse-connection=false --gid --dscp --max-download-limit --bt-prioritize-piece --check-integrity --check-integrity=false --log-level --remote-time --remote-time=false --uri-selector --rpc-listen-port --index-out --bt-tracker --referer --ssh-host-key-md --console-log-level --connect-timeout --stream-piece-selector --dht-message-timeout --select-file --download-result --disable-ipv6 --disable-ipv6=false --rpc-max-request-size --rpc-passwd --stop-with-process --https-proxy-passwd --continue --continue=false --no-file-allocation-limit --netrc-path --ftp-proxy-user --enable-color --enable-color=false --metalink-location --allow-piece-length-change --allow-piece-length-change=false --max-connection-per-server --no-conf --no-conf=false --rpc-certificate --metalink-os --enable-http-pipelining --enable-http-pipelining=false --http-passwd --user-agent --enable-dht6 --enable-dht6=false --dht-file-path --http-auth-challenge --http-auth-challenge=false --bt-enable-hook-after-hash-check --bt-enable-hook-after-hash-check=false --peer-id-prefix --max-mmap-limit --enable-mmap --enable-mmap=false --use-head --use-head=false --bt-require-crypto --bt-require-crypto=false --show-console-readout --show-console-readout=false --conf-path --log --no-proxy --dht-entry-point --dht-listen-port --http-user --retry-wait --on-download-complete --help --help=#basic --help=#advanced --help=#http --help=#https --help=#ftp --help=#metalink --help=#bittorrent --help=#cookie --help=#hook --help=#file --help=#rpc --help=#checksum --help=#experimental --help=#deprecated --help=#help --help=#all --max-overall-download-limit --event-poll --http-accept-gzip --http-accept-gzip=false --metalink-file --all-proxy --disk-cache --hash-check-only --hash-check-only=false --dht-listen-addr6 --human-readable --human-readable=false --ftp-user --all-proxy-passwd --bt-exclude-tracker --pause-metadata --pause-metadata=false --http-proxy-user --deferred-input --deferred-input=false --metalink-enable-unique-protocol --metalink-enable-unique-protocol=false --stop --max-upload-limit --multiple-interface --realtime-chunk-checksum --realtime-chunk-checksum=false --http-no-cache --http-no-cache=false --ca-certificate --bt-force-encryption --bt-force-encryption=false --bt-save-metadata --bt-save-metadata=false --seed-ratio --follow-torrent --pause --pause=false --checksum --auto-save-interval --async-dns --async-dns=false --bt-enable-lpd --bt-enable-lpd=false --parameterized-uri --parameterized-uri=false --ftp-proxy-passwd --enable-rpc --enable-rpc=false --min-split-size --bt-seed-unverified --bt-seed-unverified=false --input-file --interface --enable-async-dns6 --enable-async-dns6=false --reuse-uri --reuse-uri=false --socket-recv-buffer-size --bt-request-peer-speed-limit --on-download-error --bt-metadata-only --bt-metadata-only=false ' -- "$cur" ) ) ;; *) _filedir '@(torrent|meta4|metalink|text|txt|list|lst)' diff --git a/doc/manual-src/en/aria2c.rst b/doc/manual-src/en/aria2c.rst index cce97da1..d6645709 100644 --- a/doc/manual-src/en/aria2c.rst +++ b/doc/manual-src/en/aria2c.rst @@ -43,7 +43,7 @@ Basic Options When ``FILE`` is specified as ``-``, aria2 will read the input from ``stdin``. See the `Input File`_ subsection for details. See also the :option:`--deferred-input` option. - See also the :option:`--save-session-file` option. + See also the :option:`--save-session` option. .. option:: -l, --log= @@ -170,8 +170,11 @@ HTTP/FTP/SFTP Options If aria2 receives "file not found" status from the remote HTTP/FTP servers NUM times without getting a single byte, then force the - download to fail. Specify ``0`` to disable this option. This options is - effective only when using HTTP/FTP servers. + download to fail. Specify ``0`` to disable this option. This options + is effective only when using HTTP/FTP servers. The number of retry + attempt is counted toward :option:`--max-tries`, so it should be + configured too. + Default: ``0`` .. option:: -m, --max-tries= @@ -639,6 +642,14 @@ BitTorrent Specific Options queue gets started. But be aware that seeding item is still recognized as active download in RPC method. Default: ``false`` +.. option:: --bt-enable-hook-after-hash-check[=true|false] + + Allow hook command invocation after hash check (see :option:`-V` + option) in BitTorrent download. By default, when hash check + succeeds, the command given by :option:`--on-bt-download-complete` + is executed. To disable this action, give ``false`` to this option. + Default: ``true`` + .. option:: --bt-enable-lpd[=true|false] Enable Local Peer Discovery. If a private flag is set in a torrent, @@ -1207,6 +1218,11 @@ Advanced Options and options at startup. Default: ``false`` + .. Warning:: + + :option:`--deferred-input` option will be disabled when + :option:`--save-session` is used together. + .. option:: --disable-ipv6[=true|false] Disable IPv6. This is useful if you have to use broken DNS and want @@ -1359,6 +1375,16 @@ Advanced Options downloads. Specifying 0 means no download result is kept. Default: ``1000`` +.. option:: --max-mmap-limit= + + Set the maximum file size to enable mmap (see + :option:`--enable-mmap` option). The file size is determined by the + sum of all files contained in one download. For example, if a + download contains 5 files, then file size is the total size of those + files. If file size is strictly greater than the size specified in + this option, mmap will be disabled. + Default: ``9223372036854775807`` + .. option:: --max-resume-failure-tries= When used with :option:`--always-resume=false, <--always-resume>` aria2 downloads file from @@ -1431,6 +1457,21 @@ Advanced Options See `Event Hook`_ for more details about COMMAND. Possible Values: ``/path/to/command`` + +.. option:: --optimize-concurrent-downloads[=true|false|:] + + Optimizes the number of concurrent downloads according to the + bandwidth available. aria2 uses the download speed observed in the + previous downloads to adapt the number of downloads launched in + parallel according to the rule N = A + B Log10(speed in Mbps). The + coefficients A and B can be customized in the option arguments with + A and B separated by a colon. The default values (A=5, B=25) lead to + using typically 5 parallel downloads on 1Mbps networks and above 50 + on 100Mbps networks. The number of parallel downloads remains + constrained under the maximum defined by the + :option:`--max-concurrent-downloads` parameter. + Default: ``false`` + .. option:: --piece-length= Set a piece length for HTTP/FTP downloads. This is the boundary when @@ -1540,16 +1581,16 @@ Advanced Options use meta data (e.g., BitTorrent and Metalink). In this case, there are some restrictions. - 1. magnet URI, and followed by torrent download - GID of BitTorrent meta data download is saved. - 2. URI to torrent file, and followed by torrent download - GID of torrent file download is saved. - 3. URI to metalink file, and followed by file downloads described in metalink file - GID of metalink file download is saved. - 4. local torrent file - GID of torrent download is saved. - 5. local metalink file - Any meaningful GID is not saved. + magnet URI, and followed by torrent download + GID of BitTorrent meta data download is saved. + URI to torrent file, and followed by torrent download + GID of torrent file download is saved. + URI to metalink file, and followed by file downloads described in metalink file + GID of metalink file download is saved. + local torrent file + GID of torrent download is saved. + local metalink file + Any meaningful GID is not saved. .. option:: --save-session-interval= @@ -1557,6 +1598,14 @@ Advanced Options :option:`--save-session` option every SEC seconds. If ``0`` is given, file will be saved only when aria2 exits. Default: ``0`` + +.. option:: --socket-recv-buffer-size= + + Set the maximum socket receive buffer in bytes. Specifing ``0`` + will disable this option. This value will be set to socket file + descriptor using ``SO_RCVBUF`` socket option with ``setsockopt()`` + call. Default: ``0`` + .. option:: --stop= Stop application after SEC seconds has passed. @@ -1954,6 +2003,7 @@ of URIs. These optional lines must start with white space(s). * :option:`always-resume <--always-resume>` * :option:`async-dns <--async-dns>` * :option:`auto-file-renaming <--auto-file-renaming>` + * :option:`bt-enable-hook-after-hash-check <--bt-enable-hook-after-hash-check>` * :option:`bt-enable-lpd <--bt-enable-lpd>` * :option:`bt-exclude-tracker <--bt-exclude-tracker>` * :option:`bt-external-ip <--bt-external-ip>` @@ -2015,6 +2065,7 @@ of URIs. These optional lines must start with white space(s). * :option:`max-connection-per-server <-x>` * :option:`max-download-limit <--max-download-limit>` * :option:`max-file-not-found <--max-file-not-found>` + * :option:`max-mmap-limit <--max-mmap-limit>` * :option:`max-resume-failure-tries <--max-resume-failure-tries>` * :option:`max-tries <-m>` * :option:`max-upload-limit <-u>` @@ -2203,6 +2254,10 @@ to provide the token as the first parameter as described above. interface. Therefore it is recommended to prefer Batch or `system.multicall` requests when appropriate. + `system.listMethods` can be executed without token. Since it just + returns the all available methods, and does not alter anything, it + is safe without secret token. + Methods ~~~~~~~ @@ -2305,7 +2360,7 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') - >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read())) + >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read())) '2089b05ecca3d829' .. function:: aria2.addMetalink([secret], metalink[, options[, position]]) @@ -2351,7 +2406,7 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') - >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4').read())) + >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4', mode='rb').read())) ['2089b05ecca3d829'] .. function:: aria2.remove([secret], gid) @@ -2478,6 +2533,10 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. ``numSeeders`` The number of seeders aria2 has connected to. BitTorrent only. + ``seeder`` + ``true`` if the local endpoint is a seeder. Otherwise ``false``. + BitTorrent only. + ``pieceLength`` Piece length in bytes. @@ -2492,6 +2551,10 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. is a string. The error codes are defined in the `EXIT STATUS`_ section. This value is only available for stopped/completed downloads. + ``errorMessage`` + The (hopefully) human readable error message associated to + ``errorCode``. + ``followedBy`` List of GIDs which are generated as the result of this download. For example, when aria2 downloads a Metalink file, it @@ -2500,6 +2563,10 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. auto-generated downloads. If there are no such downloads, this key will not be included in the response. + ``following`` + The reverse link for ``followedBy``. A download included in + ``followedBy`` has this object's GID in its ``following`` value. + ``belongsTo`` GID of a parent download. Some downloads are a part of another download. For example, if a file in a Metalink has BitTorrent @@ -2768,7 +2835,7 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. Upload speed(byte/sec) that this client uploads to the peer. ``seeder`` - ``true`` is this peer is a seeder. Otherwise ``false``. + ``true`` if this peer is a seeder. Otherwise ``false``. **JSON-RPC Example** :: @@ -3139,6 +3206,7 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. * :option:`max-download-result <--max-download-result>` * :option:`max-overall-download-limit <--max-overall-download-limit>` * :option:`max-overall-upload-limit <--max-overall-upload-limit>` + * :option:`optimize-concurrent-downloads <--optimize-concurrent-downloads>` * :option:`save-cookies <--save-cookies>` * :option:`save-session <--save-session>` * :option:`server-stat-of <--server-stat-of>` @@ -3395,11 +3463,41 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> mc = xmlrpclib.MultiCall(s) >>> mc.aria2.addUri(['http://example.org/file']) - >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read())) + >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read())) >>> r = mc() >>> tuple(r) ('2089b05ecca3d829', 'd2703803b52216d1') +.. function:: system.listMethods() + + This method returns the all available RPC methods in an array of + string. Unlike other methods, this method does not require secret + token. This is safe because this method jsut returns the available + method names. + + **JSON-RPC Example** + :: + + >>> import urllib2, json + >>> from pprint import pprint + >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', + ... 'method':'system.listMethods'}) + >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) + >>> pprint(json.loads(c.read())) + {u'id': u'qwer', + u'jsonrpc': u'2.0', + u'result': [u'aria2.addUri', + u'aria2.addTorrent', + ... + + **XML-RPC Example** + :: + + >>> import xmlrpclib + >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') + >>> s.system.listMethods() + ['aria2.addUri', 'aria2.addTorrent', ... + Error Handling ~~~~~~~~~~~~~~ @@ -4154,7 +4252,7 @@ Encrypt the whole payload using ARC4 (obfuscation): SEE ALSO -------- -Project Web Site: http://aria2.sourceforge.net/ +Project Web Site: https://aria2.github.io/ Metalink Homepage: http://www.metalinker.org/ diff --git a/doc/manual-src/pt/README.rst b/doc/manual-src/pt/README.rst index 07e90e74..fe2deb96 100644 --- a/doc/manual-src/pt/README.rst +++ b/doc/manual-src/pt/README.rst @@ -8,17 +8,17 @@ windows, linux, manual download aria2, torrent, download stream, como compilar programa no android, como executar download no android - :author: t-tujikawa_at_users_dot_sourceforge_dot_net english version + :author: tatsuhiro.t_at_gmail_dot_com english version :author: gsavix@gmail.com tradução para português do brasil aria2 - Utilitário para Download Super Ultra Rápido =================================================== :Author: Tatsuhiro Tsujikawa -:Email: t-tujikawa_at_users_dot_sourceforge_dot_net +:Email: tatsuhiro.t_at_gmail_dot_com :translator: pt_BR Portuguese, tradutor: gsavix@gmail.com -.. index:: double: author; t-tujikawa_at_users_dot_sourceforge_dot_net +.. index:: double: author; tatsuhiro.t_at_gmail_dot_com .. index:: triple: tradutor; tradução; gsavix@gmail.com; Renúncia @@ -39,10 +39,9 @@ para você ir assistindo um filme enquanto o download prossegue. Através da verificação (checksum) de partes dos dados dos Metalink's, aria2 automaticamente valida partes (chunks) do BitTorrent. -A página do projeto está em http://aria2.sourceforge.net/. +A página do projeto está em https://aria2.github.io/. -Veja `aria2 Manual Online `_ -e `Exemplos de Uso `_ +Veja `aria2 Manual Online `_ para aprender como a usar aria2. Funcionalidades @@ -396,9 +395,9 @@ Como usar comandos do aria2 no Android -------------------------------------- Ver o manual do aria2 online nos seguintes idiomas: -`Tradução em Português `_. -`Original em Inglês `_. -`Tradução em Russo `_. +`Tradução em Português `_. +`Original em Inglês `_. +`Tradução em Russo `_. Notas sobre uso do aria2 no Android ----------------------------------- @@ -463,10 +462,10 @@ certifique-se de que os pré-requisitos de fontes usados pelo latex estejam presentes. A versão online HTML também está disponível em: -`Original em Inglês `_ +`Original em Inglês `_ e nas traduções em: -(`Português `_ e -`Russo `_). +(`Português `_ e +`Russo `_). BitTorrrent =========== @@ -597,17 +596,15 @@ Referências =========== * `aria2 Manual Inglês - `_ original inglês + `_ original inglês * `aria2 Manual Russo - `_ versão russo + `_ versão russo * `aria2 Manual Português - `_ versão português + `_ versão português -* http://aria2.sourceforge.net/ -* http://sourceforge.net/apps/trac/aria2/wiki -* https://github.com/tatsuhiro-t/aria2 +* https://aria2.github.io/ * `RFC 959 FILE TRANSFER PROTOCOL (FTP) `_ * `RFC 1738 Uniform Resource Locators (URL) diff --git a/doc/manual-src/pt/aria2c.rst b/doc/manual-src/pt/aria2c.rst index 64640d9d..ad332745 100644 --- a/doc/manual-src/pt/aria2c.rst +++ b/doc/manual-src/pt/aria2c.rst @@ -3959,9 +3959,7 @@ Criptografar todo conjunto usando ARC4: Ver Também ---------- -Site do Projeto aria2: http://aria2.sourceforge.net/ - -Wiki aria2: http://sourceforge.net/apps/trac/aria2/wiki +Site do Projeto aria2: https://aria2.github.io/ Site do Projeto Metalink: http://www.metalinker.org/ diff --git a/doc/manual-src/ru/aria2c.rst b/doc/manual-src/ru/aria2c.rst index 84405c25..e2af9c86 100644 --- a/doc/manual-src/ru/aria2c.rst +++ b/doc/manual-src/ru/aria2c.rst @@ -44,7 +44,7 @@ HTTP(S)/FTP, они тут же могут выгружаться в BitTorrent- Входной файл может использовать gzip-сжатие. Смотрите подраздел `Входной файл`_ для детальных пояснений. Также смотрите параметр :option:`--deferred-input`. - Также смотрите параметр :option:`--save-session-file`. + Также смотрите параметр :option:`--save-session`. .. option:: -l, --log= @@ -181,7 +181,10 @@ HTTP(S)/FTP, они тут же могут выгружаться в BitTorrent- удаленных HTTP/FTP-серверов NUM раз без получения, хотя бы одного байта, тогда принудительно отказывается от загрузки. Укажите ``0``, чтобы отключить этот параметр. Этот параметр действенен только, когда - используются HTTP/FTP-серверы. + используются HTTP/FTP-серверы. Количество повторных попыток засчитывается в + :option:`--max-tries`, таким образом, этот параметр также должен быть + сконфигурирован. + По умолчанию: ``0`` .. option:: -m, --max-tries= @@ -665,6 +668,15 @@ HTTP(S)/FTP, они тут же могут выгружаться в BitTorrent- загрузка стартует. Но знайте, что в RPC-методе сидирующий элемент всё ещё признаётся как активная загрузка. По умолчанию: ``false`` +.. option:: --bt-enable-hook-after-hash-check[=true|false] + + Позволяет перехватить команду вызова (управление) после проверки хэша + (см. параметр :option:`-V`) в BitTorrent-загрузке. По умолчанию, когда + проверка хэша завершилась удачно, выполняется команда заданная в + :option:`--on-bt-download-complete`. + Укажите для этого параметра ``false``, чтобы отключить это действие. + По умолчанию: ``true`` + .. option:: --bt-enable-lpd[=true|false] Включить поиск локальных пиров. Если в torrent-файле установлен @@ -1283,6 +1295,11 @@ HTTP(S)/FTP, они тут же могут выгружаться в BitTorrent- и параметры. По умолчанию: ``false`` + .. Warning:: + + параметр :option:`--deferred-input` будет заблокирован, если + используется вместе с :option:`--save-session`. + .. option:: --disable-ipv6[=true|false] Отключить IPv6. Это полезно, если вы используете поврежденный DNS @@ -1443,6 +1460,15 @@ HTTP(S)/FTP, они тут же могут выгружаться в BitTorrent- загрузок. Значение 0 отключит сохранение результата загрузки. По умолчанию: ``1000`` +.. option:: --max-mmap-limit= + + Задать максимальный размер файла для включения mmap (см. параметр + :option:`--enable-mmap`). Размер файла определяется по сумме всех файлов, + содержащихся в одной загрузке. Например, если загрузка содержит 5 файлов, то + размер файла - это суммарный размер этих файлов. Если размер файла строго больше + чем размер, указанный в этом параметре, то mmap будет отключён. + По умолчанию: ``9223372036854775807`` + .. option:: --max-resume-failure-tries= Если параметр :option:`--always-resume=false, <--always-resume>` aria2 @@ -1523,6 +1549,21 @@ HTTP(S)/FTP, они тут же могут выгружаться в BitTorrent- для более подробной информации о COMMAND. Возможные значения: ``/путь/к/команде`` + +.. option:: --optimize-concurrent-downloads[=true|false|:] + + Оптимизирует количество одновременных загрузок в соответствии с + доступной полосой пропускания. aria2 использует скорость загрузки, + наблюдаемую в предыдущих загрузках, чтобы адаптировать количество + загрузок, запущенных параллельно согласно правилу N = A + B Log10 + (скорость в Мбит/c). Коэффициенты А и В могут быть настроены в + аргументах А и В, разделённых двоеточием. Значения по умолчанию + (A=5, B=25) приводят к использованию обычно 5 параллельных загрузок + в сетях с 1Мбит/с и более 50 в сетях с 100 Мбит/с. Число параллельных + загрузок остаётся ограниченно максимумом, определяемом в параметре + :option:`--max-concurrent-downloads`. + По умолчанию: ``false`` + .. option:: --piece-length= Задать длину блока для HTTP/FTP-загрузок. Это является границей, когда @@ -1634,16 +1675,16 @@ HTTP(S)/FTP, они тут же могут выгружаться в BitTorrent- используют метаданные (например, BitTorrent и Metalink). В этом случае есть некоторые ограничения. - 1. magnet-ссылка, и последующая torrent-загрузка - Сохранится GID из метаданных BitTorrent-загрузки. - 2. URI к torrent-файл, и последующая torrent-загрузка - Сохранится GID из torrent-файла загрузки. - 3. URI к metalink-файл, и последующая загрузка файлов, описанных metalink-файле - Сохранится GID из metalink-файла загрузки. - 4. Локальный torrent-файл - Сохранится GID из torrent-загрузки. - 5. Локальный metalink-файл - Никакой значимый GID не сохранится. + magnet-ссылка, и последующая torrent-загрузка + Сохранится GID из метаданных BitTorrent-загрузки. + URI к torrent-файл, и последующая torrent-загрузка + Сохранится GID из torrent-файла загрузки. + URI к metalink-файл, и последующая загрузка файлов, описанных metalink-файле + Сохранится GID из metalink-файла загрузки. + Локальный torrent-файл + Сохранится GID из torrent-загрузки. + Локальный metalink-файл + Никакой значимый GID не сохранится. .. option:: --save-session-interval= @@ -1652,6 +1693,14 @@ HTTP(S)/FTP, они тут же могут выгружаться в BitTorrent- Если указан ``0``, то файл будет сохранён только тогда, когда aria2 завершит работу. По умолчанию: ``0`` + +.. option:: --socket-recv-buffer-size= + + Задать максимальный приёмный буфер сокета в байтах. Указание ``0`` + отключит этот параметр. Это значение будет установлено для дескриптора + файла сокета с помощью ``SO_RCVBUF``, параметра сокета в вызове ``setsockopt()``. + По умолчанию: ``0`` + .. option:: --stop= Останавливать программу после того как пройдет @@ -2063,6 +2112,7 @@ URI. Эти дополнительные строки должны начина * :option:`always-resume <--always-resume>` * :option:`async-dns <--async-dns>` * :option:`auto-file-renaming <--auto-file-renaming>` + * :option:`bt-enable-hook-after-hash-check <--bt-enable-hook-after-hash-check>` * :option:`bt-enable-lpd <--bt-enable-lpd>` * :option:`bt-exclude-tracker <--bt-exclude-tracker>` * :option:`bt-external-ip <--bt-external-ip>` @@ -2124,6 +2174,7 @@ URI. Эти дополнительные строки должны начина * :option:`max-connection-per-server <-x>` * :option:`max-download-limit <--max-download-limit>` * :option:`max-file-not-found <--max-file-not-found>` + * :option:`max-mmap-limit <--max-mmap-limit>` * :option:`max-resume-failure-tries <--max-resume-failure-tries>` * :option:`max-tries <-m>` * :option:`max-upload-limit <-u>` @@ -2313,6 +2364,10 @@ RPC-метод `system.multicall` обрабатывается особым об против RPC-интерфейса. Поэтому рекомендуется отдавать предпочтение пакетным или `system.multicall` запросам, когда это необходимо. + `system.listMethods` может выполняться без секретного маркера. Так он + просто возвращает все доступные методы, и ничего не изменяет, это + безопасно без секретного маркера. + Методы ~~~~~~ @@ -2416,7 +2471,7 @@ RPC-метод `system.multicall` обрабатывается особым об >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') - >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read())) + >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read())) '2089b05ecca3d829' .. function:: aria2.addMetalink([secret], metalink[, options[, position]]) @@ -2461,7 +2516,7 @@ RPC-метод `system.multicall` обрабатывается особым об >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') - >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4').read())) + >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4', mode='rb').read())) ['2089b05ecca3d829'] .. function:: aria2.remove([secret], gid) @@ -2588,6 +2643,10 @@ RPC-метод `system.multicall` обрабатывается особым об ``numSeeders`` Количество сидов, к которым подключена aria2. Только для BitTorrent. + ``seeder`` + ``true`` - если локальная конечная точка является сидом. Иначе ``false``. + Только для BitTorrent. + ``pieceLength`` Размер блока в байтах. @@ -2602,6 +2661,10 @@ RPC-метод `system.multicall` обрабатывается особым об является строкой. Коды ошибок определены в разделе `КОДЫ ЗАВЕРШЕНИЯ`_. Это значение доступно только для остановленных/завершённых загрузок. + ``errorMessage`` + Сообщение об ошибке, удобное (надеюсь) для восприятия, + связанной с ``errorCode``. + ``followedBy`` Список с GID, которые сгенерируются в результате этой загрузки. Например, когда aria2 загружает Metalink-файл, то это генерирует @@ -2610,6 +2673,10 @@ RPC-метод `system.multicall` обрабатывается особым об сгенерированных загрузок. Если таких загрузок нет, то ключ не будет включён в ответ. + ``following`` + Обратная ссылка для ``followedBy``. У загрузки, включённой в + ``followedBy``, есть GID этого объекта в этом значении ``following``. + ``belongsTo`` GID родительской загрузки. Некоторые загрузки являются частью другой загрузки. Например, если файл в Metalink содержит BitTorrent ресурсы, @@ -2774,7 +2841,7 @@ RPC-метод `system.multicall` обрабатывается особым об .. function:: aria2.getFiles([secret], gid) Этот метод возвращает список файлов загрузки, которая обозначена *gid* (строка). - Ответ - это массив и содержит следующие ключи. + Ответ - это массив структур, которые содержат следующие ключи. Значения являются строками. ``index`` @@ -3241,6 +3308,7 @@ RPC-метод `system.multicall` обрабатывается особым об * :option:`max-download-result <--max-download-result>` * :option:`max-overall-download-limit <--max-overall-download-limit>` * :option:`max-overall-upload-limit <--max-overall-upload-limit>` + * :option:`optimize-concurrent-downloads <--optimize-concurrent-downloads>` * :option:`save-cookies <--save-cookies>` * :option:`save-session <--save-session>` * :option:`server-stat-of <--server-stat-of>` @@ -3497,11 +3565,41 @@ RPC-метод `system.multicall` обрабатывается особым об >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> mc = xmlrpclib.MultiCall(s) >>> mc.aria2.addUri(['http://example.org/file']) - >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read())) + >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read())) >>> r = mc() >>> tuple(r) ('2089b05ecca3d829', 'd2703803b52216d1') +.. function:: system.listMethods() + + Этот метод возвращает все доступные RPC-методы в массиве строк. + В отличие от других методов, этот метод не требует секретный маркер. + Это безопасно, потому что этот метод просто возвращает названия доступных + методов. + + **Пример JSON-RPC** + :: + + >>> import urllib2, json + >>> from pprint import pprint + >>> jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', + ... 'method':'system.listMethods'}) + >>> c = urllib2.urlopen('http://localhost:6800/jsonrpc', jsonreq) + >>> pprint(json.loads(c.read())) + {u'id': u'qwer', + u'jsonrpc': u'2.0', + u'result': [u'aria2.addUri', + u'aria2.addTorrent', + ... + + **Пример XML-RPC** + :: + + >>> import xmlrpclib + >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') + >>> s.system.listMethods() + ['aria2.addUri', 'aria2.addTorrent', ... + Обработка ошибок ~~~~~~~~~~~~~~~~ @@ -4265,7 +4363,7 @@ RPC СМОТРИТЕ ТАКЖЕ -------------- -Веб-сайт проекта: http://aria2.sourceforge.net/ +Веб-сайт проекта: https://aria2.github.io/ Домашняя страница Metalink: http://www.metalinker.org/ @@ -4273,7 +4371,7 @@ RPC АВТОРСКОЕ ПРАВО --------------- -Авторское право (C) 2006, 2014 Tatsuhiro Tsujikawa +Авторское право (C) 2006, 2015 Tatsuhiro Tsujikawa Эта программа является свободным программным обеспечением; вы можете распространять его и/или изменять его в соответствии с условиями лицензии diff --git a/doc/sphinx_themes/sphinx_rtd_theme/__init__.py b/doc/sphinx_themes/sphinx_rtd_theme/__init__.py index 95ddc52a..88ddcce2 100644 --- a/doc/sphinx_themes/sphinx_rtd_theme/__init__.py +++ b/doc/sphinx_themes/sphinx_rtd_theme/__init__.py @@ -5,7 +5,7 @@ From https://github.com/ryan-roemer/sphinx-bootstrap-theme. """ import os -VERSION = (0, 1, 8) +VERSION = (0, 1, 9) __version__ = ".".join(str(v) for v in VERSION) __version_full__ = __version__ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/breadcrumbs.html b/doc/sphinx_themes/sphinx_rtd_theme/breadcrumbs.html index 0028421e..7c2ce5c8 100644 --- a/doc/sphinx_themes/sphinx_rtd_theme/breadcrumbs.html +++ b/doc/sphinx_themes/sphinx_rtd_theme/breadcrumbs.html @@ -1,23 +1,31 @@ +{# Support for Sphinx 1.3+ page_source_suffix, but don't break old builds. #} + +{% if page_source_suffix %} +{% set suffix = page_source_suffix %} +{% else %} +{% set suffix = source_suffix %} +{% endif %} + diff --git a/doc/sphinx_themes/sphinx_rtd_theme/footer.html b/doc/sphinx_themes/sphinx_rtd_theme/footer.html index 6347a440..f4396eec 100644 --- a/doc/sphinx_themes/sphinx_rtd_theme/footer.html +++ b/doc/sphinx_themes/sphinx_rtd_theme/footer.html @@ -22,9 +22,23 @@ {%- endif %} {%- endif %} - {%- if last_updated %} + {%- if build_id and build_url %} + {% trans build_url=build_url, build_id=build_id %} + + Build + {{ build_id }}. + + {% endtrans %} + {%- elif commit %} + {% trans commit=commit %} + + Revision {{ commit }}. + + {% endtrans %} + {%- elif last_updated %} {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} {%- endif %} +

@@ -32,5 +46,7 @@ {% trans %}Built with Sphinx using a theme provided by Read the Docs{% endtrans %}. {%- endif %} + {%- block extrafooter %} {% endblock %} + diff --git a/doc/sphinx_themes/sphinx_rtd_theme/layout.html b/doc/sphinx_themes/sphinx_rtd_theme/layout.html index 9481d8b4..44978c96 100644 --- a/doc/sphinx_themes/sphinx_rtd_theme/layout.html +++ b/doc/sphinx_themes/sphinx_rtd_theme/layout.html @@ -75,7 +75,7 @@ {%- block extrahead %} {% endblock %} {# Keep modernizr in head - http://modernizr.com/docs/#installing #} - + @@ -85,38 +85,51 @@ {# SIDE NAV, TOGGLES ON MOBILE #}
@@ -132,8 +145,10 @@
{% include "breadcrumbs.html" %} -
+
+
{% block body %}{% endblock %} +
{% include "footer.html" %}
diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/css/badge_only.css.map b/doc/sphinx_themes/sphinx_rtd_theme/static/css/badge_only.css.map index b09cc628..9d07b87a 100644 --- a/doc/sphinx_themes/sphinx_rtd_theme/static/css/badge_only.css.map +++ b/doc/sphinx_themes/sphinx_rtd_theme/static/css/badge_only.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "CAyDA,SAAY,EACV,qBAAsB,EAAE,UAAW,EAqDrC,QAAS,EARP,IAAK,EAAE,AAAC,EACR,+BAAS,EAEP,MAAO,EAAE,IAAK,EACd,MAAO,EAAE,CAAE,EACb,cAAO,EACL,IAAK,EAAE,GAAI,EC1Gb,SAkBC,EAjBC,UAAW,ECFJ,UAAW,EDGlB,UAAW,EAHqC,KAAM,EAItD,SAAU,EAJsD,KAAM,EAapE,EAAG,EAAE,qCAAwB,EAC7B,EAAG,EAAE,0PAAyE,ECZpF,SAAU,EACR,MAAO,EAAE,WAAY,EACrB,UAAW,EAAE,UAAW,EACxB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B,QAAS,EAAE,EAAG,EACd,MAAO,EAAE,GAAqB,EAC9B,IAAK,EEP6B,GAAY,EFQ9C,MAAO,EAAE,GAAI,EACb,mCAAE,EACA,MAAO,EAAE,IAAK,EACd,KAAM,EAAE,EAAG,EACX,KAAM,EAAE,AAAC,EACT,KAAM,EAAE,KAAM,EACd,MAAO,EAAE,AAAC,EACV,SAAU,EAAE,gBAA6C,EAC3D,mCAAE,EACA,MAAO,EAAE,WAAY,EACrB,KAAM,EAAE,AAAC,EACT,qCAAC,EACC,MAAO,EAAE,WAAY,EACrB,MAAO,EAAE,EAAqB,EAC9B,IAAK,EEfyB,MAAyB,EFgB7D,sBAAW,EACT,IAAK,EAAE,GAAI,EACX,KAAM,EAAE,GAAI,EACZ,IAAK,EAAE,GAAI,EACX,GAAI,EAAE,GAAI,EACV,KAAM,EAAE,GAAI,EACZ,QAAS,ECkByB,IAAK,EDjBvC,iCAAU,EACR,IAAK,EAAE,GAAI,EACb,+BAAQ,EACN,IAAK,EAAE,GAAI,EACb,oDAA+B,EAC7B,SAAU,EAAE,IAAK,EACjB,6DAAQ,EACN,IAAK,EAAE,GAAI,EACb,+DAAU,EACR,IAAK,EAAE,GAAI,EACf,2CAAoB,EAClB,IAAK,EAAE,GAAI,EACX,KAAM,EAAE,GAAI,EACZ,UAAW,EAAE,GAAI,EACjB,MAAO,EAAE,IAAuB,EAChC,MAAO,EAAE,IAAK,EACd,SAAU,EAAE,KAAM,EGhDpB,mCAAsB,EHmDxB,YAAa,EACX,IAAK,EAAE,EAAG,EACV,MAAO,EAAE,GAAI,EACb,kBAAO,EACL,MAAO,EAAE,IAAK,EAClB,EAAG,EACD,IAAK,EAAE,GAAI,EACX,KAAM,EAAE,GAAI", "sources": ["../../../bower_components/wyrm/sass/wyrm_core/_mixin.sass","../../../bower_components/bourbon/dist/css3/_font-face.scss","../../../sass/_theme_badge_fa.sass","../../../sass/_theme_badge.sass","../../../bower_components/wyrm/sass/wyrm_core/_wy_variables.sass","../../../sass/_theme_variables.sass","../../../bower_components/neat/app/assets/stylesheets/grid/_media.scss"], "names": [], "file": "badge_only.css" diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css b/doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css index 57b98fe6..7be93399 100644 --- a/doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css +++ b/doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css @@ -1,5 +1,5 @@ -*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:hover,a:active{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;color:#000;text-decoration:none}mark{background:#ff0;color:#000;font-style:italic;font-weight:bold}pre,code,.rst-content tt,.rst-content code,kbd,samp{font-family:monospace,serif;_font-family:"courier new",monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:before,q:after{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}ul,ol,dl{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:0;margin:0;padding:0}label{cursor:pointer}legend{border:0;*margin-left:-7px;padding:0;white-space:normal}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*width:13px;*height:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top;resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:0.2em 0;background:#ccc;color:#000;padding:0.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none !important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{html,body,section{background:none !important}*{box-shadow:none !important;text-shadow:none !important;filter:none !important;-ms-filter:none !important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,.rst-content p.caption,h3{orphans:3;widows:3}h2,.rst-content p.caption,h3{page-break-after:avoid}}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.btn,input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"],select,textarea,.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a,.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a,.wy-nav-top a{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}/*! +*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:hover,a:active{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;color:#000;text-decoration:none}mark{background:#ff0;color:#000;font-style:italic;font-weight:bold}pre,code,.rst-content tt,.rst-content code,kbd,samp{font-family:monospace,serif;_font-family:"courier new",monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:before,q:after{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}ul,ol,dl{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:0;margin:0;padding:0}label{cursor:pointer}legend{border:0;*margin-left:-7px;padding:0;white-space:normal}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*width:13px;*height:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top;resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:0.2em 0;background:#ccc;color:#000;padding:0.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none !important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{html,body,section{background:none !important}*{box-shadow:none !important;text-shadow:none !important;filter:none !important;-ms-filter:none !important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,.rst-content .toctree-wrapper p.caption,h3{orphans:3;widows:3}h2,.rst-content .toctree-wrapper p.caption,h3{page-break-after:avoid}}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.btn,input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"],select,textarea,.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a,.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a,.wy-nav-top a{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}/*! * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) - */@font-face{font-family:'FontAwesome';src:url("../fonts/fontawesome-webfont.eot?v=4.2.0");src:url("../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff?v=4.2.0") format("woff"),url("../fonts/fontawesome-webfont.ttf?v=4.2.0") format("truetype"),url("../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular") format("svg");font-weight:normal;font-style:normal}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content p.caption .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:0.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:0.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.wy-menu-vertical li span.pull-left.toctree-expand,.wy-menu-vertical li.on a span.pull-left.toctree-expand,.wy-menu-vertical li.current>a span.pull-left.toctree-expand,.rst-content .pull-left.admonition-title,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content p.caption .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content dl dt .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.rst-content code.download span.pull-left:first-child,.pull-left.icon{margin-right:.3em}.fa.pull-right,.wy-menu-vertical li span.pull-right.toctree-expand,.wy-menu-vertical li.on a span.pull-right.toctree-expand,.wy-menu-vertical li.current>a span.pull-right.toctree-expand,.rst-content .pull-right.admonition-title,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content p.caption .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content dl dt .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.rst-content code.download span.pull-right:first-child,.pull-right.icon{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-remove:before,.fa-close:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-gear:before,.fa-cog:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-rotate-right:before,.fa-repeat:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.rst-content .admonition-title:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-warning:before,.fa-exclamation-triangle:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-gears:before,.fa-cogs:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-save:before,.fa-floppy-o:before{content:""}.fa-square:before{content:""}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.wy-dropdown .caret:before,.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-unsorted:before,.fa-sort:before{content:""}.fa-sort-down:before,.fa-sort-desc:before{content:""}.fa-sort-up:before,.fa-sort-asc:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-legal:before,.fa-gavel:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-flash:before,.fa-bolt:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-paste:before,.fa-clipboard:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-unlink:before,.fa-chain-broken:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:""}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:""}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:""}.fa-euro:before,.fa-eur:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-rupee:before,.fa-inr:before{content:""}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:""}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:""}.fa-won:before,.fa-krw:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-turkish-lira:before,.fa-try:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li span.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-institution:before,.fa-bank:before,.fa-university:before{content:""}.fa-mortar-board:before,.fa-graduation-cap:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:""}.fa-file-zip-o:before,.fa-file-archive-o:before{content:""}.fa-file-sound-o:before,.fa-file-audio-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-ge:before,.fa-empire:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-send:before,.fa-paper-plane:before{content:""}.fa-send-o:before,.fa-paper-plane-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:""}.fa-meanpath:before{content:""}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content p.caption .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context{font-family:inherit}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before{font-family:"FontAwesome";display:inline-block;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa,a .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li a span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,a .rst-content .admonition-title,.rst-content a .admonition-title,a .rst-content h1 .headerlink,.rst-content h1 a .headerlink,a .rst-content h2 .headerlink,.rst-content h2 a .headerlink,a .rst-content p.caption .headerlink,.rst-content p.caption a .headerlink,a .rst-content h3 .headerlink,.rst-content h3 a .headerlink,a .rst-content h4 .headerlink,.rst-content h4 a .headerlink,a .rst-content h5 .headerlink,.rst-content h5 a .headerlink,a .rst-content h6 .headerlink,.rst-content h6 a .headerlink,a .rst-content dl dt .headerlink,.rst-content dl dt a .headerlink,a .rst-content tt.download span:first-child,.rst-content tt.download a span:first-child,a .rst-content code.download span:first-child,.rst-content code.download a span:first-child,a .icon{display:inline-block;text-decoration:inherit}.btn .fa,.btn .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .btn span.toctree-expand,.btn .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .btn span.toctree-expand,.btn .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .btn span.toctree-expand,.btn .rst-content .admonition-title,.rst-content .btn .admonition-title,.btn .rst-content h1 .headerlink,.rst-content h1 .btn .headerlink,.btn .rst-content h2 .headerlink,.rst-content h2 .btn .headerlink,.btn .rst-content p.caption .headerlink,.rst-content p.caption .btn .headerlink,.btn .rst-content h3 .headerlink,.rst-content h3 .btn .headerlink,.btn .rst-content h4 .headerlink,.rst-content h4 .btn .headerlink,.btn .rst-content h5 .headerlink,.rst-content h5 .btn .headerlink,.btn .rst-content h6 .headerlink,.rst-content h6 .btn .headerlink,.btn .rst-content dl dt .headerlink,.rst-content dl dt .btn .headerlink,.btn .rst-content tt.download span:first-child,.rst-content tt.download .btn span:first-child,.btn .rst-content code.download span:first-child,.rst-content code.download .btn span:first-child,.btn .icon,.nav .fa,.nav .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .nav span.toctree-expand,.nav .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .nav span.toctree-expand,.nav .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .nav span.toctree-expand,.nav .rst-content .admonition-title,.rst-content .nav .admonition-title,.nav .rst-content h1 .headerlink,.rst-content h1 .nav .headerlink,.nav .rst-content h2 .headerlink,.rst-content h2 .nav .headerlink,.nav .rst-content p.caption .headerlink,.rst-content p.caption .nav .headerlink,.nav .rst-content h3 .headerlink,.rst-content h3 .nav .headerlink,.nav .rst-content h4 .headerlink,.rst-content h4 .nav .headerlink,.nav .rst-content h5 .headerlink,.rst-content h5 .nav .headerlink,.nav .rst-content h6 .headerlink,.rst-content h6 .nav .headerlink,.nav .rst-content dl dt .headerlink,.rst-content dl dt .nav .headerlink,.nav .rst-content tt.download span:first-child,.rst-content tt.download .nav span:first-child,.nav .rst-content code.download span:first-child,.rst-content code.download .nav span:first-child,.nav .icon{display:inline}.btn .fa.fa-large,.btn .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .btn span.fa-large.toctree-expand,.btn .rst-content .fa-large.admonition-title,.rst-content .btn .fa-large.admonition-title,.btn .rst-content h1 .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.btn .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .btn .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.btn .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .btn .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .btn span.fa-large:first-child,.btn .rst-content code.download span.fa-large:first-child,.rst-content code.download .btn span.fa-large:first-child,.btn .fa-large.icon,.nav .fa.fa-large,.nav .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .nav span.fa-large.toctree-expand,.nav .rst-content .fa-large.admonition-title,.rst-content .nav .fa-large.admonition-title,.nav .rst-content h1 .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.nav .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .nav .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.nav .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.nav .rst-content code.download span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.nav .fa-large.icon{line-height:0.9em}.btn .fa.fa-spin,.btn .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .btn span.fa-spin.toctree-expand,.btn .rst-content .fa-spin.admonition-title,.rst-content .btn .fa-spin.admonition-title,.btn .rst-content h1 .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.btn .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .btn .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.btn .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .btn .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .btn span.fa-spin:first-child,.btn .rst-content code.download span.fa-spin:first-child,.rst-content code.download .btn span.fa-spin:first-child,.btn .fa-spin.icon,.nav .fa.fa-spin,.nav .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .nav span.fa-spin.toctree-expand,.nav .rst-content .fa-spin.admonition-title,.rst-content .nav .fa-spin.admonition-title,.nav .rst-content h1 .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.nav .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .nav .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.nav .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.nav .rst-content code.download span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.nav .fa-spin.icon{display:inline-block}.btn.fa:before,.wy-menu-vertical li span.btn.toctree-expand:before,.rst-content .btn.admonition-title:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content p.caption .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content dl dt .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.rst-content code.download span.btn:first-child:before,.btn.icon:before{opacity:0.5;-webkit-transition:opacity 0.05s ease-in;-moz-transition:opacity 0.05s ease-in;transition:opacity 0.05s ease-in}.btn.fa:hover:before,.wy-menu-vertical li span.btn.toctree-expand:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content p.caption .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.rst-content code.download span.btn:first-child:hover:before,.btn.icon:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li .btn-mini span.toctree-expand:before,.btn-mini .rst-content .admonition-title:before,.rst-content .btn-mini .admonition-title:before,.btn-mini .rst-content h1 .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.btn-mini .rst-content p.caption .headerlink:before,.rst-content p.caption .btn-mini .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.btn-mini .rst-content dl dt .headerlink:before,.rst-content dl dt .btn-mini .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.rst-content tt.download .btn-mini span:first-child:before,.btn-mini .rst-content code.download span:first-child:before,.rst-content code.download .btn-mini span:first-child:before,.btn-mini .icon:before{font-size:14px;vertical-align:-15%}.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.wy-alert-title,.rst-content .admonition-title{color:#fff;font-weight:bold;display:block;color:#fff;background:#6ab0de;margin:-12px;padding:6px 12px;margin-bottom:12px}.wy-alert.wy-alert-danger,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.admonition-todo{background:#fdf3f2}.wy-alert.wy-alert-danger .wy-alert-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .danger .wy-alert-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .danger .admonition-title,.rst-content .error .admonition-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title{background:#f29f97}.wy-alert.wy-alert-warning,.rst-content .wy-alert-warning.note,.rst-content .attention,.rst-content .caution,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.tip,.rst-content .warning,.rst-content .wy-alert-warning.seealso,.rst-content .admonition-todo{background:#ffedcc}.wy-alert.wy-alert-warning .wy-alert-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .attention .wy-alert-title,.rst-content .caution .wy-alert-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .admonition-todo .wy-alert-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .attention .admonition-title,.rst-content .caution .admonition-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .warning .admonition-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .admonition-todo .admonition-title{background:#f0b37e}.wy-alert.wy-alert-info,.rst-content .note,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.rst-content .seealso,.rst-content .wy-alert-info.admonition-todo{background:#e7f2fa}.wy-alert.wy-alert-info .wy-alert-title,.rst-content .note .wy-alert-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.rst-content .note .admonition-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .seealso .admonition-title,.rst-content .wy-alert-info.admonition-todo .admonition-title{background:#6ab0de}.wy-alert.wy-alert-success,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.warning,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.admonition-todo{background:#dbfaf4}.wy-alert.wy-alert-success .wy-alert-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .hint .wy-alert-title,.rst-content .important .wy-alert-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .hint .admonition-title,.rst-content .important .admonition-title,.rst-content .tip .admonition-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.admonition-todo .admonition-title{background:#1abc9c}.wy-alert.wy-alert-neutral,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.admonition-todo{background:#f3f6f6}.wy-alert.wy-alert-neutral .wy-alert-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .admonition-title{color:#404040;background:#e1e4e5}.wy-alert.wy-alert-neutral a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.admonition-todo a{color:#2980B9}.wy-alert p:last-child,.rst-content .note p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.rst-content .seealso p:last-child,.rst-content .admonition-todo p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0px;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,0.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all 0.3s ease-in;-moz-transition:all 0.3s ease-in;transition:all 0.3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27AE60}.wy-tray-container li.wy-tray-item-info{background:#2980B9}.wy-tray-container li.wy-tray-item-warning{background:#E67E22}.wy-tray-container li.wy-tray-item-danger{background:#E74C3C}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width: 768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px 12px;color:#fff;border:1px solid rgba(0,0,0,0.1);background-color:#27AE60;text-decoration:none;font-weight:normal;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:0px 1px 2px -1px rgba(255,255,255,0.5) inset,0px -2px 0px 0px rgba(0,0,0,0.1) inset;outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all 0.1s linear;-moz-transition:all 0.1s linear;transition:all 0.1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:0px -1px 0px 0px rgba(0,0,0,0.05) inset,0px 2px 0px 0px rgba(0,0,0,0.1) inset;padding:8px 12px 6px 12px}.btn:visited{color:#fff}.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn-disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn-disabled:hover,.btn-disabled:focus,.btn-disabled:active{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980B9 !important}.btn-info:hover{background-color:#2e8ece !important}.btn-neutral{background-color:#f3f6f6 !important;color:#404040 !important}.btn-neutral:hover{background-color:#e5ebeb !important;color:#404040}.btn-neutral:visited{color:#404040 !important}.btn-success{background-color:#27AE60 !important}.btn-success:hover{background-color:#295 !important}.btn-danger{background-color:#E74C3C !important}.btn-danger:hover{background-color:#ea6153 !important}.btn-warning{background-color:#E67E22 !important}.btn-warning:hover{background-color:#e98b39 !important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f !important}.btn-link{background-color:transparent !important;color:#2980B9;box-shadow:none;border-color:transparent !important}.btn-link:hover{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:active{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:visited{color:#9B59B6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:before,.wy-btn-group:after{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:solid 1px #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,0.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980B9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:solid 1px #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type="search"]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980B9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned input,.wy-form-aligned textarea,.wy-form-aligned select,.wy-form-aligned .wy-help-inline,.wy-form-aligned label{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{border:0;margin:0;padding:0}legend{display:block;width:100%;border:0;padding:0;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label{display:block;margin:0 0 0.3125em 0;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;*zoom:1;max-width:68em;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#E74C3C}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full input[type="text"],.wy-control-group .wy-form-full input[type="password"],.wy-control-group .wy-form-full input[type="email"],.wy-control-group .wy-form-full input[type="url"],.wy-control-group .wy-form-full input[type="date"],.wy-control-group .wy-form-full input[type="month"],.wy-control-group .wy-form-full input[type="time"],.wy-control-group .wy-form-full input[type="datetime"],.wy-control-group .wy-form-full input[type="datetime-local"],.wy-control-group .wy-form-full input[type="week"],.wy-control-group .wy-form-full input[type="number"],.wy-control-group .wy-form-full input[type="search"],.wy-control-group .wy-form-full input[type="tel"],.wy-control-group .wy-form-full input[type="color"],.wy-control-group .wy-form-halves input[type="text"],.wy-control-group .wy-form-halves input[type="password"],.wy-control-group .wy-form-halves input[type="email"],.wy-control-group .wy-form-halves input[type="url"],.wy-control-group .wy-form-halves input[type="date"],.wy-control-group .wy-form-halves input[type="month"],.wy-control-group .wy-form-halves input[type="time"],.wy-control-group .wy-form-halves input[type="datetime"],.wy-control-group .wy-form-halves input[type="datetime-local"],.wy-control-group .wy-form-halves input[type="week"],.wy-control-group .wy-form-halves input[type="number"],.wy-control-group .wy-form-halves input[type="search"],.wy-control-group .wy-form-halves input[type="tel"],.wy-control-group .wy-form-halves input[type="color"],.wy-control-group .wy-form-thirds input[type="text"],.wy-control-group .wy-form-thirds input[type="password"],.wy-control-group .wy-form-thirds input[type="email"],.wy-control-group .wy-form-thirds input[type="url"],.wy-control-group .wy-form-thirds input[type="date"],.wy-control-group .wy-form-thirds input[type="month"],.wy-control-group .wy-form-thirds input[type="time"],.wy-control-group .wy-form-thirds input[type="datetime"],.wy-control-group .wy-form-thirds input[type="datetime-local"],.wy-control-group .wy-form-thirds input[type="week"],.wy-control-group .wy-form-thirds input[type="number"],.wy-control-group .wy-form-thirds input[type="search"],.wy-control-group .wy-form-thirds input[type="tel"],.wy-control-group .wy-form-thirds input[type="color"]{width:100%}.wy-control-group .wy-form-full{float:left;display:block;margin-right:2.35765%;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child{margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n+1){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child{margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control{margin:6px 0 0 0;font-size:90%}.wy-control-no-input{display:inline-block;margin:6px 0 0 0;font-size:90%}.wy-control-group.fluid-input input[type="text"],.wy-control-group.fluid-input input[type="password"],.wy-control-group.fluid-input input[type="email"],.wy-control-group.fluid-input input[type="url"],.wy-control-group.fluid-input input[type="date"],.wy-control-group.fluid-input input[type="month"],.wy-control-group.fluid-input input[type="time"],.wy-control-group.fluid-input input[type="datetime"],.wy-control-group.fluid-input input[type="datetime-local"],.wy-control-group.fluid-input input[type="week"],.wy-control-group.fluid-input input[type="number"],.wy-control-group.fluid-input input[type="search"],.wy-control-group.fluid-input input[type="tel"],.wy-control-group.fluid-input input[type="color"]{width:100%}.wy-form-message-inline{display:inline-block;padding-left:0.3em;color:#666;vertical-align:middle;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:0.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;*overflow:visible}input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border 0.3s linear;-moz-transition:border 0.3s linear;transition:border 0.3s linear}input[type="datetime-local"]{padding:0.34375em 0.625em}input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin-right:0.3125em;*height:13px;*width:13px}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input[type="text"]:focus,input[type="password"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus{outline:0;outline:thin dotted \9;border-color:#333}input.no-focus:focus{border-color:#ccc !important}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:1px auto #129FEA}input[type="text"][disabled],input[type="password"][disabled],input[type="email"][disabled],input[type="url"][disabled],input[type="date"][disabled],input[type="month"][disabled],input[type="time"][disabled],input[type="datetime"][disabled],input[type="datetime-local"][disabled],input[type="week"][disabled],input[type="number"][disabled],input[type="search"][disabled],input[type="tel"][disabled],input[type="color"][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#E74C3C;border:1px solid #E74C3C}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#E74C3C}input[type="file"]:focus:invalid:focus,input[type="radio"]:focus:invalid:focus,input[type="checkbox"]:focus:invalid:focus{outline-color:#E74C3C}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif}select,textarea{padding:0.5em 0.625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border 0.3s linear;-moz-transition:border 0.3s linear;transition:border 0.3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type="radio"][disabled],input[type="checkbox"][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:solid 1px #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{width:36px;height:12px;margin:12px 0;position:relative;border-radius:4px;background:#ccc;cursor:pointer;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.wy-switch:before{position:absolute;content:"";display:block;width:18px;height:18px;border-radius:4px;background:#999;left:-3px;top:-3px;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.wy-switch:after{content:"false";position:absolute;left:48px;display:block;font-size:12px;color:#ccc}.wy-switch.active{background:#1e8449}.wy-switch.active:before{left:24px;background:#27AE60}.wy-switch.active:after{content:"true"}.wy-switch.disabled,.wy-switch.active.disabled{cursor:not-allowed}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#E74C3C}.wy-control-group.wy-control-group-error input[type="text"],.wy-control-group.wy-control-group-error input[type="password"],.wy-control-group.wy-control-group-error input[type="email"],.wy-control-group.wy-control-group-error input[type="url"],.wy-control-group.wy-control-group-error input[type="date"],.wy-control-group.wy-control-group-error input[type="month"],.wy-control-group.wy-control-group-error input[type="time"],.wy-control-group.wy-control-group-error input[type="datetime"],.wy-control-group.wy-control-group-error input[type="datetime-local"],.wy-control-group.wy-control-group-error input[type="week"],.wy-control-group.wy-control-group-error input[type="number"],.wy-control-group.wy-control-group-error input[type="search"],.wy-control-group.wy-control-group-error input[type="tel"],.wy-control-group.wy-control-group-error input[type="color"]{border:solid 1px #E74C3C}.wy-control-group.wy-control-group-error textarea{border:solid 1px #E74C3C}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:0.5em 0.625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27AE60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#E74C3C}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#E67E22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980B9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width: 480px){.wy-form button[type="submit"]{margin:0.7em 0 0}.wy-form input[type="text"],.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0.3em;display:block}.wy-form label{margin-bottom:0.3em;display:block}.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:0.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0 0}.wy-form .wy-help-inline,.wy-form-message-inline,.wy-form-message{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width: 768px){.tablet-hide{display:none}}@media screen and (max-width: 480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.wy-table,.rst-content table.docutils,.rst-content table.field-list{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.wy-table caption,.rst-content table.docutils caption,.rst-content table.field-list caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td,.wy-table th,.rst-content table.docutils th,.rst-content table.field-list th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.wy-table td:first-child,.rst-content table.docutils td:first-child,.rst-content table.field-list td:first-child,.wy-table th:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list th:first-child{border-left-width:0}.wy-table thead,.rst-content table.docutils thead,.rst-content table.field-list thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.wy-table thead th,.rst-content table.docutils thead th,.rst-content table.field-list thead th{font-weight:bold;border-bottom:solid 2px #e1e4e5}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td{background-color:transparent;vertical-align:middle}.wy-table td p,.rst-content table.docutils td p,.rst-content table.field-list td p{line-height:18px}.wy-table td p:last-child,.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child{margin-bottom:0}.wy-table .wy-table-cell-min,.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min{width:1%;padding-right:0}.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:gray;font-size:90%}.wy-table-tertiary{color:gray;font-size:80%}.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td,.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td{background-color:#f3f6f6}.wy-table-backed{background-color:#f3f6f6}.wy-table-bordered-all,.rst-content table.docutils{border:1px solid #e1e4e5}.wy-table-bordered-all td,.rst-content table.docutils td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.wy-table-bordered-all tbody>tr:last-child td,.rst-content table.docutils tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0 !important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980B9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9B59B6}html{height:100%;overflow-x:hidden}body{font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;font-weight:normal;color:#404040;min-height:100%;overflow-x:hidden;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#E67E22 !important}a.wy-text-warning:hover{color:#eb9950 !important}.wy-text-info{color:#2980B9 !important}a.wy-text-info:hover{color:#409ad5 !important}.wy-text-success{color:#27AE60 !important}a.wy-text-success:hover{color:#36d278 !important}.wy-text-danger{color:#E74C3C !important}a.wy-text-danger:hover{color:#ed7669 !important}.wy-text-neutral{color:#404040 !important}a.wy-text-neutral:hover{color:#595959 !important}h1,h2,.rst-content p.caption,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif}p{line-height:24px;margin:0;font-size:16px;margin-bottom:24px}h1{font-size:175%}h2,.rst-content p.caption{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}code,.rst-content tt,.rst-content code{white-space:nowrap;max-width:100%;background:#fff;border:solid 1px #e1e4e5;font-size:75%;padding:0 5px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;color:#E74C3C;overflow-x:auto}code.code-large,.rst-content tt.code-large{font-size:90%}.wy-plain-list-disc,.rst-content .section ul,.rst-content .toctree-wrapper ul,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.wy-plain-list-disc li,.rst-content .section ul li,.rst-content .toctree-wrapper ul li,article ul li{list-style:disc;margin-left:24px}.wy-plain-list-disc li p:last-child,.rst-content .section ul li p:last-child,.rst-content .toctree-wrapper ul li p:last-child,article ul li p:last-child{margin-bottom:0}.wy-plain-list-disc li ul,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li ul,article ul li ul{margin-bottom:0}.wy-plain-list-disc li li,.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,article ul li li{list-style:circle}.wy-plain-list-disc li li li,.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,article ul li li li{list-style:square}.wy-plain-list-disc li ol li,.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,article ul li ol li{list-style:decimal}.wy-plain-list-decimal,.rst-content .section ol,.rst-content ol.arabic,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.wy-plain-list-decimal li,.rst-content .section ol li,.rst-content ol.arabic li,article ol li{list-style:decimal;margin-left:24px}.wy-plain-list-decimal li p:last-child,.rst-content .section ol li p:last-child,.rst-content ol.arabic li p:last-child,article ol li p:last-child{margin-bottom:0}.wy-plain-list-decimal li ul,.rst-content .section ol li ul,.rst-content ol.arabic li ul,article ol li ul{margin-bottom:0}.wy-plain-list-decimal li ul li,.rst-content .section ol li ul li,.rst-content ol.arabic li ul li,article ol li ul li{list-style:disc}.codeblock-example{border:1px solid #e1e4e5;border-bottom:none;padding:24px;padding-top:48px;font-weight:500;background:#fff;position:relative}.codeblock-example:after{content:"Example";position:absolute;top:0px;left:0px;background:#9B59B6;color:#fff;padding:6px 12px}.codeblock-example.prettyprint-example-only{border:1px solid #e1e4e5;margin-bottom:24px}.codeblock,pre.literal-block,.rst-content .literal-block,.rst-content pre.literal-block,div[class^='highlight']{border:1px solid #e1e4e5;padding:0px;overflow-x:auto;background:#fff;margin:1px 0 24px 0}.codeblock div[class^='highlight'],pre.literal-block div[class^='highlight'],.rst-content .literal-block div[class^='highlight'],div[class^='highlight'] div[class^='highlight']{border:none;background:none;margin:0}div[class^='highlight'] td.code{width:100%}.linenodiv pre{border-right:solid 1px #e6e9ea;margin:0;padding:12px 12px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:12px;line-height:1.5;color:#d9d9d9}div[class^='highlight'] pre{white-space:pre;margin:0;padding:12px 12px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:12px;line-height:1.5;display:block;overflow:auto;color:#404040}@media print{.codeblock,pre.literal-block,.rst-content .literal-block,.rst-content pre.literal-block,div[class^='highlight'],div[class^='highlight'] pre{white-space:pre-wrap}}.hll{background-color:#ffc;margin:0 -12px;padding:0 12px;display:block}.c{color:#998;font-style:italic}.err{color:#a61717;background-color:#e3d2d2}.k{font-weight:bold}.o{font-weight:bold}.cm{color:#998;font-style:italic}.cp{color:#999;font-weight:bold}.c1{color:#998;font-style:italic}.cs{color:#999;font-weight:bold;font-style:italic}.gd{color:#000;background-color:#fdd}.gd .x{color:#000;background-color:#faa}.ge{font-style:italic}.gr{color:#a00}.gh{color:#999}.gi{color:#000;background-color:#dfd}.gi .x{color:#000;background-color:#afa}.go{color:#888}.gp{color:#555}.gs{font-weight:bold}.gu{color:purple;font-weight:bold}.gt{color:#a00}.kc{font-weight:bold}.kd{font-weight:bold}.kn{font-weight:bold}.kp{font-weight:bold}.kr{font-weight:bold}.kt{color:#458;font-weight:bold}.m{color:#099}.s{color:#d14}.n{color:#333}.na{color:teal}.nb{color:#0086b3}.nc{color:#458;font-weight:bold}.no{color:teal}.ni{color:purple}.ne{color:#900;font-weight:bold}.nf{color:#900;font-weight:bold}.nn{color:#555}.nt{color:navy}.nv{color:teal}.ow{font-weight:bold}.w{color:#bbb}.mf{color:#099}.mh{color:#099}.mi{color:#099}.mo{color:#099}.sb{color:#d14}.sc{color:#d14}.sd{color:#d14}.s2{color:#d14}.se{color:#d14}.sh{color:#d14}.si{color:#d14}.sx{color:#d14}.sr{color:#009926}.s1{color:#d14}.ss{color:#990073}.bp{color:#999}.vc{color:teal}.vg{color:teal}.vi{color:teal}.il{color:#099}.gc{color:#999;background-color:#EAF2F5}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width: 480px){.wy-breadcrumbs-extra{display:none}.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:before,.wy-menu-horiz:after{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz ul,.wy-menu-horiz li{display:inline-block}.wy-menu-horiz li:hover{background:rgba(255,255,255,0.1)}.wy-menu-horiz li.divide-left{border-left:solid 1px #404040}.wy-menu-horiz li.divide-right{border-right:solid 1px #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical header,.wy-menu-vertical p.caption{height:32px;display:inline-block;line-height:32px;padding:0 1.618em;margin-bottom:0;display:block;font-weight:bold;text-transform:uppercase;font-size:80%;color:#555;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:solid 1px #404040}.wy-menu-vertical li.divide-bottom{border-bottom:solid 1px #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:gray;border-right:solid 1px #c9c9c9;padding:0.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.wy-menu-vertical li code,.wy-menu-vertical li .rst-content tt,.rst-content .wy-menu-vertical li tt{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li span.toctree-expand{display:block;float:left;margin-left:-1.2em;font-size:0.8em;line-height:1.6em;color:#4d4d4d}.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a{color:#404040;padding:0.4045em 1.618em;font-weight:bold;position:relative;background:#fcfcfc;border:none;border-bottom:solid 1px #c9c9c9;border-top:solid 1px #c9c9c9;padding-left:1.618em -4px}.wy-menu-vertical li.on a:hover,.wy-menu-vertical li.current>a:hover{background:#fcfcfc}.wy-menu-vertical li.on a:hover span.toctree-expand,.wy-menu-vertical li.current>a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand{display:block;font-size:0.8em;line-height:1.6em;color:#333}.wy-menu-vertical li.toctree-l1.current li.toctree-l2>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>ul{display:none}.wy-menu-vertical li.toctree-l1.current li.toctree-l2.current>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3.current>ul{display:block}.wy-menu-vertical li.toctree-l2.current>a{background:#c9c9c9;padding:0.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{display:block;background:#c9c9c9;padding:0.4045em 4.045em}.wy-menu-vertical li.toctree-l2 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l2 span.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3{font-size:0.9em}.wy-menu-vertical li.toctree-l3.current>a{background:#bdbdbd;padding:0.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{display:block;background:#bdbdbd;padding:0.4045em 5.663em;border-top:none;border-bottom:none}.wy-menu-vertical li.toctree-l3 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l3 span.toctree-expand{color:#969696}.wy-menu-vertical li.toctree-l4{font-size:0.9em}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical .local-toc li ul{display:block}.wy-menu-vertical li ul li a{margin-bottom:0;color:#b3b3b3;font-weight:normal}.wy-menu-vertical a{display:inline-block;line-height:18px;padding:0.4045em 1.618em;display:block;position:relative;font-size:90%;color:#b3b3b3}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover span.toctree-expand{color:#b3b3b3}.wy-menu-vertical a:active{background-color:#2980B9;cursor:pointer;color:#fff}.wy-menu-vertical a:active span.toctree-expand{color:#fff}.wy-side-nav-search{z-index:200;background-color:#2980B9;text-align:center;padding:0.809em;display:block;color:#fcfcfc;margin-bottom:0.809em}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto 0.809em auto;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a{color:#fcfcfc;font-size:100%;font-weight:bold;display:inline-block;padding:4px 6px;margin-bottom:0.809em}.wy-side-nav-search>a:hover,.wy-side-nav-search .wy-dropdown>a:hover{background:rgba(255,255,255,0.1)}.wy-side-nav-search>a img.logo,.wy-side-nav-search .wy-dropdown>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search>a.icon img.logo,.wy-side-nav-search .wy-dropdown>a.icon img.logo{margin-top:0.85em}.wy-nav .wy-menu-vertical header{color:#2980B9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980B9;color:#fff}[data-menu-wrap]{-webkit-transition:all 0.2s ease-in;-moz-transition:all 0.2s ease-in;transition:all 0.2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:left repeat-y #fcfcfc;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2F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+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+EwrlwAAAAA5JREFUeNpiMDU0BAgwAAE2AJgB9BnaAAAAAElFTkSuQmCC);background-size:300px 1px}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:scroll;min-height:100%;background:#343131;z-index:200}.wy-nav-top{display:none;background:#2980B9;color:#fff;padding:0.4045em 0.809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:before,.wy-nav-top:after{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:bold}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,0.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:#999}footer p{margin-bottom:12px}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:before,.rst-footer-buttons:after{display:table;content:""}.rst-footer-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:solid 1px #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:solid 1px #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:gray;font-size:90%}@media screen and (max-width: 768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width: 1400px){.wy-nav-content-wrap{background:rgba(0,0,0,0.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,footer,.wy-nav-side{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version span.toctree-expand,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content p.caption .headerlink,.rst-content p.caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .icon{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}}.rst-content img{max-width:100%;height:auto !important}.rst-content div.figure{margin-bottom:24px}.rst-content div.figure.align-center{text-align:center}.rst-content .section>img,.rst-content .section>a>img{margin-bottom:24px}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content .note .last,.rst-content .attention .last,.rst-content .caution .last,.rst-content .danger .last,.rst-content .error .last,.rst-content .hint .last,.rst-content .important .last,.rst-content .tip .last,.rst-content .warning .last,.rst-content .seealso .last,.rst-content .admonition-todo .last{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,0.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent !important;border-color:rgba(0,0,0,0.1) !important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha li{list-style:upper-alpha}.rst-content .section ol p,.rst-content .section ul p{margin-bottom:12px}.rst-content .line-block{margin-left:24px}.rst-content .topic-title{font-weight:bold;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0px 0px 24px 24px}.rst-content .align-left{float:left;margin:0px 24px 24px 0px}.rst-content .align-center{margin:auto;display:block}.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content p.caption .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink{display:none;visibility:hidden;font-size:14px}.rst-content h1 .headerlink:after,.rst-content h2 .headerlink:after,.rst-content p.caption .headerlink:after,.rst-content h3 .headerlink:after,.rst-content h4 .headerlink:after,.rst-content h5 .headerlink:after,.rst-content h6 .headerlink:after,.rst-content dl dt .headerlink:after,.rst-content p.caption .headerlink:after{visibility:visible;content:"";font-family:FontAwesome;display:inline-block}.rst-content h1:hover .headerlink,.rst-content h2:hover .headerlink,.rst-content p.caption:hover .headerlink,.rst-content h3:hover .headerlink,.rst-content h4:hover .headerlink,.rst-content h5:hover .headerlink,.rst-content h6:hover .headerlink,.rst-content dl dt:hover .headerlink,.rst-content p.caption:hover .headerlink{display:inline-block}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:solid 1px #e1e4e5}.rst-content .sidebar p,.rst-content .sidebar ul,.rst-content .sidebar dl{font-size:90%}.rst-content .sidebar .last{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif;font-weight:bold;background:#e1e4e5;padding:6px 12px;margin:-24px;margin-bottom:24px;font-size:100%}.rst-content .highlighted{background:#F1C40F;display:inline-block;font-weight:bold;padding:0 6px}.rst-content .footnote-reference,.rst-content .citation-reference{vertical-align:super;font-size:90%}.rst-content table.docutils.citation,.rst-content table.docutils.footnote{background:none;border:none;color:#999}.rst-content table.docutils.citation td,.rst-content table.docutils.citation tr,.rst-content table.docutils.footnote td,.rst-content table.docutils.footnote tr{border:none;background-color:transparent !important;white-space:normal}.rst-content table.docutils.citation td.label,.rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}.rst-content table.field-list{border:none}.rst-content table.field-list td{border:none;padding-top:5px}.rst-content table.field-list td>strong{display:inline-block;margin-top:3px}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left;padding-left:0}.rst-content tt,.rst-content tt,.rst-content code{color:#000}.rst-content tt big,.rst-content tt em,.rst-content tt big,.rst-content code big,.rst-content tt em,.rst-content code em{font-size:100% !important;line-height:normal}.rst-content tt .xref,a .rst-content tt,.rst-content tt .xref,.rst-content code .xref,a .rst-content tt,a .rst-content code{font-weight:bold}.rst-content a tt,.rst-content a tt,.rst-content a code{color:#2980B9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:bold}.rst-content dl p,.rst-content dl table,.rst-content dl ul,.rst-content dl ol{margin-bottom:12px !important}.rst-content dl dd{margin:0 0 12px 24px}.rst-content dl:not(.docutils){margin-bottom:24px}.rst-content dl:not(.docutils) dt{display:inline-block;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980B9;border-top:solid 3px #6ab0de;padding:6px;position:relative}.rst-content dl:not(.docutils) dt:before{color:#6ab0de}.rst-content dl:not(.docutils) dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dl dt{margin-bottom:6px;border:none;border-left:solid 3px #ccc;background:#f0f0f0;color:gray}.rst-content dl:not(.docutils) dl dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dt:first-child{margin-top:0}.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) code{font-weight:bold}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) code.descclassname{background-color:transparent;border:none;padding:0;font-size:100% !important}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname{font-weight:bold}.rst-content dl:not(.docutils) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:bold}.rst-content dl:not(.docutils) .property{display:inline-block;padding-right:8px}.rst-content .viewcode-link,.rst-content .viewcode-back{display:inline-block;color:#27AE60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:bold}.rst-content tt.download,.rst-content code.download{background:inherit;padding:inherit;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{margin-right:4px}@media screen and (max-width: 480px){.rst-content .sidebar{width:100%}}span[id*='MathJax-Span']{color:#404040}.math{text-align:center}@font-face{font-family:"Inconsolata";font-style:normal;font-weight:400;src:local("Inconsolata"),url(../fonts/Inconsolata.ttf) format("truetype")}@font-face{font-family:"Inconsolata";font-style:normal;font-weight:700;src:local("Inconsolata Bold"),local("Inconsolata-Bold"),url(../fonts/Inconsolata-Bold.ttf) format("truetype")}@font-face{font-family:"Lato";font-style:normal;font-weight:400;src:local("Lato Regular"),local("Lato-Regular"),url(../fonts/Lato-Regular.ttf) format("truetype")}@font-face{font-family:"Lato";font-style:normal;font-weight:700;src:local("Lato Bold"),local("Lato-Bold"),url(../fonts/Lato-Bold.ttf) format("truetype")}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:400;src:local("Roboto Slab Regular"),local("RobotoSlab-Regular"),url(../fonts/RobotoSlab-Regular.ttf) format("truetype")}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:700;src:local("Roboto Slab Bold"),local("RobotoSlab-Bold"),url(../fonts/RobotoSlab-Bold.ttf) format("truetype")} + */@font-face{font-family:'FontAwesome';src:url("../fonts/fontawesome-webfont.eot?v=4.2.0");src:url("../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff?v=4.2.0") format("woff"),url("../fonts/fontawesome-webfont.ttf?v=4.2.0") format("truetype"),url("../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular") format("svg");font-weight:normal;font-style:normal}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:0.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:0.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.wy-menu-vertical li span.pull-left.toctree-expand,.wy-menu-vertical li.on a span.pull-left.toctree-expand,.wy-menu-vertical li.current>a span.pull-left.toctree-expand,.rst-content .pull-left.admonition-title,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content dl dt .pull-left.headerlink,.rst-content p.caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.rst-content code.download span.pull-left:first-child,.pull-left.icon{margin-right:.3em}.fa.pull-right,.wy-menu-vertical li span.pull-right.toctree-expand,.wy-menu-vertical li.on a span.pull-right.toctree-expand,.wy-menu-vertical li.current>a span.pull-right.toctree-expand,.rst-content .pull-right.admonition-title,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content dl dt .pull-right.headerlink,.rst-content p.caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.rst-content code.download span.pull-right:first-child,.pull-right.icon{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-remove:before,.fa-close:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-gear:before,.fa-cog:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-rotate-right:before,.fa-repeat:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.rst-content .admonition-title:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-warning:before,.fa-exclamation-triangle:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-gears:before,.fa-cogs:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-save:before,.fa-floppy-o:before{content:""}.fa-square:before{content:""}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.wy-dropdown .caret:before,.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-unsorted:before,.fa-sort:before{content:""}.fa-sort-down:before,.fa-sort-desc:before{content:""}.fa-sort-up:before,.fa-sort-asc:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-legal:before,.fa-gavel:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-flash:before,.fa-bolt:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-paste:before,.fa-clipboard:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-unlink:before,.fa-chain-broken:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:""}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:""}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:""}.fa-euro:before,.fa-eur:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-rupee:before,.fa-inr:before{content:""}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:""}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:""}.fa-won:before,.fa-krw:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-turkish-lira:before,.fa-try:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li span.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-institution:before,.fa-bank:before,.fa-university:before{content:""}.fa-mortar-board:before,.fa-graduation-cap:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:""}.fa-file-zip-o:before,.fa-file-archive-o:before{content:""}.fa-file-sound-o:before,.fa-file-audio-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-ge:before,.fa-empire:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-send:before,.fa-paper-plane:before{content:""}.fa-send-o:before,.fa-paper-plane-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:""}.fa-meanpath:before{content:""}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context{font-family:inherit}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before{font-family:"FontAwesome";display:inline-block;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa,a .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li a span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,a .rst-content .admonition-title,.rst-content a .admonition-title,a .rst-content h1 .headerlink,.rst-content h1 a .headerlink,a .rst-content h2 .headerlink,.rst-content h2 a .headerlink,a .rst-content h3 .headerlink,.rst-content h3 a .headerlink,a .rst-content h4 .headerlink,.rst-content h4 a .headerlink,a .rst-content h5 .headerlink,.rst-content h5 a .headerlink,a .rst-content h6 .headerlink,.rst-content h6 a .headerlink,a .rst-content dl dt .headerlink,.rst-content dl dt a .headerlink,a .rst-content p.caption .headerlink,.rst-content p.caption a .headerlink,a .rst-content tt.download span:first-child,.rst-content tt.download a span:first-child,a .rst-content code.download span:first-child,.rst-content code.download a span:first-child,a .icon{display:inline-block;text-decoration:inherit}.btn .fa,.btn .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .btn span.toctree-expand,.btn .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .btn span.toctree-expand,.btn .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .btn span.toctree-expand,.btn .rst-content .admonition-title,.rst-content .btn .admonition-title,.btn .rst-content h1 .headerlink,.rst-content h1 .btn .headerlink,.btn .rst-content h2 .headerlink,.rst-content h2 .btn .headerlink,.btn .rst-content h3 .headerlink,.rst-content h3 .btn .headerlink,.btn .rst-content h4 .headerlink,.rst-content h4 .btn .headerlink,.btn .rst-content h5 .headerlink,.rst-content h5 .btn .headerlink,.btn .rst-content h6 .headerlink,.rst-content h6 .btn .headerlink,.btn .rst-content dl dt .headerlink,.rst-content dl dt .btn .headerlink,.btn .rst-content p.caption .headerlink,.rst-content p.caption .btn .headerlink,.btn .rst-content tt.download span:first-child,.rst-content tt.download .btn span:first-child,.btn .rst-content code.download span:first-child,.rst-content code.download .btn span:first-child,.btn .icon,.nav .fa,.nav .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .nav span.toctree-expand,.nav .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .nav span.toctree-expand,.nav .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .nav span.toctree-expand,.nav .rst-content .admonition-title,.rst-content .nav .admonition-title,.nav .rst-content h1 .headerlink,.rst-content h1 .nav .headerlink,.nav .rst-content h2 .headerlink,.rst-content h2 .nav .headerlink,.nav .rst-content h3 .headerlink,.rst-content h3 .nav .headerlink,.nav .rst-content h4 .headerlink,.rst-content h4 .nav .headerlink,.nav .rst-content h5 .headerlink,.rst-content h5 .nav .headerlink,.nav .rst-content h6 .headerlink,.rst-content h6 .nav .headerlink,.nav .rst-content dl dt .headerlink,.rst-content dl dt .nav .headerlink,.nav .rst-content p.caption .headerlink,.rst-content p.caption .nav .headerlink,.nav .rst-content tt.download span:first-child,.rst-content tt.download .nav span:first-child,.nav .rst-content code.download span:first-child,.rst-content code.download .nav span:first-child,.nav .icon{display:inline}.btn .fa.fa-large,.btn .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .btn span.fa-large.toctree-expand,.btn .rst-content .fa-large.admonition-title,.rst-content .btn .fa-large.admonition-title,.btn .rst-content h1 .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.btn .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .btn .fa-large.headerlink,.btn .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .btn .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .btn span.fa-large:first-child,.btn .rst-content code.download span.fa-large:first-child,.rst-content code.download .btn span.fa-large:first-child,.btn .fa-large.icon,.nav .fa.fa-large,.nav .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .nav span.fa-large.toctree-expand,.nav .rst-content .fa-large.admonition-title,.rst-content .nav .fa-large.admonition-title,.nav .rst-content h1 .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.nav .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.nav .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .nav .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.nav .rst-content code.download span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.nav .fa-large.icon{line-height:0.9em}.btn .fa.fa-spin,.btn .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .btn span.fa-spin.toctree-expand,.btn .rst-content .fa-spin.admonition-title,.rst-content .btn .fa-spin.admonition-title,.btn .rst-content h1 .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.btn .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .btn .fa-spin.headerlink,.btn .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .btn .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .btn span.fa-spin:first-child,.btn .rst-content code.download span.fa-spin:first-child,.rst-content code.download .btn span.fa-spin:first-child,.btn .fa-spin.icon,.nav .fa.fa-spin,.nav .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .nav span.fa-spin.toctree-expand,.nav .rst-content .fa-spin.admonition-title,.rst-content .nav .fa-spin.admonition-title,.nav .rst-content h1 .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.nav .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.nav .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .nav .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.nav .rst-content code.download span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.nav .fa-spin.icon{display:inline-block}.btn.fa:before,.wy-menu-vertical li span.btn.toctree-expand:before,.rst-content .btn.admonition-title:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content dl dt .btn.headerlink:before,.rst-content p.caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.rst-content code.download span.btn:first-child:before,.btn.icon:before{opacity:0.5;-webkit-transition:opacity 0.05s ease-in;-moz-transition:opacity 0.05s ease-in;transition:opacity 0.05s ease-in}.btn.fa:hover:before,.wy-menu-vertical li span.btn.toctree-expand:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content p.caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.rst-content code.download span.btn:first-child:hover:before,.btn.icon:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li .btn-mini span.toctree-expand:before,.btn-mini .rst-content .admonition-title:before,.rst-content .btn-mini .admonition-title:before,.btn-mini .rst-content h1 .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.btn-mini .rst-content dl dt .headerlink:before,.rst-content dl dt .btn-mini .headerlink:before,.btn-mini .rst-content p.caption .headerlink:before,.rst-content p.caption .btn-mini .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.rst-content tt.download .btn-mini span:first-child:before,.btn-mini .rst-content code.download span:first-child:before,.rst-content code.download .btn-mini span:first-child:before,.btn-mini .icon:before{font-size:14px;vertical-align:-15%}.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.wy-alert-title,.rst-content .admonition-title{color:#fff;font-weight:bold;display:block;color:#fff;background:#6ab0de;margin:-12px;padding:6px 12px;margin-bottom:12px}.wy-alert.wy-alert-danger,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.admonition-todo{background:#fdf3f2}.wy-alert.wy-alert-danger .wy-alert-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .danger .wy-alert-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .danger .admonition-title,.rst-content .error .admonition-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title{background:#f29f97}.wy-alert.wy-alert-warning,.rst-content .wy-alert-warning.note,.rst-content .attention,.rst-content .caution,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.tip,.rst-content .warning,.rst-content .wy-alert-warning.seealso,.rst-content .admonition-todo{background:#ffedcc}.wy-alert.wy-alert-warning .wy-alert-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .attention .wy-alert-title,.rst-content .caution .wy-alert-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .admonition-todo .wy-alert-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .attention .admonition-title,.rst-content .caution .admonition-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .warning .admonition-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .admonition-todo .admonition-title{background:#f0b37e}.wy-alert.wy-alert-info,.rst-content .note,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.rst-content .seealso,.rst-content .wy-alert-info.admonition-todo{background:#e7f2fa}.wy-alert.wy-alert-info .wy-alert-title,.rst-content .note .wy-alert-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.rst-content .note .admonition-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .seealso .admonition-title,.rst-content .wy-alert-info.admonition-todo .admonition-title{background:#6ab0de}.wy-alert.wy-alert-success,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.warning,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.admonition-todo{background:#dbfaf4}.wy-alert.wy-alert-success .wy-alert-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .hint .wy-alert-title,.rst-content .important .wy-alert-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .hint .admonition-title,.rst-content .important .admonition-title,.rst-content .tip .admonition-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.admonition-todo .admonition-title{background:#1abc9c}.wy-alert.wy-alert-neutral,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.admonition-todo{background:#f3f6f6}.wy-alert.wy-alert-neutral .wy-alert-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .admonition-title{color:#404040;background:#e1e4e5}.wy-alert.wy-alert-neutral a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.admonition-todo a{color:#2980B9}.wy-alert p:last-child,.rst-content .note p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.rst-content .seealso p:last-child,.rst-content .admonition-todo p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0px;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,0.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all 0.3s ease-in;-moz-transition:all 0.3s ease-in;transition:all 0.3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27AE60}.wy-tray-container li.wy-tray-item-info{background:#2980B9}.wy-tray-container li.wy-tray-item-warning{background:#E67E22}.wy-tray-container li.wy-tray-item-danger{background:#E74C3C}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width: 768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px 12px;color:#fff;border:1px solid rgba(0,0,0,0.1);background-color:#27AE60;text-decoration:none;font-weight:normal;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:0px 1px 2px -1px rgba(255,255,255,0.5) inset,0px -2px 0px 0px rgba(0,0,0,0.1) inset;outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all 0.1s linear;-moz-transition:all 0.1s linear;transition:all 0.1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:0px -1px 0px 0px rgba(0,0,0,0.05) inset,0px 2px 0px 0px rgba(0,0,0,0.1) inset;padding:8px 12px 6px 12px}.btn:visited{color:#fff}.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn-disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn-disabled:hover,.btn-disabled:focus,.btn-disabled:active{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980B9 !important}.btn-info:hover{background-color:#2e8ece !important}.btn-neutral{background-color:#f3f6f6 !important;color:#404040 !important}.btn-neutral:hover{background-color:#e5ebeb !important;color:#404040}.btn-neutral:visited{color:#404040 !important}.btn-success{background-color:#27AE60 !important}.btn-success:hover{background-color:#295 !important}.btn-danger{background-color:#E74C3C !important}.btn-danger:hover{background-color:#ea6153 !important}.btn-warning{background-color:#E67E22 !important}.btn-warning:hover{background-color:#e98b39 !important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f !important}.btn-link{background-color:transparent !important;color:#2980B9;box-shadow:none;border-color:transparent !important}.btn-link:hover{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:active{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:visited{color:#9B59B6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:before,.wy-btn-group:after{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:solid 1px #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,0.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980B9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:solid 1px #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type="search"]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980B9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned input,.wy-form-aligned textarea,.wy-form-aligned select,.wy-form-aligned .wy-help-inline,.wy-form-aligned label{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{border:0;margin:0;padding:0}legend{display:block;width:100%;border:0;padding:0;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label{display:block;margin:0 0 0.3125em 0;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;*zoom:1;max-width:68em;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#E74C3C}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full input[type="text"],.wy-control-group .wy-form-full input[type="password"],.wy-control-group .wy-form-full input[type="email"],.wy-control-group .wy-form-full input[type="url"],.wy-control-group .wy-form-full input[type="date"],.wy-control-group .wy-form-full input[type="month"],.wy-control-group .wy-form-full input[type="time"],.wy-control-group .wy-form-full input[type="datetime"],.wy-control-group .wy-form-full input[type="datetime-local"],.wy-control-group .wy-form-full input[type="week"],.wy-control-group .wy-form-full input[type="number"],.wy-control-group .wy-form-full input[type="search"],.wy-control-group .wy-form-full input[type="tel"],.wy-control-group .wy-form-full input[type="color"],.wy-control-group .wy-form-halves input[type="text"],.wy-control-group .wy-form-halves input[type="password"],.wy-control-group .wy-form-halves input[type="email"],.wy-control-group .wy-form-halves input[type="url"],.wy-control-group .wy-form-halves input[type="date"],.wy-control-group .wy-form-halves input[type="month"],.wy-control-group .wy-form-halves input[type="time"],.wy-control-group .wy-form-halves input[type="datetime"],.wy-control-group .wy-form-halves input[type="datetime-local"],.wy-control-group .wy-form-halves input[type="week"],.wy-control-group .wy-form-halves input[type="number"],.wy-control-group .wy-form-halves input[type="search"],.wy-control-group .wy-form-halves input[type="tel"],.wy-control-group .wy-form-halves input[type="color"],.wy-control-group .wy-form-thirds input[type="text"],.wy-control-group .wy-form-thirds input[type="password"],.wy-control-group .wy-form-thirds input[type="email"],.wy-control-group .wy-form-thirds input[type="url"],.wy-control-group .wy-form-thirds input[type="date"],.wy-control-group .wy-form-thirds input[type="month"],.wy-control-group .wy-form-thirds input[type="time"],.wy-control-group .wy-form-thirds input[type="datetime"],.wy-control-group .wy-form-thirds input[type="datetime-local"],.wy-control-group .wy-form-thirds input[type="week"],.wy-control-group .wy-form-thirds input[type="number"],.wy-control-group .wy-form-thirds input[type="search"],.wy-control-group .wy-form-thirds input[type="tel"],.wy-control-group .wy-form-thirds input[type="color"]{width:100%}.wy-control-group .wy-form-full{float:left;display:block;margin-right:2.35765%;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child{margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n+1){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child{margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control{margin:6px 0 0 0;font-size:90%}.wy-control-no-input{display:inline-block;margin:6px 0 0 0;font-size:90%}.wy-control-group.fluid-input input[type="text"],.wy-control-group.fluid-input input[type="password"],.wy-control-group.fluid-input input[type="email"],.wy-control-group.fluid-input input[type="url"],.wy-control-group.fluid-input input[type="date"],.wy-control-group.fluid-input input[type="month"],.wy-control-group.fluid-input input[type="time"],.wy-control-group.fluid-input input[type="datetime"],.wy-control-group.fluid-input input[type="datetime-local"],.wy-control-group.fluid-input input[type="week"],.wy-control-group.fluid-input input[type="number"],.wy-control-group.fluid-input input[type="search"],.wy-control-group.fluid-input input[type="tel"],.wy-control-group.fluid-input input[type="color"]{width:100%}.wy-form-message-inline{display:inline-block;padding-left:0.3em;color:#666;vertical-align:middle;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:0.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;*overflow:visible}input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border 0.3s linear;-moz-transition:border 0.3s linear;transition:border 0.3s linear}input[type="datetime-local"]{padding:0.34375em 0.625em}input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin-right:0.3125em;*height:13px;*width:13px}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input[type="text"]:focus,input[type="password"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus{outline:0;outline:thin dotted \9;border-color:#333}input.no-focus:focus{border-color:#ccc !important}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:1px auto #129FEA}input[type="text"][disabled],input[type="password"][disabled],input[type="email"][disabled],input[type="url"][disabled],input[type="date"][disabled],input[type="month"][disabled],input[type="time"][disabled],input[type="datetime"][disabled],input[type="datetime-local"][disabled],input[type="week"][disabled],input[type="number"][disabled],input[type="search"][disabled],input[type="tel"][disabled],input[type="color"][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#E74C3C;border:1px solid #E74C3C}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#E74C3C}input[type="file"]:focus:invalid:focus,input[type="radio"]:focus:invalid:focus,input[type="checkbox"]:focus:invalid:focus{outline-color:#E74C3C}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif}select,textarea{padding:0.5em 0.625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border 0.3s linear;-moz-transition:border 0.3s linear;transition:border 0.3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type="radio"][disabled],input[type="checkbox"][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:solid 1px #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{width:36px;height:12px;margin:12px 0;position:relative;border-radius:4px;background:#ccc;cursor:pointer;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.wy-switch:before{position:absolute;content:"";display:block;width:18px;height:18px;border-radius:4px;background:#999;left:-3px;top:-3px;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.wy-switch:after{content:"false";position:absolute;left:48px;display:block;font-size:12px;color:#ccc}.wy-switch.active{background:#1e8449}.wy-switch.active:before{left:24px;background:#27AE60}.wy-switch.active:after{content:"true"}.wy-switch.disabled,.wy-switch.active.disabled{cursor:not-allowed}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#E74C3C}.wy-control-group.wy-control-group-error input[type="text"],.wy-control-group.wy-control-group-error input[type="password"],.wy-control-group.wy-control-group-error input[type="email"],.wy-control-group.wy-control-group-error input[type="url"],.wy-control-group.wy-control-group-error input[type="date"],.wy-control-group.wy-control-group-error input[type="month"],.wy-control-group.wy-control-group-error input[type="time"],.wy-control-group.wy-control-group-error input[type="datetime"],.wy-control-group.wy-control-group-error input[type="datetime-local"],.wy-control-group.wy-control-group-error input[type="week"],.wy-control-group.wy-control-group-error input[type="number"],.wy-control-group.wy-control-group-error input[type="search"],.wy-control-group.wy-control-group-error input[type="tel"],.wy-control-group.wy-control-group-error input[type="color"]{border:solid 1px #E74C3C}.wy-control-group.wy-control-group-error textarea{border:solid 1px #E74C3C}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:0.5em 0.625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27AE60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#E74C3C}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#E67E22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980B9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width: 480px){.wy-form button[type="submit"]{margin:0.7em 0 0}.wy-form input[type="text"],.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0.3em;display:block}.wy-form label{margin-bottom:0.3em;display:block}.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:0.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0 0}.wy-form .wy-help-inline,.wy-form-message-inline,.wy-form-message{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width: 768px){.tablet-hide{display:none}}@media screen and (max-width: 480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.wy-table,.rst-content table.docutils,.rst-content table.field-list{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.wy-table caption,.rst-content table.docutils caption,.rst-content table.field-list caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td,.wy-table th,.rst-content table.docutils th,.rst-content table.field-list th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.wy-table td:first-child,.rst-content table.docutils td:first-child,.rst-content table.field-list td:first-child,.wy-table th:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list th:first-child{border-left-width:0}.wy-table thead,.rst-content table.docutils thead,.rst-content table.field-list thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.wy-table thead th,.rst-content table.docutils thead th,.rst-content table.field-list thead th{font-weight:bold;border-bottom:solid 2px #e1e4e5}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td{background-color:transparent;vertical-align:middle}.wy-table td p,.rst-content table.docutils td p,.rst-content table.field-list td p{line-height:18px}.wy-table td p:last-child,.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child{margin-bottom:0}.wy-table .wy-table-cell-min,.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min{width:1%;padding-right:0}.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:gray;font-size:90%}.wy-table-tertiary{color:gray;font-size:80%}.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td,.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td{background-color:#f3f6f6}.wy-table-backed{background-color:#f3f6f6}.wy-table-bordered-all,.rst-content table.docutils{border:1px solid #e1e4e5}.wy-table-bordered-all td,.rst-content table.docutils td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.wy-table-bordered-all tbody>tr:last-child td,.rst-content table.docutils tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0 !important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980B9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9B59B6}html{height:100%;overflow-x:hidden}body{font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;font-weight:normal;color:#404040;min-height:100%;overflow-x:hidden;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#E67E22 !important}a.wy-text-warning:hover{color:#eb9950 !important}.wy-text-info{color:#2980B9 !important}a.wy-text-info:hover{color:#409ad5 !important}.wy-text-success{color:#27AE60 !important}a.wy-text-success:hover{color:#36d278 !important}.wy-text-danger{color:#E74C3C !important}a.wy-text-danger:hover{color:#ed7669 !important}.wy-text-neutral{color:#404040 !important}a.wy-text-neutral:hover{color:#595959 !important}h1,h2,.rst-content .toctree-wrapper p.caption,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif}p{line-height:24px;margin:0;font-size:16px;margin-bottom:24px}h1{font-size:175%}h2,.rst-content .toctree-wrapper p.caption{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}code,.rst-content tt,.rst-content code{white-space:nowrap;max-width:100%;background:#fff;border:solid 1px #e1e4e5;font-size:75%;padding:0 5px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;color:#E74C3C;overflow-x:auto}code.code-large,.rst-content tt.code-large{font-size:90%}.wy-plain-list-disc,.rst-content .section ul,.rst-content .toctree-wrapper ul,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.wy-plain-list-disc li,.rst-content .section ul li,.rst-content .toctree-wrapper ul li,article ul li{list-style:disc;margin-left:24px}.wy-plain-list-disc li p:last-child,.rst-content .section ul li p:last-child,.rst-content .toctree-wrapper ul li p:last-child,article ul li p:last-child{margin-bottom:0}.wy-plain-list-disc li ul,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li ul,article ul li ul{margin-bottom:0}.wy-plain-list-disc li li,.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,article ul li li{list-style:circle}.wy-plain-list-disc li li li,.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,article ul li li li{list-style:square}.wy-plain-list-disc li ol li,.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,article ul li ol li{list-style:decimal}.wy-plain-list-decimal,.rst-content .section ol,.rst-content ol.arabic,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.wy-plain-list-decimal li,.rst-content .section ol li,.rst-content ol.arabic li,article ol li{list-style:decimal;margin-left:24px}.wy-plain-list-decimal li p:last-child,.rst-content .section ol li p:last-child,.rst-content ol.arabic li p:last-child,article ol li p:last-child{margin-bottom:0}.wy-plain-list-decimal li ul,.rst-content .section ol li ul,.rst-content ol.arabic li ul,article ol li ul{margin-bottom:0}.wy-plain-list-decimal li ul li,.rst-content .section ol li ul li,.rst-content ol.arabic li ul li,article ol li ul li{list-style:disc}.codeblock-example{border:1px solid #e1e4e5;border-bottom:none;padding:24px;padding-top:48px;font-weight:500;background:#fff;position:relative}.codeblock-example:after{content:"Example";position:absolute;top:0px;left:0px;background:#9B59B6;color:#fff;padding:6px 12px}.codeblock-example.prettyprint-example-only{border:1px solid #e1e4e5;margin-bottom:24px}.codeblock,pre.literal-block,.rst-content .literal-block,.rst-content pre.literal-block,div[class^='highlight']{border:1px solid #e1e4e5;padding:0px;overflow-x:auto;background:#fff;margin:1px 0 24px 0}.codeblock div[class^='highlight'],pre.literal-block div[class^='highlight'],.rst-content .literal-block div[class^='highlight'],div[class^='highlight'] div[class^='highlight']{border:none;background:none;margin:0}div[class^='highlight'] td.code{width:100%}.linenodiv pre{border-right:solid 1px #e6e9ea;margin:0;padding:12px 12px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:12px;line-height:1.5;color:#d9d9d9}div[class^='highlight'] pre{white-space:pre;margin:0;padding:12px 12px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:12px;line-height:1.5;display:block;overflow:auto;color:#404040}@media print{.codeblock,pre.literal-block,.rst-content .literal-block,.rst-content pre.literal-block,div[class^='highlight'],div[class^='highlight'] pre{white-space:pre-wrap}}.hll{background-color:#ffc;margin:0 -12px;padding:0 12px;display:block}.c{color:#998;font-style:italic}.err{color:#a61717;background-color:#e3d2d2}.k{font-weight:bold}.o{font-weight:bold}.cm{color:#998;font-style:italic}.cp{color:#999;font-weight:bold}.c1{color:#998;font-style:italic}.cs{color:#999;font-weight:bold;font-style:italic}.gd{color:#000;background-color:#fdd}.gd .x{color:#000;background-color:#faa}.ge{font-style:italic}.gr{color:#a00}.gh{color:#999}.gi{color:#000;background-color:#dfd}.gi .x{color:#000;background-color:#afa}.go{color:#888}.gp{color:#555}.gs{font-weight:bold}.gu{color:purple;font-weight:bold}.gt{color:#a00}.kc{font-weight:bold}.kd{font-weight:bold}.kn{font-weight:bold}.kp{font-weight:bold}.kr{font-weight:bold}.kt{color:#458;font-weight:bold}.m{color:#099}.s{color:#d14}.n{color:#333}.na{color:teal}.nb{color:#0086b3}.nc{color:#458;font-weight:bold}.no{color:teal}.ni{color:purple}.ne{color:#900;font-weight:bold}.nf{color:#900;font-weight:bold}.nn{color:#555}.nt{color:navy}.nv{color:teal}.ow{font-weight:bold}.w{color:#bbb}.mf{color:#099}.mh{color:#099}.mi{color:#099}.mo{color:#099}.sb{color:#d14}.sc{color:#d14}.sd{color:#d14}.s2{color:#d14}.se{color:#d14}.sh{color:#d14}.si{color:#d14}.sx{color:#d14}.sr{color:#009926}.s1{color:#d14}.ss{color:#990073}.bp{color:#999}.vc{color:teal}.vg{color:teal}.vi{color:teal}.il{color:#099}.gc{color:#999;background-color:#EAF2F5}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.wy-breadcrumbs li code,.wy-breadcrumbs li .rst-content tt,.rst-content .wy-breadcrumbs li tt{padding:5px;border:none;background:none}.wy-breadcrumbs li code.literal,.wy-breadcrumbs li .rst-content tt.literal,.rst-content .wy-breadcrumbs li tt.literal{color:#404040}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width: 480px){.wy-breadcrumbs-extra{display:none}.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:before,.wy-menu-horiz:after{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz ul,.wy-menu-horiz li{display:inline-block}.wy-menu-horiz li:hover{background:rgba(255,255,255,0.1)}.wy-menu-horiz li.divide-left{border-left:solid 1px #404040}.wy-menu-horiz li.divide-right{border-right:solid 1px #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{height:32px;display:inline-block;line-height:32px;padding:0 1.618em;margin-bottom:0;display:block;font-weight:bold;text-transform:uppercase;font-size:80%;color:#555;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:solid 1px #404040}.wy-menu-vertical li.divide-bottom{border-bottom:solid 1px #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:gray;border-right:solid 1px #c9c9c9;padding:0.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.wy-menu-vertical li code,.wy-menu-vertical li .rst-content tt,.rst-content .wy-menu-vertical li tt{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li span.toctree-expand{display:block;float:left;margin-left:-1.2em;font-size:0.8em;line-height:1.6em;color:#4d4d4d}.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a{color:#404040;padding:0.4045em 1.618em;font-weight:bold;position:relative;background:#fcfcfc;border:none;border-bottom:solid 1px #c9c9c9;border-top:solid 1px #c9c9c9;padding-left:1.618em -4px}.wy-menu-vertical li.on a:hover,.wy-menu-vertical li.current>a:hover{background:#fcfcfc}.wy-menu-vertical li.on a:hover span.toctree-expand,.wy-menu-vertical li.current>a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand{display:block;font-size:0.8em;line-height:1.6em;color:#333}.wy-menu-vertical li.toctree-l1.current li.toctree-l2>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>ul{display:none}.wy-menu-vertical li.toctree-l1.current li.toctree-l2.current>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3.current>ul{display:block}.wy-menu-vertical li.toctree-l2.current>a{background:#c9c9c9;padding:0.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{display:block;background:#c9c9c9;padding:0.4045em 4.045em}.wy-menu-vertical li.toctree-l2 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l2 span.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3{font-size:0.9em}.wy-menu-vertical li.toctree-l3.current>a{background:#bdbdbd;padding:0.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{display:block;background:#bdbdbd;padding:0.4045em 5.663em;border-top:none;border-bottom:none}.wy-menu-vertical li.toctree-l3 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l3 span.toctree-expand{color:#969696}.wy-menu-vertical li.toctree-l4{font-size:0.9em}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical .local-toc li ul{display:block}.wy-menu-vertical li ul li a{margin-bottom:0;color:#b3b3b3;font-weight:normal}.wy-menu-vertical a{display:inline-block;line-height:18px;padding:0.4045em 1.618em;display:block;position:relative;font-size:90%;color:#b3b3b3}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover span.toctree-expand{color:#b3b3b3}.wy-menu-vertical a:active{background-color:#2980B9;cursor:pointer;color:#fff}.wy-menu-vertical a:active span.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:0.809em;margin-bottom:0.809em;z-index:200;background-color:#2980B9;text-align:center;padding:0.809em;display:block;color:#fcfcfc;margin-bottom:0.809em}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto 0.809em auto;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a{color:#fcfcfc;font-size:100%;font-weight:bold;display:inline-block;padding:4px 6px;margin-bottom:0.809em}.wy-side-nav-search>a:hover,.wy-side-nav-search .wy-dropdown>a:hover{background:rgba(255,255,255,0.1)}.wy-side-nav-search>a img.logo,.wy-side-nav-search .wy-dropdown>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search>a.icon img.logo,.wy-side-nav-search .wy-dropdown>a.icon img.logo{margin-top:0.85em}.wy-side-nav-search>div.version{margin-top:-0.4045em;margin-bottom:0.809em;font-weight:normal;color:rgba(255,255,255,0.3)}.wy-nav .wy-menu-vertical header{color:#2980B9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980B9;color:#fff}[data-menu-wrap]{-webkit-transition:all 0.2s ease-in;-moz-transition:all 0.2s ease-in;transition:all 0.2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:left repeat-y #fcfcfc;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxOERBMTRGRDBFMUUxMUUzODUwMkJCOThDMEVFNURFMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxOERBMTRGRTBFMUUxMUUzODUwMkJCOThDMEVFNURFMCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjE4REExNEZCMEUxRTExRTM4NTAyQkI5OEMwRUU1REUwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjE4REExNEZDMEUxRTExRTM4NTAyQkI5OEMwRUU1REUwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+EwrlwAAAAA5JREFUeNpiMDU0BAgwAAE2AJgB9BnaAAAAAElFTkSuQmCC);background-size:300px 1px}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980B9;color:#fff;padding:0.4045em 0.809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:before,.wy-nav-top:after{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:bold}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,0.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:#999}footer p{margin-bottom:12px}footer span.commit code,footer span.commit .rst-content tt,.rst-content footer span.commit tt{padding:0px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:1em;background:none;border:none;color:#999}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:before,.rst-footer-buttons:after{display:table;content:""}.rst-footer-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:solid 1px #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:solid 1px #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:gray;font-size:90%}@media screen and (max-width: 768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-side-scroll{width:auto}.wy-side-nav-search{width:auto}.wy-menu.wy-menu-vertical{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width: 1400px){.wy-nav-content-wrap{background:rgba(0,0,0,0.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,footer,.wy-nav-side{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version span.toctree-expand,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content p.caption .headerlink,.rst-content p.caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .icon{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}}.rst-content img{max-width:100%;height:auto !important}.rst-content div.figure{margin-bottom:24px}.rst-content div.figure p.caption{font-style:italic}.rst-content div.figure.align-center{text-align:center}.rst-content .section>img,.rst-content .section>a>img{margin-bottom:24px}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content .note .last,.rst-content .attention .last,.rst-content .caution .last,.rst-content .danger .last,.rst-content .error .last,.rst-content .hint .last,.rst-content .important .last,.rst-content .tip .last,.rst-content .warning .last,.rst-content .seealso .last,.rst-content .admonition-todo .last{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,0.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent !important;border-color:rgba(0,0,0,0.1) !important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha li{list-style:upper-alpha}.rst-content .section ol p,.rst-content .section ul p{margin-bottom:12px}.rst-content .line-block{margin-left:24px}.rst-content .topic-title{font-weight:bold;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0px 0px 24px 24px}.rst-content .align-left{float:left;margin:0px 24px 24px 0px}.rst-content .align-center{margin:auto;display:block}.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content .toctree-wrapper p.caption .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink{display:none;visibility:hidden;font-size:14px}.rst-content h1 .headerlink:after,.rst-content h2 .headerlink:after,.rst-content .toctree-wrapper p.caption .headerlink:after,.rst-content h3 .headerlink:after,.rst-content h4 .headerlink:after,.rst-content h5 .headerlink:after,.rst-content h6 .headerlink:after,.rst-content dl dt .headerlink:after,.rst-content p.caption .headerlink:after{visibility:visible;content:"";font-family:FontAwesome;display:inline-block}.rst-content h1:hover .headerlink,.rst-content h2:hover .headerlink,.rst-content .toctree-wrapper p.caption:hover .headerlink,.rst-content h3:hover .headerlink,.rst-content h4:hover .headerlink,.rst-content h5:hover .headerlink,.rst-content h6:hover .headerlink,.rst-content dl dt:hover .headerlink,.rst-content p.caption:hover .headerlink{display:inline-block}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:solid 1px #e1e4e5}.rst-content .sidebar p,.rst-content .sidebar ul,.rst-content .sidebar dl{font-size:90%}.rst-content .sidebar .last{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif;font-weight:bold;background:#e1e4e5;padding:6px 12px;margin:-24px;margin-bottom:24px;font-size:100%}.rst-content .highlighted{background:#F1C40F;display:inline-block;font-weight:bold;padding:0 6px}.rst-content .footnote-reference,.rst-content .citation-reference{vertical-align:super;font-size:90%}.rst-content table.docutils.citation,.rst-content table.docutils.footnote{background:none;border:none;color:#999}.rst-content table.docutils.citation td,.rst-content table.docutils.citation tr,.rst-content table.docutils.footnote td,.rst-content table.docutils.footnote tr{border:none;background-color:transparent !important;white-space:normal}.rst-content table.docutils.citation td.label,.rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}.rst-content table.docutils.citation tt,.rst-content table.docutils.citation code,.rst-content table.docutils.footnote tt,.rst-content table.docutils.footnote code{color:#555}.rst-content table.field-list{border:none}.rst-content table.field-list td{border:none;padding-top:5px}.rst-content table.field-list td>strong{display:inline-block;margin-top:3px}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left;padding-left:0}.rst-content tt,.rst-content tt,.rst-content code{color:#000;padding:2px 5px}.rst-content tt big,.rst-content tt em,.rst-content tt big,.rst-content code big,.rst-content tt em,.rst-content code em{font-size:100% !important;line-height:normal}.rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal{color:#E74C3C}.rst-content tt.xref,a .rst-content tt,.rst-content tt.xref,.rst-content code.xref,a .rst-content tt,a .rst-content code{font-weight:bold;color:#404040}.rst-content a tt,.rst-content a tt,.rst-content a code{color:#2980B9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:bold}.rst-content dl p,.rst-content dl table,.rst-content dl ul,.rst-content dl ol{margin-bottom:12px !important}.rst-content dl dd{margin:0 0 12px 24px}.rst-content dl:not(.docutils){margin-bottom:24px}.rst-content dl:not(.docutils) dt{display:inline-block;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980B9;border-top:solid 3px #6ab0de;padding:6px;position:relative}.rst-content dl:not(.docutils) dt:before{color:#6ab0de}.rst-content dl:not(.docutils) dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dl dt{margin-bottom:6px;border:none;border-left:solid 3px #ccc;background:#f0f0f0;color:#555}.rst-content dl:not(.docutils) dl dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dt:first-child{margin-top:0}.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) code{font-weight:bold}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) code.descclassname{background-color:transparent;border:none;padding:0;font-size:100% !important}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname{font-weight:bold}.rst-content dl:not(.docutils) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:bold}.rst-content dl:not(.docutils) .property{display:inline-block;padding-right:8px}.rst-content .viewcode-link,.rst-content .viewcode-back{display:inline-block;color:#27AE60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:bold}.rst-content tt.download,.rst-content code.download{background:inherit;padding:inherit;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{margin-right:4px}@media screen and (max-width: 480px){.rst-content .sidebar{width:100%}}span[id*='MathJax-Span']{color:#404040}.math{text-align:center}@font-face{font-family:"Inconsolata";font-style:normal;font-weight:400;src:local("Inconsolata"),local("Inconsolata-Regular"),url(../fonts/Inconsolata-Regular.ttf) format("truetype")}@font-face{font-family:"Inconsolata";font-style:normal;font-weight:700;src:local("Inconsolata Bold"),local("Inconsolata-Bold"),url(../fonts/Inconsolata-Bold.ttf) format("truetype")}@font-face{font-family:"Lato";font-style:normal;font-weight:400;src:local("Lato Regular"),local("Lato-Regular"),url(../fonts/Lato-Regular.ttf) format("truetype")}@font-face{font-family:"Lato";font-style:normal;font-weight:700;src:local("Lato Bold"),local("Lato-Bold"),url(../fonts/Lato-Bold.ttf) format("truetype")}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:400;src:local("Roboto Slab Regular"),local("RobotoSlab-Regular"),url(../fonts/RobotoSlab-Regular.ttf) format("truetype")}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:700;src:local("Roboto Slab Bold"),local("RobotoSlab-Bold"),url(../fonts/RobotoSlab-Bold.ttf) format("truetype")} /*# sourceMappingURL=theme.css.map */ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css.map b/doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css.map index eacfcab1..96cc9d24 100644 --- a/doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css.map +++ b/doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css.map @@ -1,6 +1,6 @@ { "version": 3, -"mappings": "CACE,AAAE,ECQI,iBAAoB,EDPJ,SAAU,ECY1B,cAAiB,EDZD,SAAU,EC2B1B,SAAY,ED3BI,SAAU,EEFlC,uEAAiF,EAC/E,MAAO,EAAE,IAAK,EAEhB,iBAAoB,EAClB,MAAO,EAAE,WAAY,EACrB,OAAQ,EAAE,KAAM,EAChB,IAAK,EAAE,AAAC,EAEV,oBAAqB,EACnB,MAAO,EAAE,GAAI,EAEf,OAAQ,EACN,MAAO,EAAE,GAAI,EAEf,AAAC,EDLO,iBAAoB,ECMd,SAAU,EDDhB,cAAiB,ECCX,SAAU,EDchB,SAAY,ECdN,SAAU,EAExB,GAAI,EACF,QAAS,EAAE,GAAI,EACf,uBAAwB,EAAE,GAAI,EAC9B,mBAAoB,EAAE,GAAI,EAE5B,GAAI,EACF,KAAM,EAAE,AAAC,EAEX,eAAiB,EACf,MAAO,EAAE,AAAC,EAEZ,UAAW,EACT,YAAa,EAAE,SAAU,EAE3B,OAAS,EACP,UAAW,EAAE,GAAI,EAEnB,SAAU,EACR,KAAM,EAAE,AAAC,EAEX,EAAG,EACD,SAAU,EAAE,KAAM,EAGpB,EAAG,EACD,SAAU,EAAE,GAAI,EAChB,IAAK,EAAE,GAAI,EACX,cAAe,EAAE,GAAI,EAEvB,GAAI,EACF,SAAU,EAAE,GAAI,EACh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B,YAGjC,WAAW,CAAE,aAAa,CAC1B,UAAU,CAAE,MAAM,CAClB,WAAW,CAAE,GAAG,CAChB,GAAG,CAAE,uGAAyB", "sources": ["../../../bower_components/neat/app/assets/stylesheets/grid/_grid.scss","../../../bower_components/bourbon/dist/addons/_prefixer.scss","../../../bower_components/wyrm/sass/wyrm_core/_reset.sass","../../../bower_components/wyrm/sass/wyrm_core/_mixin.sass","../../../bower_components/font-awesome/scss/_path.scss","../../../bower_components/font-awesome/scss/_core.scss","../../../bower_components/font-awesome/scss/_larger.scss","../../../bower_components/font-awesome/scss/_fixed-width.scss","../../../bower_components/font-awesome/scss/_list.scss","../../../bower_components/font-awesome/scss/_variables.scss","../../../bower_components/font-awesome/scss/_bordered-pulled.scss","../../../bower_components/font-awesome/scss/_spinning.scss","../../../bower_components/font-awesome/scss/_rotated-flipped.scss","../../../bower_components/font-awesome/scss/_mixins.scss","../../../bower_components/font-awesome/scss/_stacked.scss","../../../bower_components/font-awesome/scss/_icons.scss","../../../bower_components/wyrm/sass/wyrm_core/_font_icon_defaults.sass","../../../bower_components/wyrm/sass/wyrm_core/_wy_variables.sass","../../../bower_components/wyrm/sass/wyrm_core/_alert.sass","../../../sass/_theme_variables.sass","../../../bower_components/neat/app/assets/stylesheets/grid/_media.scss","../../../bower_components/wyrm/sass/wyrm_core/_button.sass","../../../bower_components/wyrm/sass/wyrm_core/_dropdown.sass","../../../bower_components/wyrm/sass/wyrm_core/_form.sass","../../../bower_components/neat/app/assets/stylesheets/grid/_outer-container.scss","../../../bower_components/neat/app/assets/stylesheets/settings/_grid.scss","../../../bower_components/neat/app/assets/stylesheets/grid/_span-columns.scss","../../../bower_components/wyrm/sass/wyrm_core/_neat_extra.sass","../../../bower_components/wyrm/sass/wyrm_core/_generic.sass","../../../bower_components/wyrm/sass/wyrm_core/_table.sass","../../../bower_components/wyrm/sass/wyrm_core/_type.sass","../../../bower_components/wyrm/sass/wyrm_addons/pygments/_pygments.sass","../../../bower_components/wyrm/sass/wyrm_addons/pygments/_pygments_light.sass","../../../sass/_theme_breadcrumbs.sass","../../../sass/_theme_layout.sass","../../../bower_components/neat/app/assets/stylesheets/grid/_private.scss","../../../sass/_theme_badge.sass","../../../sass/_theme_rst.sass","../../../sass/_theme_mathjax.sass","../../../sass/_theme_font_local.sass"], "names": [], "file": "theme.css" diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf index 8b0f54e4..81c9ad94 100644 Binary files a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf and b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf index 360a232d..58c9fef3 100644 Binary files a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf and b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Regular.ttf b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Regular.ttf new file mode 100644 index 00000000..a87ffba6 Binary files /dev/null and b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Regular.ttf differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata.ttf b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata.ttf deleted file mode 100644 index 4b8a36d2..00000000 Binary files a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata.ttf and /dev/null differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Bold.ttf b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Bold.ttf index e8b9bf6a..74343694 100644 Binary files a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Bold.ttf and b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Bold.ttf differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Regular.ttf b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Regular.ttf index 7608bc3e..04ea8efb 100644 Binary files a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Regular.ttf and b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Regular.ttf differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Bold.ttf b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Bold.ttf index e6ed0de5..df5d1df2 100644 Binary files a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Bold.ttf and b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Bold.ttf differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Regular.ttf b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Regular.ttf index 141d6c08..eb52a790 100644 Binary files a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Regular.ttf and b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Regular.ttf differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot index 7c79c6a6..84677bc0 100644 Binary files a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot and b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg index 45fdf338..d907b25a 100644 --- a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg +++ b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg @@ -14,10 +14,11 @@ + - + - + @@ -30,7 +31,7 @@ - + @@ -52,7 +53,7 @@ - + @@ -77,11 +78,11 @@ - - - - - + + + + + @@ -109,8 +110,8 @@ - - + + @@ -143,17 +144,17 @@ - - + + - + - + @@ -176,14 +177,14 @@ - + - + @@ -218,8 +219,8 @@ - - + + @@ -247,10 +248,10 @@ - + - + @@ -345,8 +346,8 @@ - - + + @@ -367,8 +368,8 @@ - - + + @@ -379,7 +380,7 @@ - + @@ -401,14 +402,119 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf index e89738de..96a3639c 100644 Binary files a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf and b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff index 8c1748aa..628b6a52 100644 Binary files a/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff and b/doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff differ diff --git a/doc/sphinx_themes/sphinx_rtd_theme/static/js/theme.js b/doc/sphinx_themes/sphinx_rtd_theme/static/js/theme.js index 749e58f4..432dc0c0 100644 --- a/doc/sphinx_themes/sphinx_rtd_theme/static/js/theme.js +++ b/doc/sphinx_themes/sphinx_rtd_theme/static/js/theme.js @@ -1,113 +1,156 @@ -function toggleCurrent (elem) { - var parent_li = elem.closest('li'); - parent_li.siblings('li.current').removeClass('current'); - parent_li.siblings().find('li.current').removeClass('current'); - parent_li.find('> ul li.current').removeClass('current'); - parent_li.toggleClass('current'); +require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o
"); + + // Add expand links to all parents of nested ul + $('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () { + var link = $(this); + expand = $(''); + expand.on('click', function (ev) { + self.toggleCurrent(link); + ev.stopPropagation(); + return false; + }); + link.prepend(expand); + }); + }; + + nav.reset = function () { + // Get anchor from URL and open up nested nav + var anchor = encodeURI(window.location.hash); + if (anchor) { + try { + var link = $('.wy-menu-vertical') + .find('[href="' + anchor + '"]'); + $('.wy-menu-vertical li.toctree-l1 li.current') + .removeClass('current'); + link.closest('li.toctree-l2').addClass('current'); + link.closest('li.toctree-l3').addClass('current'); + link.closest('li.toctree-l4').addClass('current'); + } + catch (err) { + console.log("Error expanding nav for anchor", err); + } + } + }; + + nav.onScroll = function () { + this.winScroll = false; + var newWinPosition = this.win.scrollTop(), + winBottom = newWinPosition + this.winHeight, + navPosition = this.navBar.scrollTop(), + newNavPosition = navPosition + (newWinPosition - this.winPosition); + if (newWinPosition < 0 || winBottom > this.docHeight) { + return; + } + this.navBar.scrollTop(newNavPosition); + this.winPosition = newWinPosition; + }; + + nav.onResize = function () { + this.winResize = false; + this.winHeight = this.win.height(); + this.docHeight = $(document).height(); + }; + + nav.hashChange = function () { + this.linkScroll = true; + this.win.one('hashchange', function () { + this.linkScroll = false; + }); + }; + + nav.toggleCurrent = function (elem) { + var parent_li = elem.closest('li'); + parent_li.siblings('li.current').removeClass('current'); + parent_li.siblings().find('li.current').removeClass('current'); + parent_li.find('> ul li.current').removeClass('current'); + parent_li.toggleClass('current'); + } + + return nav; +}; + +module.exports.ThemeNav = ThemeNav(); + +if (typeof(window) != 'undefined') { + window.SphinxRtdTheme = { StickyNav: module.exports.ThemeNav }; } -$(document).ready(function() { - // Shift nav in mobile when clicking the menu. - $(document).on('click', "[data-toggle='wy-nav-top']", function() { - $("[data-toggle='wy-nav-shift']").toggleClass("shift"); - $("[data-toggle='rst-versions']").toggleClass("shift"); - }); - // Nav menu link click operations - $(document).on('click', ".wy-menu-vertical .current ul li a", function() { - var target = $(this); - // Close menu when you click a link. - $("[data-toggle='wy-nav-shift']").removeClass("shift"); - $("[data-toggle='rst-versions']").toggleClass("shift"); - // Handle dynamic display of l3 and l4 nav lists - toggleCurrent(target); - if (typeof(window.SphinxRtdTheme) != 'undefined') { - window.SphinxRtdTheme.StickyNav.hashChange(); - } - }); - $(document).on('click', "[data-toggle='rst-current-version']", function() { - $("[data-toggle='rst-versions']").toggleClass("shift-up"); - }); - // Make tables responsive - $("table.docutils:not(.field-list)").wrap("
"); - - // Add expand links to all parents of nested ul - $('.wy-menu-vertical ul').siblings('a').each(function () { - var link = $(this); - expand = $(''); - expand.on('click', function (ev) { - toggleCurrent(link); - ev.stopPropagation(); - return false; - }); - link.prepend(expand); - }); -}); - -// Sphinx theme state -window.SphinxRtdTheme = (function (jquery) { - var stickyNav = (function () { - var navBar, - win, - winScroll = false, - linkScroll = false, - winPosition = 0, - enable = function () { - init(); - reset(); - win.on('hashchange', reset); - - // Set scrolling - win.on('scroll', function () { - if (!linkScroll) { - winScroll = true; - } - }); - setInterval(function () { - if (winScroll) { - winScroll = false; - var newWinPosition = win.scrollTop(), - navPosition = navBar.scrollTop(), - newNavPosition = navPosition + (newWinPosition - winPosition); - navBar.scrollTop(newNavPosition); - winPosition = newWinPosition; - } - }, 25); - }, - init = function () { - navBar = jquery('nav.wy-nav-side:first'); - win = jquery(window); - }, - reset = function () { - // Get anchor from URL and open up nested nav - var anchor = encodeURI(window.location.hash); - if (anchor) { - try { - var link = $('.wy-menu-vertical') - .find('[href="' + anchor + '"]'); - $('.wy-menu-vertical li.toctree-l1 li.current') - .removeClass('current'); - link.closest('li.toctree-l2').addClass('current'); - link.closest('li.toctree-l3').addClass('current'); - link.closest('li.toctree-l4').addClass('current'); - } - catch (err) { - console.log("Error expanding nav for anchor", err); - } - } - }, - hashChange = function () { - linkScroll = true; - win.one('hashchange', function () { - linkScroll = false; - }); - }; - jquery(init); - return { - enable: enable, - hashChange: hashChange - }; - }()); - return { - StickyNav: stickyNav - }; -}($)); +},{"jquery":"jquery"}]},{},["sphinx-rtd-theme"]); diff --git a/doc/sphinx_themes/sphinx_rtd_theme/theme.conf b/doc/sphinx_themes/sphinx_rtd_theme/theme.conf index b71548b2..3896d4d3 100644 --- a/doc/sphinx_themes/sphinx_rtd_theme/theme.conf +++ b/doc/sphinx_themes/sphinx_rtd_theme/theme.conf @@ -7,3 +7,5 @@ typekit_id = hiw1hhg analytics_id = sticky_navigation = False logo_only = +collapse_navigation = False +display_version = True diff --git a/doc/xmlrpc/README.txt b/doc/xmlrpc/README.txt index 915b24c1..242b2364 100644 --- a/doc/xmlrpc/README.txt +++ b/doc/xmlrpc/README.txt @@ -1,3 +1,3 @@ This directory contains sample scripts to interact with aria2 via XML-RPC. For more information, see -http://sourceforge.net/apps/trac/aria2/wiki/XmlrpcInterface +https://aria2.github.io/manual/en/html/aria2c.html#rpc-interface diff --git a/examples/libaria2ex.cc b/examples/libaria2ex.cc index c22ac606..85373760 100644 --- a/examples/libaria2ex.cc +++ b/examples/libaria2ex.cc @@ -43,7 +43,7 @@ int downloadEventCallback(aria2::Session* session, aria2::DownloadEvent event, aria2::A2Gid gid, void* userData) { - switch(event) { + switch (event) { case aria2::EVENT_ON_DOWNLOAD_COMPLETE: std::cerr << "COMPLETE"; break; @@ -55,15 +55,17 @@ int downloadEventCallback(aria2::Session* session, aria2::DownloadEvent event, } std::cerr << " [" << aria2::gidToHex(gid) << "] "; aria2::DownloadHandle* dh = aria2::getDownloadHandle(session, gid); - if(!dh) return 0; - if(dh->getNumFiles() > 0) { + if (!dh) + return 0; + if (dh->getNumFiles() > 0) { aria2::FileData f = dh->getFile(1); // Path may be empty if the file name has not been determined yet. - if(f.path.empty()) { - if(!f.uris.empty()) { + if (f.path.empty()) { + if (!f.uris.empty()) { std::cerr << f.uris[0].uri; } - } else { + } + else { std::cerr << f.path; } } @@ -75,7 +77,7 @@ int downloadEventCallback(aria2::Session* session, aria2::DownloadEvent event, int main(int argc, char** argv) { int rv; - if(argc < 2) { + if (argc < 2) { std::cerr << "Usage: libaria2ex URI [URI...]\n" << "\n" << " Download given URIs in parallel in the current directory." @@ -92,46 +94,45 @@ int main(int argc, char** argv) config.downloadEventCallback = downloadEventCallback; session = aria2::sessionNew(aria2::KeyVals(), config); // Add download item to session - for(int i = 1; i < argc; ++i) { + for (int i = 1; i < argc; ++i) { std::vector uris = {argv[i]}; aria2::KeyVals options; rv = aria2::addUri(session, nullptr, uris, options); - if(rv < 0) { + if (rv < 0) { std::cerr << "Failed to add download " << uris[0] << std::endl; } } auto start = std::chrono::steady_clock::now(); - for(;;) { + for (;;) { rv = aria2::run(session, aria2::RUN_ONCE); - if(rv != 1) { + if (rv != 1) { break; } // the application can call aria2 API to add URI or query progress // here auto now = std::chrono::steady_clock::now(); - auto count = std::chrono::duration_cast - (now - start).count(); + auto count = std::chrono::duration_cast( + now - start).count(); // Print progress information once per 500ms - if(count >= 500) { + if (count >= 500) { start = now; aria2::GlobalStat gstat = aria2::getGlobalStat(session); std::cerr << "Overall #Active:" << gstat.numActive << " #waiting:" << gstat.numWaiting - << " D:" << gstat.downloadSpeed/1024 << "KiB/s" - << " U:"<< gstat.uploadSpeed/1024 << "KiB/s " << std::endl; + << " D:" << gstat.downloadSpeed / 1024 << "KiB/s" + << " U:" << gstat.uploadSpeed / 1024 << "KiB/s " << std::endl; std::vector gids = aria2::getActiveDownload(session); - for(const auto& gid : gids) { + for (const auto& gid : gids) { aria2::DownloadHandle* dh = aria2::getDownloadHandle(session, gid); - if(dh) { + if (dh) { std::cerr << " [" << aria2::gidToHex(gid) << "] " - << dh->getCompletedLength() << "/" - << dh->getTotalLength() << "(" - << (dh->getTotalLength() > 0 ? - (100*dh->getCompletedLength()/dh->getTotalLength()) - : 0) << "%)" - << " D:" - << dh->getDownloadSpeed()/1024 << "KiB/s, U:" - << dh->getUploadSpeed()/1024 << "KiB/s" + << dh->getCompletedLength() << "/" << dh->getTotalLength() + << "(" << (dh->getTotalLength() > 0 + ? (100 * dh->getCompletedLength() / + dh->getTotalLength()) + : 0) << "%)" + << " D:" << dh->getDownloadSpeed() / 1024 + << "KiB/s, U:" << dh->getUploadSpeed() / 1024 << "KiB/s" << std::endl; aria2::deleteDownloadHandle(dh); } diff --git a/examples/libaria2wx.cc b/examples/libaria2wx.cc index f40f1a4d..88e8231e 100644 --- a/examples/libaria2wx.cc +++ b/examples/libaria2wx.cc @@ -38,7 +38,8 @@ // the main window. // // Compile and link like this: -// $ g++ -O2 -Wall -g -std=c++11 `wx-config --cflags` -o libaria2wx libaria2wx.cc `wx-config --libs` -laria2 -pthread +// $ g++ -O2 -Wall -g -std=c++11 `wx-config --cflags` -o libaria2wx +// libaria2wx.cc `wx-config --libs` -laria2 -pthread #include #include #include @@ -51,7 +52,7 @@ // Interface to send message to downloader thread from UI thread struct Job { - virtual ~Job() {}; + virtual ~Job(){}; virtual void execute(aria2::Session* session) = 0; }; @@ -59,15 +60,14 @@ class MainFrame; // Interface to report back to UI thread from downloader thread struct Notification { - virtual ~Notification() {}; + virtual ~Notification(){}; virtual void notify(MainFrame* frame) = 0; }; // std::queue wrapper synchronized by mutex. In this example // program, only one thread consumes from the queue, so separating // empty() and pop() is not a problem. -template -class SynchronizedQueue { +template class SynchronizedQueue { public: SynchronizedQueue() {} ~SynchronizedQueue() {} @@ -88,8 +88,9 @@ public: std::lock_guard l(m_); return q_.empty(); } + private: - std::queue > q_; + std::queue> q_; std::mutex m_; }; @@ -109,8 +110,9 @@ struct ShutdownJob : public Job { // Job to send URI to download and options to downloader thread struct AddUriJob : public Job { AddUriJob(std::vector&& uris, aria2::KeyVals&& options) - : uris(uris), options(options) - {} + : uris(uris), options(options) + { + } virtual void execute(aria2::Session* session) { // TODO check return value @@ -148,6 +150,7 @@ public: void OnTimer(wxTimerEvent& event); void OnAddUri(wxCommandEvent& event); void UpdateActiveStatus(const std::vector& v); + private: wxTextCtrl* text_; wxTimer timer_; @@ -157,13 +160,9 @@ private: DECLARE_EVENT_TABLE() }; -enum { - TIMER_ID = 1 -}; +enum { TIMER_ID = 1 }; -enum { - MI_ADD_URI = 1 -}; +enum { MI_ADD_URI = 1 }; BEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_CLOSE(MainFrame::OnCloseWindow) @@ -177,6 +176,7 @@ public: void OnButton(wxCommandEvent& event); wxString GetUri(); wxString GetOption(); + private: wxTextCtrl* uriText_; wxTextCtrl* optionText_; @@ -193,7 +193,8 @@ IMPLEMENT_APP(Aria2App) bool Aria2App::OnInit() { - if(!wxApp::OnInit()) return false; + if (!wxApp::OnInit()) + return false; aria2::libraryInit(); MainFrame* frame = new MainFrame(wxT("libaria2 GUI example")); frame->Show(true); @@ -207,14 +208,12 @@ int Aria2App::OnExit() } MainFrame::MainFrame(const wxString& title) - : wxFrame(nullptr, wxID_ANY, title, wxDefaultPosition, - wxSize(640, 400)), - timer_(this, TIMER_ID), - downloaderThread_(downloaderJob, std::ref(jobq_), std::ref(notifyq_)) + : wxFrame(nullptr, wxID_ANY, title, wxDefaultPosition, wxSize(640, 400)), + timer_(this, TIMER_ID), + downloaderThread_(downloaderJob, std::ref(jobq_), std::ref(notifyq_)) { wxMenu* downloadMenu = new wxMenu; - downloadMenu->Append(MI_ADD_URI, wxT("&Add URI"), - wxT("Add URI to download")); + downloadMenu->Append(MI_ADD_URI, wxT("&Add URI"), wxT("Add URI to download")); wxMenuBar* menuBar = new wxMenuBar(); menuBar->Append(downloadMenu, wxT("&Download")); @@ -237,35 +236,36 @@ void MainFrame::OnAddUri(wxCommandEvent& WXUNUSED(event)) { AddUriDialog dlg(this); int ret = dlg.ShowModal(); - if(ret == 0) { - if(dlg.GetUri().IsEmpty()) { + if (ret == 0) { + if (dlg.GetUri().IsEmpty()) { return; } - std::vector uris = { std::string(dlg.GetUri().mb_str()) }; + std::vector uris = {std::string(dlg.GetUri().mb_str())}; std::string optstr(dlg.GetOption().mb_str()); aria2::KeyVals options; int keyfirst = 0; - for(int i = 0; i < (int)optstr.size(); ++i) { - if(optstr[i] == '\n') { - keyfirst = i+1; - } else if(optstr[i] == '=') { + for (int i = 0; i < (int)optstr.size(); ++i) { + if (optstr[i] == '\n') { + keyfirst = i + 1; + } + else if (optstr[i] == '=') { int j; - for(j = i+1; j < (int)optstr.size(); ++j) { - if(optstr[j] == '\n') { + for (j = i + 1; j < (int)optstr.size(); ++j) { + if (optstr[j] == '\n') { break; } } - if(i - keyfirst > 0) { - options.push_back - (std::make_pair(optstr.substr(keyfirst, i - keyfirst), - optstr.substr(i + 1, j - i - 1))); + if (i - keyfirst > 0) { + options.push_back( + std::make_pair(optstr.substr(keyfirst, i - keyfirst), + optstr.substr(i + 1, j - i - 1))); } keyfirst = j + 1; i = j; } } - jobq_.push(std::unique_ptr(new AddUriJob(std::move(uris), - std::move(options)))); + jobq_.push(std::unique_ptr( + new AddUriJob(std::move(uris), std::move(options)))); } } @@ -281,56 +281,47 @@ void MainFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) void MainFrame::OnTimer(wxTimerEvent& event) { - while(!notifyq_.empty()) { + while (!notifyq_.empty()) { std::unique_ptr nt = notifyq_.pop(); nt->notify(this); } } -template -std::string abbrevsize(T size) +template std::string abbrevsize(T size) { - if(size >= 1024*1024*1024) { - return std::to_string(size/1024/1024/1024)+"G"; - } else if(size >= 1024*1024) { - return std::to_string(size/1024/1024)+"M"; - } else if(size >= 1024) { - return std::to_string(size/1024)+"K"; - } else { + if (size >= 1024 * 1024 * 1024) { + return std::to_string(size / 1024 / 1024 / 1024) + "G"; + } + else if (size >= 1024 * 1024) { + return std::to_string(size / 1024 / 1024) + "M"; + } + else if (size >= 1024) { + return std::to_string(size / 1024) + "K"; + } + else { return std::to_string(size); } } -wxString towxs(const std::string& s) -{ - return wxString(s.c_str(), wxConvUTF8); -} +wxString towxs(const std::string& s) { return wxString(s.c_str(), wxConvUTF8); } void MainFrame::UpdateActiveStatus(const std::vector& v) { text_->Clear(); - for(auto& a : v) { - *text_ << wxT("[") - << towxs(aria2::gidToHex(a.gid)) - << wxT("] ") - << towxs(abbrevsize(a.completedLength)) - << wxT("/") - << towxs(abbrevsize(a.totalLength)) - << wxT("(") - << (a.totalLength != 0 ? a.completedLength*100/a.totalLength : 0) - << wxT("%)") - << wxT(" D:") - << towxs(abbrevsize(a.downloadSpeed)) - << wxT(" U:") - << towxs(abbrevsize(a.uploadSpeed)) - << wxT("\n") + for (auto& a : v) { + *text_ << wxT("[") << towxs(aria2::gidToHex(a.gid)) << wxT("] ") + << towxs(abbrevsize(a.completedLength)) << wxT("/") + << towxs(abbrevsize(a.totalLength)) << wxT("(") + << (a.totalLength != 0 ? a.completedLength * 100 / a.totalLength : 0) + << wxT("%)") << wxT(" D:") << towxs(abbrevsize(a.downloadSpeed)) + << wxT(" U:") << towxs(abbrevsize(a.uploadSpeed)) << wxT("\n") << wxT("File:") << towxs(a.filename) << wxT("\n"); } } AddUriDialog::AddUriDialog(wxWindow* parent) - : wxDialog(parent, wxID_ANY, wxT("Add URI"), wxDefaultPosition, - wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + : wxDialog(parent, wxID_ANY, wxT("Add URI"), wxDefaultPosition, + wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { wxPanel* panel = new wxPanel(this, wxID_ANY); wxBoxSizer* box = new wxBoxSizer(wxVERTICAL); @@ -339,9 +330,8 @@ AddUriDialog::AddUriDialog(wxWindow* parent) uriText_ = new wxTextCtrl(panel, wxID_ANY); box->Add(uriText_, wxSizerFlags().Align(wxGROW)); // Option multi text input - box->Add(new wxStaticText - (panel, wxID_ANY, - wxT("Options (key=value pair per line, e.g. dir=/tmp"))); + box->Add(new wxStaticText( + panel, wxID_ANY, wxT("Options (key=value pair per line, e.g. dir=/tmp"))); optionText_ = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); box->Add(optionText_, wxSizerFlags().Align(wxGROW)); @@ -363,38 +353,25 @@ AddUriDialog::AddUriDialog(wxWindow* parent) void AddUriDialog::OnButton(wxCommandEvent& event) { int ret = -1; - if(event.GetEventObject() == okBtn_) { + if (event.GetEventObject() == okBtn_) { ret = 0; } EndModal(ret); } -wxString AddUriDialog::GetUri() -{ - return uriText_->GetValue(); -} +wxString AddUriDialog::GetUri() { return uriText_->GetValue(); } -wxString AddUriDialog::GetOption() -{ - return optionText_->GetValue(); -} +wxString AddUriDialog::GetOption() { return optionText_->GetValue(); } struct DownloadStatusNotification : public Notification { - DownloadStatusNotification(std::vector&& v) - : v(v) {} - virtual void notify(MainFrame* frame) - { - frame->UpdateActiveStatus(v); - } + DownloadStatusNotification(std::vector&& v) : v(v) {} + virtual void notify(MainFrame* frame) { frame->UpdateActiveStatus(v); } std::vector v; }; struct ShutdownNotification : public Notification { ShutdownNotification() {} - virtual void notify(MainFrame* frame) - { - frame->Close(); - } + virtual void notify(MainFrame* frame) { frame->Close(); } }; int downloaderJob(JobQueue& jobq, NotifyQueue& notifyq) @@ -406,32 +383,32 @@ int downloaderJob(JobQueue& jobq, NotifyQueue& notifyq) config.keepRunning = true; session = aria2::sessionNew(aria2::KeyVals(), config); auto start = std::chrono::steady_clock::now(); - for(;;) { + for (;;) { int rv = aria2::run(session, aria2::RUN_ONCE); - if(rv != 1) { + if (rv != 1) { break; } auto now = std::chrono::steady_clock::now(); - auto count = std::chrono::duration_cast - (now - start).count(); - while(!jobq.empty()) { + auto count = std::chrono::duration_cast( + now - start).count(); + while (!jobq.empty()) { std::unique_ptr job = jobq.pop(); job->execute(session); } - if(count >= 900) { + if (count >= 900) { start = now; std::vector gids = aria2::getActiveDownload(session); std::vector v; - for(auto gid : gids) { + for (auto gid : gids) { aria2::DownloadHandle* dh = aria2::getDownloadHandle(session, gid); - if(dh) { + if (dh) { DownloadStatus st; st.gid = gid; st.totalLength = dh->getTotalLength(); st.completedLength = dh->getCompletedLength(); st.downloadSpeed = dh->getDownloadSpeed(); st.uploadSpeed = dh->getUploadSpeed(); - if(dh->getNumFiles() > 0) { + if (dh->getNumFiles() > 0) { aria2::FileData file = dh->getFile(1); st.filename = file.path; } @@ -439,8 +416,8 @@ int downloaderJob(JobQueue& jobq, NotifyQueue& notifyq) aria2::deleteDownloadHandle(dh); } } - notifyq.push(std::unique_ptr - (new DownloadStatusNotification(std::move(v)))); + notifyq.push(std::unique_ptr( + new DownloadStatusNotification(std::move(v)))); } } int rv = aria2::sessionFinal(session); @@ -449,4 +426,3 @@ int downloaderJob(JobQueue& jobq, NotifyQueue& notifyq) notifyq.push(std::unique_ptr(new ShutdownNotification())); return rv; } - diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 new file mode 100644 index 00000000..ca363971 --- /dev/null +++ b/m4/ax_check_compile_flag.m4 @@ -0,0 +1,74 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the current language's compiler +# or gives an error. (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim +# Copyright (c) 2011 Maarten Bosmans +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program 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 General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 4 + +AC_DEFUN([AX_CHECK_COMPILE_FLAG], +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) +AS_VAR_IF(CACHEVAR,yes, + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_COMPILE_FLAGS diff --git a/m4/libexpat.m4 b/m4/libexpat.m4 index 69832bc1..cee8a96a 100644 --- a/m4/libexpat.m4 +++ b/m4/libexpat.m4 @@ -9,6 +9,8 @@ if test "x$have_libexpat" = "xyes"; then AC_DEFINE([HAVE_LIBEXPAT], [1], [Define to 1 if you have libexpat.]) EXPAT_LIBS=-lexpat EXPAT_CFLAGS= + AC_SUBST([EXPAT_LIBS]) + AC_SUBST([EXPAT_CFLAGS]) fi LIBS=$LIBS_save diff --git a/makerelease-osx.mk b/makerelease-osx.mk index 1e00c783..7295ea01 100644 --- a/makerelease-osx.mk +++ b/makerelease-osx.mk @@ -32,9 +32,6 @@ # - $ ln -s ../makerelease-os.mk Makefile # - $ make # -# To make an universal build (x86_64, i686) use instead: -# - $ make universal -# # To make an both builds use instead: # - $ make multi # @@ -91,14 +88,14 @@ endif # Set up compiler. CC = cc export CC -CXX = c++ +CXX = c++ -stdlib=libc++ export CXX # Set up compiler/linker flags. OPTFLAGS ?= -Os -CFLAGS ?= -mmacosx-version-min=10.7 $(OPTFLAGS) +CFLAGS ?= -mmacosx-version-min=10.10 $(OPTFLAGS) export CFLAGS -CXXFLAGS ?= -mmacosx-version-min=10.7 $(OPTFLAGS) +CXXFLAGS ?= -mmacosx-version-min=10.10 $(OPTFLAGS) export CXXFLAGS LDFLAGS ?= -Wl,-dead_strip export LDFLAGS @@ -116,32 +113,51 @@ expat_url = http://sourceforge.net/projects/expat/files/expat/$(expat_version)/e expat_cflags=$(LTO_FLAGS) expat_ldflags=$(CFLAGS) $(LTO_FLAGS) -cares_version = 1.10.0 -cares_hash = e44e6575d5af99cb3a38461486e1ee8b49810eb5 +cares_version = 1.11.0 +cares_hash = 8c20b2680099ac73861a780c731edd59e010383a cares_url = http://c-ares.haxx.se/download/c-ares-$(cares_version).tar.gz cares_confflags = "--enable-optimize=$(OPTFLAGS)" cares_cflags=$(LTO_FLAGS) cares_ldflags=$(CFLAGS) $(LTO_FLAGS) -sqlite_version = autoconf-3081002 -sqlite_hash = c2f2c17d3dc4c4e179d35cc04e4420636d48a152 -sqlite_url = http://sqlite.org/2015/sqlite-$(sqlite_version).tar.gz +sqlite_version = autoconf-3110000 +sqlite_hash = e2d300e4b24af5ecd67a1396488893fa44864e36 +sqlite_url = http://sqlite.org/2016/sqlite-$(sqlite_version).tar.gz sqlite_cflags=$(LTO_FLAGS) sqlite_ldflags=$(CFLAGS) $(LTO_FLAGS) -gmp_version = 5.1.3 -gmp_hash = b35928e2927b272711fdfbf71b7cfd5f86a6b165 +gmp_version = 6.1.0 +gmp_hash = db38c7b67f8eea9f2e5b8a48d219165b2fdab11f gmp_url = https://ftp.gnu.org/gnu/gmp/gmp-$(gmp_version).tar.bz2 gmp_confflags = --disable-cxx --enable-assembly --with-pic gmp_confflags_x86_64 = --enable-fat +libgpgerror_version = 1.21 +libgpgerror_hash = ef1dfb2f8761f019091180596e9e638d8cc37513 +libgpgerror_url = https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-$(libgpgerror_version).tar.bz2 +libgpgerror_cflags=$(LTO_FLAGS) +libgpgerror_ldflags=$(CFLAGS) $(LTO_FLAGS) +libgpgerror_confflags = --with-pic --disable-languages --disable-doc --disable-nls + +libgcrypt_version = 1.6.5 +libgcrypt_hash = c3a5a13e717f7b3e3895650afc1b6e0d3fe9c726 +libgcrypt_url = https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-$(libgcrypt_version).tar.bz2 +libgcrypt_confflags=--with-gpg-error-prefix=$(PWD)/arch + +libssh2_version = 1.7.0 +libssh2_hash = 02fef9bdafce3da466b36581a4ff53d519637aca +libssh2_url = https://www.libssh2.org/download/libssh2-$(libssh2_version).tar.gz +libssh2_cflags=$(LTO_FLAGS) +libssh2_ldflags=$(CFLAGS) $(LTO_FLAGS) +libssh2_confflags = --with-pic --with-libgcrypt --with-libgcrypt-prefix=$(PWD)/arch + cppunit_version = 1.12.1 cppunit_hash = f1ab8986af7a1ffa6760f4bacf5622924639bf4a cppunit_url = http://sourceforge.net/projects/cppunit/files/cppunit/$(cppunit_version)/cppunit-$(cppunit_version).tar.gz # ARCHLIBS that can be template build -ARCHLIBS = expat cares sqlite gmp cppunit +ARCHLIBS = expat cares sqlite gmp libgpgerror libgcrypt libssh2 cppunit # NONARCHLIBS that cannot be template build NONARCHLIBS = zlib @@ -167,11 +183,12 @@ ARIA2_CONFFLAGS = \ --with-libz \ --with-libexpat \ --with-libcares \ + --with-libgcrypt \ + --with-libssh2 \ --without-libuv \ --without-gnutls \ --without-openssl \ --without-libnettle \ - --without-libgcrypt \ --without-libxml2 \ ARIA2_STATIC=yes ARIA2_DOCDIR = $(ARIA2_PREFIX)/share/doc/aria2 @@ -223,14 +240,14 @@ CPUS = $(shell sysctl hw.ncpu | cut -d" " -f2) # default target all:: -universal all:: +all:: @if test "x$(NON_RELEASE)" = "x" && !(git describe --tags --exact); then \ echo 'Not on a release tag; override by defining NON_RELEASE!'; \ exit 1; \ fi # No dice without sphinx -universal all:: +all:: @if test "x$$(which sphinx-build)" = "x"; then \ echo "sphinx-build not present"; \ exit 1; \ @@ -263,20 +280,23 @@ deps:: .PRECIOUS: cares.stamp cares.stamp: cares.tar.gz cares.check - tar xzf $< + tar xf $< mv c-ares-$($(basename $@)_version) $(basename $@) touch $@ +.PRECIOUS: libgpgerror.stamp +libgpgerror.stamp: libgpgerror.tar.gz libgpgerror.check + tar xf $< + mv libgpg-error-$($(basename $@)_version) $(basename $@) + touch $@ + # Using (NON)ARCH_template kinda stinks, but real multi-target pattern rules # only exist in feverish dreams. define NONARCH_template $(1).build: $(1).x86_64.build -$(1).universal.build: $(1).x86_64.build $(1).i686.build - deps:: $(1).build -deps.universal:: $(1).universal.build endef .PRECIOUS: zlib.%.build @@ -286,7 +306,7 @@ zlib.%.build: zlib.stamp $(eval ARCH := $(subst .,,$(suffix $(DEST)))) rsync -a $(BASE)/ $(DEST) ( cd $(DEST) && ./configure \ - --static --prefix=$(PWD)/$(ARCH) \ + --static --prefix=$(PWD)/arch \ ) $(MAKE) -C $(DEST) -sj$(CPUS) CFLAGS="$(CFLAGS) $(LTO_FLAGS) -arch $(ARCH)" $(MAKE) -C $(DEST) -sj$(CPUS) CFLAGS="$(CFLAGS) $(LTO_FLAGS) -arch $(ARCH)" check @@ -302,14 +322,13 @@ $(1).%.build: $(1).stamp $$(eval ARCH := $$(subst .,,$$(suffix $$(DEST)))) mkdir -p $$(DEST) ( cd $$(DEST) && ../$(1)/configure \ - --host=$$(ARCH)-apple-darwin11.4.2 \ - --build=$$(ARCH)-apple-darwin11.4.2 \ --enable-static --disable-shared \ - --prefix=$$(PWD)/$$(ARCH) \ - $$($(1)_confflags) $$($(1)_confflags_$$(ARCH)) \ + --prefix=$(PWD)/arch \ + $$($(1)_confflags) \ CFLAGS="$$(CFLAGS) $$($(1)_cflags) -arch $$(ARCH)" \ - CXXFLAGS="$$(CXXFLAGS) $$($(1)_cxxflags) -arch $$(ARCH) -stdlib=libc++ -std=c++11" \ + CXXFLAGS="$$(CXXFLAGS) $$($(1)_cxxflags) -arch $$(ARCH) -std=c++11" \ LDFLAGS="$(LDFLAGS) $$($(1)_ldflags)" \ + PKG_CONFIG_PATH=$$(PWD)/arch/lib/pkgconfig \ ) $$(MAKE) -C $$(DEST) -sj$(CPUS) $$(MAKE) -C $$(DEST) -sj$(CPUS) check @@ -318,17 +337,14 @@ $(1).%.build: $(1).stamp $(1).build: $(1).x86_64.build -$(1).universal.build: $(1).x86_64.build $(1).i686.build - deps:: $(1).build -deps.universal:: $(1).universal.build endef $(foreach lib,$(ARCHLIBS),$(eval $(call ARCH_template,$(lib)))) .PRECIOUS: aria2.%.build -aria2.%.build: zlib.%.build expat.%.build gmp.%.build cares.%.build sqlite.%.build cppunit.%.build +aria2.%.build: zlib.%.build expat.%.build gmp.%.build cares.%.build sqlite.%.build libgpgerror.%.build libgcrypt.%.build libssh2.%.build cppunit.%.build $(eval DEST := $$(basename $$@)) $(eval ARCH := $$(subst .,,$$(suffix $$(DEST)))) mkdir -p $(DEST) @@ -336,12 +352,12 @@ aria2.%.build: zlib.%.build expat.%.build gmp.%.build cares.%.build sqlite.%.bui --prefix=$(ARIA2_PREFIX) \ --bindir=$(PWD)/$(DEST) \ --sysconfdir=/etc \ - --with-cppunit-prefix=$(PWD)/$(ARCH) \ + --with-cppunit-prefix=$(PWD)/arch \ $(ARIA2_CONFFLAGS) \ - CFLAGS="$(CFLAGS) $(LTO_FLAGS) -arch $(ARCH) -I$(PWD)/$(ARCH)/include" \ - CXXFLAGS="$(CXXFLAGS) $(LTO_FLAGS) -arch $(ARCH) -I$(PWD)/$(ARCH)/include" \ - LDFLAGS="$(LDFLAGS) $(CXXFLAGS) $(LTO_FLAGS) -L$(PWD)/$(ARCH)/lib" \ - PKG_CONFIG_PATH=$(PWD)/$(ARCH)/lib/pkgconfig \ + CFLAGS="$(CFLAGS) $(LTO_FLAGS) -arch $(ARCH) -I$(PWD)/arch/include" \ + CXXFLAGS="$(CXXFLAGS) $(LTO_FLAGS) -arch $(ARCH) -I$(PWD)/arch/include" \ + LDFLAGS="$(LDFLAGS) $(CXXFLAGS) $(LTO_FLAGS) -L$(PWD)/arch/lib" \ + PKG_CONFIG_PATH=$(PWD)/arch/lib/pkgconfig \ ) $(MAKE) -C $(DEST) -sj$(CPUS) $(MAKE) -C $(DEST) -sj$(CPUS) check @@ -356,19 +372,6 @@ aria2.build: aria2.x86_64.build arch -64 $(ARIA2_PREFIX)/bin/aria2c -v touch $@ -aria2.universal.build: aria2.x86_64.build aria2.i686.build - mkdir -p $(ARIA2_PREFIX)/bin - # Got two binaries now. Merge them into one universal binary and remove - # the old ones. - lipo \ - -arch x86_64 aria2.x86_64/aria2c \ - -arch i686 aria2.i686/aria2c \ - -create -output $(ARIA2_PREFIX)/bin/aria2c - # Basic sanity check - arch -64 $(ARIA2_PREFIX)/bin/aria2c -v - arch -32 $(ARIA2_PREFIX)/bin/aria2c -v - touch $@ - $(ARIA2_CHANGELOG): aria2.x86_64.build git log --pretty=fuller --date=short $(PREV_TAG)..HEAD > $@ @@ -382,13 +385,6 @@ $(ARIA2_DIST).tar.bz2: aria2.build $(ARIA2_DOCS) $(ARIA2_CHANGELOG) --options='compression-level=9' \ $(ARIA2) -$(ARIA2_DIST).universal.tar.bz2: aria2.universal.build $(ARIA2_DOCS) $(ARIA2_CHANGELOG) - find $(ARIA2_PREFIX) -exec touch "{}" \; - tar -cf $@ \ - --use-compress-program=bzip2 \ - --options='compression-level=9' \ - $(ARIA2) - $(ARIA2_DIST).pkg: aria2.build $(ARIA2_DOCS) $(ARIA2_CHANGELOG) find $(ARIA2_PREFIX) -exec touch "{}" \; pkgbuild \ @@ -412,29 +408,6 @@ $(ARIA2_DIST).pkg: aria2.build $(ARIA2_DOCS) $(ARIA2_CHANGELOG) $@ rm -rf out.pkg paths.pkg dist.xml -$(ARIA2_DIST).universal.pkg: aria2.universal.build $(ARIA2_DOCS) $(ARIA2_CHANGELOG) - find $(ARIA2_PREFIX) -exec touch "{}" \; - pkgbuild \ - --root $(ARIA2) \ - --identifier aria2 \ - --version $(VERSION) \ - --install-location /usr/local/aria2 \ - --ownership recommended \ - out.pkg - pkgbuild \ - --root $(SRCDIR)/osx-package/etc \ - --identifier aria2.paths \ - --version $(VERSION) \ - --install-location /etc \ - --ownership recommended \ - paths.pkg - echo "$$ARIA2_DISTXML" > dist.xml - productbuild \ - --distribution dist.xml \ - --resources $(ARIA2_PREFIX)/share/doc/aria2 \ - $@ - rm -rf out.pkg paths.pkg dist.xml - $(ARIA2_DIST).dmg: $(ARIA2_DIST).pkg -rm -rf dmg mkdir -p dmg/Docs @@ -450,35 +423,12 @@ $(ARIA2_DIST).dmg: $(ARIA2_DIST).pkg hdiutil flatten $@ rm -rf $@.uncompressed.dmg dmg -$(ARIA2_DIST).universal.dmg: $(ARIA2_DIST).universal.pkg - -rm -rf dmg - mkdir -p dmg/Docs - cp -av $(ARIA2_DIST).universal.pkg dmg/aria2.pkg - find $(ARIA2_PREFIX)/share/doc/aria2 -type f -depth 1 -exec cp -av "{}" dmg/Docs \; - rm -rf dmg/Docs/README dmg/Docs/README.rst - cp $(SRCDIR)/osx-package/DS_Store dmg/.DS_Store - hdiutil create $@.uncompressed \ - -srcfolder dmg \ - -volname "aria2 $(VERSION) Intel Universal" \ - -ov - hdiutil convert -format UDBZ -o $@ $@.uncompressed.dmg - hdiutil flatten $@ - rm -rf $@.uncompressed.dmg dmg - dist.build: $(ARIA2_DIST).tar.bz2 $(ARIA2_DIST).pkg $(ARIA2_DIST).dmg echo 'Build success: $(ARIA2_DIST)' touch $@ -dist.universal.build: $(ARIA2_DIST).universal.tar.bz2 $(ARIA2_DIST).universal.pkg $(ARIA2_DIST).universal.dmg - echo 'Build success: $(ARIA2_DIST)' - touch $@ - all:: dist.build -universal:: dist.universal.build - -multi: all universal - clean-dist: rm -rf $(ARIA2_DIST).tar.bz2 $(ARIA2_DIST).pkg $(ARIA2_DIST).dmg @@ -486,10 +436,10 @@ clean: clean-dist rm -rf *aria2* cleaner: clean - rm -rf *.build *.check *.stamp $(ARCHLIBS) $(NONARCHLIBS) *x86_64* *i686* + rm -rf *.build *.check *.stamp $(ARCHLIBS) $(NONARCHLIBS) arch really-clean: cleaner rm -rf *.tar.* -.PHONY: all universal multi clean-dist clean cleaner really-clean +.PHONY: all multi clean-dist clean cleaner really-clean diff --git a/po/Makevars b/po/Makevars index 6b74cb59..77f8d8a3 100644 --- a/po/Makevars +++ b/po/Makevars @@ -34,7 +34,7 @@ COPYRIGHT_HOLDER = Tatsuhiro Tsujikawa # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. -MSGID_BUGS_ADDRESS = http://aria2.sourceforge.net/ +MSGID_BUGS_ADDRESS = https://aria2.github.io/ # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. diff --git a/src/ARC4Encryptor.h b/src/ARC4Encryptor.h index 96c55936..9100de22 100644 --- a/src/ARC4Encryptor.h +++ b/src/ARC4Encryptor.h @@ -38,13 +38,13 @@ #include "common.h" #ifdef USE_INTERNAL_ARC4 -# include "InternalARC4Encryptor.h" +#include "InternalARC4Encryptor.h" #elif HAVE_LIBNETTLE -# include "LibnettleARC4Encryptor.h" +#include "LibnettleARC4Encryptor.h" #elif HAVE_LIBGCRYPT -# include "LibgcryptARC4Encryptor.h" +#include "LibgcryptARC4Encryptor.h" #elif HAVE_OPENSSL -# include "LibsslARC4Encryptor.h" +#include "LibsslARC4Encryptor.h" #endif #endif // D_ARC4_ENCRYPTOR_H diff --git a/src/AbstractAuthResolver.cc b/src/AbstractAuthResolver.cc index 9eceeba4..6a4e28b2 100644 --- a/src/AbstractAuthResolver.cc +++ b/src/AbstractAuthResolver.cc @@ -42,8 +42,8 @@ AbstractAuthResolver::AbstractAuthResolver() {} AbstractAuthResolver::~AbstractAuthResolver() {} -void AbstractAuthResolver::setUserDefinedCred -(std::string user, std::string password) +void AbstractAuthResolver::setUserDefinedCred(std::string user, + std::string password) { userDefinedUser_ = std::move(user); userDefinedPassword_ = std::move(password); @@ -55,8 +55,8 @@ AbstractAuthResolver::getUserDefinedAuthConfig() const return AuthConfig::create(userDefinedUser_, userDefinedPassword_); } -void AbstractAuthResolver::setDefaultCred -(std::string user, std::string password) +void AbstractAuthResolver::setDefaultCred(std::string user, + std::string password) { defaultUser_ = std::move(user); defaultPassword_ = std::move(password); diff --git a/src/AbstractAuthResolver.h b/src/AbstractAuthResolver.h index 25dd923e..b03e72e2 100644 --- a/src/AbstractAuthResolver.h +++ b/src/AbstractAuthResolver.h @@ -52,6 +52,7 @@ public: void setDefaultCred(std::string user, std::string password); std::unique_ptr getDefaultAuthConfig() const; + private: std::string userDefinedUser_; std::string userDefinedPassword_; diff --git a/src/AbstractBtMessage.cc b/src/AbstractBtMessage.cc index 76eb4787..3bb90967 100644 --- a/src/AbstractBtMessage.cc +++ b/src/AbstractBtMessage.cc @@ -40,18 +40,19 @@ namespace aria2 { AbstractBtMessage::AbstractBtMessage(uint8_t id, const char* name) - : BtMessage(id), - invalidate_(false), - uploading_(false), - cuid_(0), - name_(name), - pieceStorage_(nullptr), - dispatcher_(nullptr), - messageFactory_(nullptr), - requestFactory_(nullptr), - peerConnection_(nullptr), - metadataGetMode_(false) -{} + : BtMessage(id), + invalidate_(false), + uploading_(false), + cuid_(0), + name_(name), + pieceStorage_(nullptr), + dispatcher_(nullptr), + messageFactory_(nullptr), + requestFactory_(nullptr), + peerConnection_(nullptr), + metadataGetMode_(false) +{ +} AbstractBtMessage::~AbstractBtMessage() {} @@ -62,14 +63,13 @@ void AbstractBtMessage::setPeer(const std::shared_ptr& peer) void AbstractBtMessage::validate() { - if(validator_) { + if (validator_) { validator_->validate(); } } -void -AbstractBtMessage::setBtMessageValidator -(std::unique_ptr validator) +void AbstractBtMessage::setBtMessageValidator( + std::unique_ptr validator) { validator_ = std::move(validator); } diff --git a/src/AbstractBtMessage.h b/src/AbstractBtMessage.h index 5b46ce21..d03b6567 100644 --- a/src/AbstractBtMessage.h +++ b/src/AbstractBtMessage.h @@ -71,69 +71,38 @@ private: std::unique_ptr validator_; bool metadataGetMode_; + protected: - PieceStorage* getPieceStorage() const - { - return pieceStorage_; - } + PieceStorage* getPieceStorage() const { return pieceStorage_; } - PeerConnection* getPeerConnection() const - { - return peerConnection_; - } + PeerConnection* getPeerConnection() const { return peerConnection_; } - BtMessageDispatcher* getBtMessageDispatcher() const - { - return dispatcher_; - } + BtMessageDispatcher* getBtMessageDispatcher() const { return dispatcher_; } - BtRequestFactory* getBtRequestFactory() const - { - return requestFactory_; - } + BtRequestFactory* getBtRequestFactory() const { return requestFactory_; } - BtMessageFactory* getBtMessageFactory() const - { - return messageFactory_; - } + BtMessageFactory* getBtMessageFactory() const { return messageFactory_; } + + bool isMetadataGetMode() const { return metadataGetMode_; } - bool isMetadataGetMode() const - { - return metadataGetMode_; - } public: AbstractBtMessage(uint8_t id, const char* name); virtual ~AbstractBtMessage(); - virtual bool isInvalidate() CXX11_OVERRIDE { - return invalidate_; - } + virtual bool isInvalidate() CXX11_OVERRIDE { return invalidate_; } - void setInvalidate(bool invalidate) { - invalidate_ = invalidate; - } + void setInvalidate(bool invalidate) { invalidate_ = invalidate; } - virtual bool isUploading() CXX11_OVERRIDE { - return uploading_; - } + virtual bool isUploading() CXX11_OVERRIDE { return uploading_; } - void setUploading(bool uploading) { - uploading_ = uploading; - } + void setUploading(bool uploading) { uploading_ = uploading; } - cuid_t getCuid() const { - return cuid_; - } + cuid_t getCuid() const { return cuid_; } - void setCuid(cuid_t cuid) { - cuid_ = cuid; - } + void setCuid(cuid_t cuid) { cuid_ = cuid; } - const std::shared_ptr& getPeer() const - { - return peer_; - } + const std::shared_ptr& getPeer() const { return peer_; } void setPeer(const std::shared_ptr& peer); @@ -143,11 +112,15 @@ public: virtual void onQueued() CXX11_OVERRIDE {} - virtual void onAbortOutstandingRequestEvent - (const BtAbortOutstandingRequestEvent& event) CXX11_OVERRIDE {} + virtual void onAbortOutstandingRequestEvent( + const BtAbortOutstandingRequestEvent& event) CXX11_OVERRIDE + { + } - virtual void onCancelSendingPieceEvent - (const BtCancelSendingPieceEvent& event) CXX11_OVERRIDE {} + virtual void onCancelSendingPieceEvent(const BtCancelSendingPieceEvent& event) + CXX11_OVERRIDE + { + } virtual void onChokingEvent(const BtChokingEvent& event) CXX11_OVERRIDE {} @@ -163,15 +136,9 @@ public: void setBtRequestFactory(BtRequestFactory* factory); - const char* getName() const - { - return name_; - } + const char* getName() const { return name_; } - void enableMetadataGetMode() - { - metadataGetMode_ = true; - } + void enableMetadataGetMode() { metadataGetMode_ = true; } }; } // namespace aria2 diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc index 687e7881..c2ead096 100644 --- a/src/AbstractCommand.cc +++ b/src/AbstractCommand.cc @@ -74,31 +74,28 @@ namespace aria2 { -AbstractCommand::AbstractCommand -(cuid_t cuid, - const std::shared_ptr& req, - const std::shared_ptr& fileEntry, - RequestGroup* requestGroup, - DownloadEngine* e, - const std::shared_ptr& s, - const std::shared_ptr& socketRecvBuffer, - bool incNumConnection) - : Command(cuid), - req_(req), - fileEntry_(fileEntry), - socket_(s), - socketRecvBuffer_(socketRecvBuffer), +AbstractCommand::AbstractCommand( + cuid_t cuid, const std::shared_ptr& req, + const std::shared_ptr& fileEntry, RequestGroup* requestGroup, + DownloadEngine* e, const std::shared_ptr& s, + const std::shared_ptr& socketRecvBuffer, + bool incNumConnection) + : Command(cuid), + req_(req), + fileEntry_(fileEntry), + socket_(s), + socketRecvBuffer_(socketRecvBuffer), #ifdef ENABLE_ASYNC_DNS - asyncNameResolverMan_(make_unique()), + asyncNameResolverMan_(make_unique()), #endif // ENABLE_ASYNC_DNS - requestGroup_(requestGroup), - e_(e), - checkPoint_(global::wallclock()), - serverStatTimer_(global::wallclock()), - timeout_(requestGroup->getTimeout()), - checkSocketIsReadable_(false), - checkSocketIsWritable_(false), - incNumConnection_(incNumConnection) + requestGroup_(requestGroup), + e_(e), + checkPoint_(global::wallclock()), + serverStatTimer_(global::wallclock()), + timeout_(requestGroup->getTimeout()), + checkSocketIsReadable_(false), + checkSocketIsWritable_(false), + incNumConnection_(incNumConnection) { if (socket_ && socket_->isOpen()) { setReadCheckSocket(socket_); @@ -127,19 +124,18 @@ AbstractCommand::~AbstractCommand() } } -void -AbstractCommand::useFasterRequest(const std::shared_ptr& fasterRequest) +void AbstractCommand::useFasterRequest( + const std::shared_ptr& fasterRequest) { A2_LOG_INFO(fmt("CUID#%" PRId64 " - Use faster Request hostname=%s, port=%u", - getCuid(), - fasterRequest->getHost().c_str(), + getCuid(), fasterRequest->getHost().c_str(), fasterRequest->getPort())); // Cancel current Request object and use faster one. fileEntry_->removeRequest(req_); e_->setNoWait(true); - e_->addCommand - (InitiateConnectionCommandFactory::createInitiateConnectionCommand - (getCuid(), fasterRequest, fileEntry_, requestGroup_, e_)); + e_->addCommand( + InitiateConnectionCommandFactory::createInitiateConnectionCommand( + getCuid(), fasterRequest, fileEntry_, requestGroup_, e_)); } bool AbstractCommand::shouldProcess() const @@ -152,6 +148,10 @@ bool AbstractCommand::shouldProcess() const if (socketRecvBuffer_ && !socketRecvBuffer_->bufferEmpty()) { return true; } + + if (socket_ && socket_->getRecvBufferedLength()) { + return true; + } } if (checkSocketIsWritable_ && writeEventEnabled()) { @@ -167,7 +167,7 @@ bool AbstractCommand::shouldProcess() const if (!checkSocketIsReadable_ && !checkSocketIsWritable_ && !resolverChecked) { return true; } -#else // ENABLE_ASYNC_DNS +#else // ENABLE_ASYNC_DNS if (!checkSocketIsReadable_ && !checkSocketIsWritable_) { return true; } @@ -180,11 +180,8 @@ bool AbstractCommand::execute() { A2_LOG_DEBUG(fmt("CUID#%" PRId64 " - socket: read:%d, write:%d, hup:%d, err:%d", - getCuid(), - readEventEnabled(), - writeEventEnabled(), - hupEventEnabled(), - errorEventEnabled())); + getCuid(), readEventEnabled(), writeEventEnabled(), + hupEventEnabled(), errorEventEnabled())); try { if (requestGroup_->downloadFinished() || requestGroup_->isHaltRequested()) { return true; @@ -194,8 +191,7 @@ bool AbstractCommand::execute() A2_LOG_DEBUG(fmt("CUID#%" PRId64 " - Discard original URI=%s because it is" " requested.", - getCuid(), - req_->getUri().c_str())); + getCuid(), req_->getUri().c_str())); return prepareForRetry(0); } @@ -243,8 +239,8 @@ bool AbstractCommand::execute() if (getOption()->getAsBool(PREF_SELECT_LEAST_USED_HOST)) { getDownloadEngine()->getRequestGroupMan()->getUsedHosts(usedHosts); } - auto fasterRequest = fileEntry_->findFasterRequest - (req_, usedHosts, e_->getRequestGroupMan()->getServerStatMan()); + auto fasterRequest = fileEntry_->findFasterRequest( + req_, usedHosts, e_->getRequestGroupMan()->getServerStatMan()); if (fasterRequest) { useFasterRequest(fasterRequest); return true; @@ -296,8 +292,8 @@ bool AbstractCommand::execute() size_t minSplitSize = calculateMinSplitSize(); size_t maxSegments = req_->getMaxPipelinedRequest(); if (segments_.size() < maxSegments) { - sm->getSegment - (segments_, getCuid(), minSplitSize, fileEntry_, maxSegments); + sm->getSegment(segments_, getCuid(), minSplitSize, fileEntry_, + maxSegments); } if (segments_.empty()) { return prepareForRetry(0); @@ -308,22 +304,21 @@ bool AbstractCommand::execute() } if (errorEventEnabled()) { - throw DL_RETRY_EX - (fmt(MSG_NETWORK_PROBLEM, socket_->getSocketError().c_str())); + throw DL_RETRY_EX( + fmt(MSG_NETWORK_PROBLEM, socket_->getSocketError().c_str())); } if (checkPoint_.difference(global::wallclock()) >= timeout_) { // timeout triggers ServerStat error state. - auto ss = e_->getRequestGroupMan()->getOrCreateServerStat - (req_->getHost(), req_->getProtocol()); + auto ss = e_->getRequestGroupMan()->getOrCreateServerStat( + req_->getHost(), req_->getProtocol()); ss->setError(); // When DNS query was timeout, req_->getConnectedAddr() is // empty. if (!req_->getConnectedAddr().empty()) { // Purging IP address cache to renew IP address. A2_LOG_DEBUG(fmt("CUID#%" PRId64 " - Marking IP address %s as bad", - getCuid(), - req_->getConnectedAddr().c_str())); + getCuid(), req_->getConnectedAddr().c_str())); e_->markBadIPAddress(req_->getConnectedHostname(), req_->getConnectedAddr(), req_->getConnectedPort()); @@ -343,11 +338,11 @@ bool AbstractCommand::execute() return false; } catch (DlAbortEx& err) { - requestGroup_->setLastErrorCode(err.getErrorCode()); + requestGroup_->setLastErrorCode(err.getErrorCode(), err.what()); if (req_) { - A2_LOG_ERROR_EX - (fmt(MSG_DOWNLOAD_ABORTED, getCuid(), req_->getUri().c_str()), - DL_ABORT_EX2(fmt("URI=%s", req_->getCurrentUri().c_str()), err)); + A2_LOG_ERROR_EX( + fmt(MSG_DOWNLOAD_ABORTED, getCuid(), req_->getUri().c_str()), + DL_ABORT_EX2(fmt("URI=%s", req_->getCurrentUri().c_str()), err)); fileEntry_->addURIResult(req_->getUri(), err.getErrorCode()); if (err.getErrorCode() == error_code::CANNOT_RESUME) { requestGroup_->increaseResumeFailureCount(); @@ -362,9 +357,9 @@ bool AbstractCommand::execute() } catch (DlRetryEx& err) { assert(req_); - A2_LOG_INFO_EX - (fmt(MSG_RESTARTING_DOWNLOAD, getCuid(), req_->getUri().c_str()), - DL_RETRY_EX2(fmt("URI=%s", req_->getCurrentUri().c_str()), err)); + A2_LOG_INFO_EX( + fmt(MSG_RESTARTING_DOWNLOAD, getCuid(), req_->getUri().c_str()), + DL_RETRY_EX2(fmt("URI=%s", req_->getCurrentUri().c_str()), err)); req_->addTryCount(); req_->resetRedirectCount(); req_->resetUri(); @@ -373,10 +368,10 @@ bool AbstractCommand::execute() bool isAbort = maxTries != 0 && req_->getTryCount() >= maxTries; if (isAbort) { A2_LOG_INFO(fmt(MSG_MAX_TRY, getCuid(), req_->getTryCount())); - A2_LOG_ERROR_EX - (fmt(MSG_DOWNLOAD_ABORTED, getCuid(), req_->getUri().c_str()), err); + A2_LOG_ERROR_EX( + fmt(MSG_DOWNLOAD_ABORTED, getCuid(), req_->getUri().c_str()), err); fileEntry_->addURIResult(req_->getUri(), err.getErrorCode()); - requestGroup_->setLastErrorCode(err.getErrorCode()); + requestGroup_->setLastErrorCode(err.getErrorCode(), err.what()); if (err.getErrorCode() == error_code::CANNOT_RESUME) { requestGroup_->increaseResumeFailureCount(); } @@ -392,13 +387,14 @@ bool AbstractCommand::execute() return prepareForRetry(0); } catch (DownloadFailureException& err) { - requestGroup_->setLastErrorCode(err.getErrorCode()); + requestGroup_->setLastErrorCode(err.getErrorCode(), err.what()); if (req_) { - A2_LOG_ERROR_EX - (fmt(MSG_DOWNLOAD_ABORTED, getCuid(), req_->getUri().c_str()), - DL_ABORT_EX2(fmt("URI=%s", req_->getCurrentUri().c_str()), err)); + A2_LOG_ERROR_EX( + fmt(MSG_DOWNLOAD_ABORTED, getCuid(), req_->getUri().c_str()), + DL_ABORT_EX2(fmt("URI=%s", req_->getCurrentUri().c_str()), err)); fileEntry_->addURIResult(req_->getUri(), err.getErrorCode()); - } else { + } + else { A2_LOG_ERROR_EX(EX_EXCEPTION_CAUGHT, err); } requestGroup_->setHaltRequested(true); @@ -422,8 +418,8 @@ void AbstractCommand::tryReserved() return; } } - A2_LOG_DEBUG - (fmt("CUID#%" PRId64 " - Trying reserved/pooled request.", getCuid())); + A2_LOG_DEBUG( + fmt("CUID#%" PRId64 " - Trying reserved/pooled request.", getCuid())); std::vector> commands; requestGroup_->createNextCommand(commands, e_, 1); e_->setNoWait(true); @@ -443,8 +439,7 @@ bool AbstractCommand::prepareForRetry(time_t wait) req_->setMaxPipelinedRequest(1); fileEntry_->poolRequest(req_); - A2_LOG_DEBUG(fmt("CUID#%" PRId64 " - Pooling request URI=%s", - getCuid(), + A2_LOG_DEBUG(fmt("CUID#%" PRId64 " - Pooling request URI=%s", getCuid(), req_->getUri().c_str())); if (getSegmentMan()) { getSegmentMan()->recognizeSegmentFor(fileEntry_); @@ -518,8 +513,7 @@ void AbstractCommand::onAbort() uris.reserve(res.size()); std::transform(std::begin(res), std::end(res), std::back_inserter(uris), std::mem_fn(&URIResult::getURI)); - A2_LOG_DEBUG(fmt("CUID#%" PRId64 " - %lu URIs found.", - getCuid(), + A2_LOG_DEBUG(fmt("CUID#%" PRId64 " - %lu URIs found.", getCuid(), static_cast(uris.size()))); fileEntry_->addUris(std::begin(uris), std::end(uris)); getSegmentMan()->recognizeSegmentFor(fileEntry_); @@ -536,8 +530,8 @@ void AbstractCommand::disableReadCheckSocket() readCheckTarget_.reset(); } -void -AbstractCommand::setReadCheckSocket(const std::shared_ptr& socket) +void AbstractCommand::setReadCheckSocket( + const std::shared_ptr& socket) { if (!socket->isOpen()) { disableReadCheckSocket(); @@ -558,9 +552,8 @@ AbstractCommand::setReadCheckSocket(const std::shared_ptr& socket) readCheckTarget_ = socket; } -void -AbstractCommand::setReadCheckSocketIf(const std::shared_ptr& socket, - bool pred) +void AbstractCommand::setReadCheckSocketIf( + const std::shared_ptr& socket, bool pred) { if (pred) { setReadCheckSocket(socket); @@ -580,8 +573,8 @@ void AbstractCommand::disableWriteCheckSocket() writeCheckTarget_.reset(); } -void -AbstractCommand::setWriteCheckSocket(const std::shared_ptr& socket) +void AbstractCommand::setWriteCheckSocket( + const std::shared_ptr& socket) { if (!socket->isOpen()) { disableWriteCheckSocket(); @@ -602,8 +595,8 @@ AbstractCommand::setWriteCheckSocket(const std::shared_ptr& socket) writeCheckTarget_ = socket; } -void AbstractCommand::setWriteCheckSocketIf -(const std::shared_ptr& socket, bool pred) +void AbstractCommand::setWriteCheckSocketIf( + const std::shared_ptr& socket, bool pred) { if (pred) { setWriteCheckSocket(socket); @@ -623,10 +616,8 @@ void AbstractCommand::swapSocket(std::shared_ptr& socket) namespace { // Constructs proxy URI, merging username and password if they are // defined. -std::string makeProxyUri(PrefPtr proxyPref, - PrefPtr proxyUser, - PrefPtr proxyPasswd, - const Option* option) +std::string makeProxyUri(PrefPtr proxyPref, PrefPtr proxyUser, + PrefPtr proxyPasswd, const Option* option) { uri::UriStruct us; if (!uri::parse(us, option->get(proxyPref))) { @@ -645,15 +636,13 @@ std::string makeProxyUri(PrefPtr proxyPref, namespace { // Returns proxy option value for the given protocol. -std::string getProxyOptionFor(PrefPtr proxyPref, - PrefPtr proxyUser, - PrefPtr proxyPasswd, - const Option* option) +std::string getProxyOptionFor(PrefPtr proxyPref, PrefPtr proxyUser, + PrefPtr proxyPasswd, const Option* option) { std::string uri = makeProxyUri(proxyPref, proxyUser, proxyPasswd, option); if (uri.empty()) { - return makeProxyUri - (PREF_ALL_PROXY, PREF_ALL_PROXY_USER, PREF_ALL_PROXY_PASSWD, option); + return makeProxyUri(PREF_ALL_PROXY, PREF_ALL_PROXY_USER, + PREF_ALL_PROXY_PASSWD, option); } return uri; @@ -665,20 +654,18 @@ std::string getProxyOptionFor(PrefPtr proxyPref, std::string getProxyUri(const std::string& protocol, const Option* option) { if (protocol == "http") { - return getProxyOptionFor - (PREF_HTTP_PROXY, PREF_HTTP_PROXY_USER, PREF_HTTP_PROXY_PASSWD, option); + return getProxyOptionFor(PREF_HTTP_PROXY, PREF_HTTP_PROXY_USER, + PREF_HTTP_PROXY_PASSWD, option); } if (protocol == "https") { - return getProxyOptionFor(PREF_HTTPS_PROXY, - PREF_HTTPS_PROXY_USER, - PREF_HTTPS_PROXY_PASSWD, - option); + return getProxyOptionFor(PREF_HTTPS_PROXY, PREF_HTTPS_PROXY_USER, + PREF_HTTPS_PROXY_PASSWD, option); } if (protocol == "ftp" || protocol == "sftp") { - return getProxyOptionFor - (PREF_FTP_PROXY, PREF_FTP_PROXY_USER, PREF_FTP_PROXY_PASSWD, option); + return getProxyOptionFor(PREF_FTP_PROXY, PREF_FTP_PROXY_USER, + PREF_FTP_PROXY_PASSWD, option); } return A2STR::NIL; @@ -752,8 +739,8 @@ std::shared_ptr AbstractCommand::createProxyRequest() const A2_LOG_DEBUG(fmt("CUID#%" PRId64 " - Using proxy", getCuid())); } else { - A2_LOG_DEBUG - (fmt("CUID#%" PRId64 " - Failed to parse proxy string", getCuid())); + A2_LOG_DEBUG( + fmt("CUID#%" PRId64 " - Failed to parse proxy string", getCuid())); proxyRequest.reset(); } } @@ -790,8 +777,7 @@ std::string AbstractCommand::resolveHostname(std::vector& addrs, ->getOrCreateServerStat(req_->getHost(), req_->getProtocol()) ->setError(); } - throw DL_ABORT_EX2(fmt(MSG_NAME_RESOLUTION_FAILED, - getCuid(), + throw DL_ABORT_EX2(fmt(MSG_NAME_RESOLUTION_FAILED, getCuid(), hostname.c_str(), asyncNameResolverMan_->getLastError().c_str()), error_code::NAME_RESOLVE_ERROR); @@ -801,10 +787,8 @@ std::string AbstractCommand::resolveHostname(std::vector& addrs, case 1: asyncNameResolverMan_->getResolvedAddress(addrs); if (addrs.empty()) { - throw DL_ABORT_EX2(fmt(MSG_NAME_RESOLUTION_FAILED, - getCuid(), - hostname.c_str(), - "No address returned"), + throw DL_ABORT_EX2(fmt(MSG_NAME_RESOLUTION_FAILED, getCuid(), + hostname.c_str(), "No address returned"), error_code::NAME_RESOLVE_ERROR); } break; @@ -829,21 +813,20 @@ std::string AbstractCommand::resolveHostname(std::vector& addrs, return ipaddr; } -void AbstractCommand::prepareForNextAction -(std::unique_ptr checkEntry) +void AbstractCommand::prepareForNextAction( + std::unique_ptr checkEntry) { std::vector> commands; - requestGroup_->processCheckIntegrityEntry - (commands, std::move(checkEntry), e_); + requestGroup_->processCheckIntegrityEntry(commands, std::move(checkEntry), + e_); e_->addCommand(std::move(commands)); e_->setNoWait(true); } -bool AbstractCommand::checkIfConnectionEstablished -(const std::shared_ptr& socket, - const std::string& connectedHostname, - const std::string& connectedAddr, - uint16_t connectedPort) +bool AbstractCommand::checkIfConnectionEstablished( + const std::shared_ptr& socket, + const std::string& connectedHostname, const std::string& connectedAddr, + uint16_t connectedPort) { std::string error = socket->getSocketError(); if (error.empty()) { @@ -864,14 +847,12 @@ bool AbstractCommand::checkIfConnectionEstablished throw DL_RETRY_EX(fmt(MSG_ESTABLISHING_CONNECTION_FAILED, error.c_str())); } - A2_LOG_INFO(fmt(MSG_CONNECT_FAILED_AND_RETRY, - getCuid(), - connectedAddr.c_str(), - connectedPort)); + A2_LOG_INFO(fmt(MSG_CONNECT_FAILED_AND_RETRY, getCuid(), + connectedAddr.c_str(), connectedPort)); e_->setNoWait(true); - e_->addCommand - (InitiateConnectionCommandFactory::createInitiateConnectionCommand - (getCuid(), req_, fileEntry_, requestGroup_, e_)); + e_->addCommand( + InitiateConnectionCommandFactory::createInitiateConnectionCommand( + getCuid(), req_, fileEntry_, requestGroup_, e_)); return false; } @@ -909,10 +890,7 @@ void AbstractCommand::setRequest(const std::shared_ptr& request) req_ = request; } -void AbstractCommand::resetRequest() -{ - req_.reset(); -} +void AbstractCommand::resetRequest() { req_.reset(); } void AbstractCommand::setFileEntry(const std::shared_ptr& fileEntry) { @@ -942,7 +920,8 @@ const std::shared_ptr& AbstractCommand::getPieceStorage() const void AbstractCommand::checkSocketRecvBuffer() { - if (socketRecvBuffer_->bufferEmpty()) { + if (socketRecvBuffer_->bufferEmpty() && + socket_->getRecvBufferedLength() == 0) { return; } diff --git a/src/AbstractCommand.h b/src/AbstractCommand.h index 6cf5a5de..1cb366df 100644 --- a/src/AbstractCommand.h +++ b/src/AbstractCommand.h @@ -62,8 +62,7 @@ class AsyncNameResolver; class AsyncNameResolverMan; #endif // ENABLE_ASYNC_DNS -class AbstractCommand : public Command -{ +class AbstractCommand : public Command { private: std::shared_ptr req_; std::shared_ptr fileEntry_; @@ -97,15 +96,9 @@ private: bool shouldProcess() const; public: - RequestGroup* getRequestGroup() const - { - return requestGroup_; - } + RequestGroup* getRequestGroup() const { return requestGroup_; } - const std::shared_ptr& getRequest() const - { - return req_; - } + const std::shared_ptr& getRequest() const { return req_; } void setRequest(const std::shared_ptr& request); @@ -113,27 +106,15 @@ public: // setRequest(std::shared_ptr()); void resetRequest(); - const std::shared_ptr& getFileEntry() const - { - return fileEntry_; - } + const std::shared_ptr& getFileEntry() const { return fileEntry_; } void setFileEntry(const std::shared_ptr& fileEntry); - DownloadEngine* getDownloadEngine() const - { - return e_; - } + DownloadEngine* getDownloadEngine() const { return e_; } - const std::shared_ptr& getSocket() const - { - return socket_; - } + const std::shared_ptr& getSocket() const { return socket_; } - std::shared_ptr& getSocket() - { - return socket_; - } + std::shared_ptr& getSocket() { return socket_; } void setSocket(const std::shared_ptr& s); @@ -155,8 +136,7 @@ public: // arguments until resolved address is returned. Exception is // thrown on error. port is used for retrieving cached addresses. std::string resolveHostname(std::vector& addrs, - const std::string& hostname, - uint16_t port); + const std::string& hostname, uint16_t port); void tryReserved(); @@ -185,10 +165,7 @@ public: // check. void swapSocket(std::shared_ptr& socket); - std::chrono::seconds getTimeout() const - { - return timeout_; - } + std::chrono::seconds getTimeout() const { return timeout_; } void setTimeout(std::chrono::seconds timeout) { @@ -229,10 +206,7 @@ public: const std::shared_ptr& getSegmentMan() const; const std::shared_ptr& getPieceStorage() const; - Timer& getCheckPoint() - { - return checkPoint_; - } + Timer& getCheckPoint() { return checkPoint_; } void checkSocketRecvBuffer(); @@ -247,21 +221,15 @@ protected: // Returns true if the derived class wants to execute // executeInternal() unconditionally - virtual bool noCheck() const - { - return false; - } + virtual bool noCheck() const { return false; } public: - AbstractCommand(cuid_t cuid, - const std::shared_ptr& req, - const std::shared_ptr& fileEntry, - RequestGroup* requestGroup, - DownloadEngine* e, - const std::shared_ptr& s = nullptr, - const std::shared_ptr& socketRecvBuffer = - nullptr, - bool incNumConnection = true); + AbstractCommand( + cuid_t cuid, const std::shared_ptr& req, + const std::shared_ptr& fileEntry, RequestGroup* requestGroup, + DownloadEngine* e, const std::shared_ptr& s = nullptr, + const std::shared_ptr& socketRecvBuffer = nullptr, + bool incNumConnection = true); virtual ~AbstractCommand(); diff --git a/src/AbstractDiskWriter.cc b/src/AbstractDiskWriter.cc index 0944194c..4d62bf97 100644 --- a/src/AbstractDiskWriter.cc +++ b/src/AbstractDiskWriter.cc @@ -36,7 +36,7 @@ #include #ifdef HAVE_MMAP -# include +#include #endif // HAVE_MMAP #include @@ -57,24 +57,22 @@ namespace aria2 { AbstractDiskWriter::AbstractDiskWriter(const std::string& filename) - : filename_(filename), - fd_(A2_BAD_FD), + : filename_(filename), + fd_(A2_BAD_FD), #ifdef __MINGW32__ - mapView_(0), -#else // !__MINGW32__ + mapView_(0), +#else // !__MINGW32__ #endif // !__MINGW32__ - readOnly_(false), - enableMmap_(false), - mapaddr_(nullptr), - maplen_(0) + readOnly_(false), + enableMmap_(false), + mapaddr_(nullptr), + maplen_(0) -{} - -AbstractDiskWriter::~AbstractDiskWriter() { - closeFile(); } +AbstractDiskWriter::~AbstractDiskWriter() { closeFile(); } + namespace { // Returns error code depending on the platform. For MinGW32, return // the value of GetLastError(). Otherwise, return errno. @@ -82,7 +80,7 @@ int fileError() { #ifdef __MINGW32__ return GetLastError(); -#else // !__MINGW32__ +#else // !__MINGW32__ return errno; #endif // !__MINGW32__ } @@ -95,19 +93,14 @@ namespace { std::string fileStrerror(int errNum) { #ifdef __MINGW32__ - static char buf[256]; - if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - 0, - errNum, - // Default language - MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), - (LPTSTR) &buf, - sizeof(buf), - 0) == 0) { + auto msg = util::formatLastError(errNum); + if (msg.empty()) { + char buf[256]; snprintf(buf, sizeof(buf), "File I/O error %x", errNum); + return buf; } - return buf; -#else // !__MINGW32__ + return msg; +#else // !__MINGW32__ return util::safeStrerror(errNum); #endif // !__MINGW32__ } @@ -117,17 +110,19 @@ void AbstractDiskWriter::openFile(int64_t totalLength) { try { openExistingFile(totalLength); - } catch(RecoverableException& e) { - if( + } + catch (RecoverableException& e) { + if ( #ifdef __MINGW32__ - e.getErrNum() == ERROR_FILE_NOT_FOUND || - e.getErrNum() == ERROR_PATH_NOT_FOUND -#else // !__MINGW32__ - e.getErrNum() == ENOENT + e.getErrNum() == ERROR_FILE_NOT_FOUND || + e.getErrNum() == ERROR_PATH_NOT_FOUND +#else // !__MINGW32__ + e.getErrNum() == ENOENT #endif // !__MINGW32__ - ) { + ) { initAndOpenFile(totalLength); - } else { + } + else { throw; } } @@ -136,34 +131,35 @@ void AbstractDiskWriter::openFile(int64_t totalLength) void AbstractDiskWriter::closeFile() { #if defined(HAVE_MMAP) || defined(__MINGW32__) - if(mapaddr_) { + if (mapaddr_) { int errNum = 0; #ifdef __MINGW32__ - if(!UnmapViewOfFile(mapaddr_)) { + if (!UnmapViewOfFile(mapaddr_)) { errNum = GetLastError(); } CloseHandle(mapView_); mapView_ = INVALID_HANDLE_VALUE; -#else // !__MINGW32__ - if(munmap(mapaddr_, maplen_) == -1) { +#else // !__MINGW32__ + if (munmap(mapaddr_, maplen_) == -1) { errNum = errno; } #endif // !__MINGW32__ - if(errNum != 0) { + if (errNum != 0) { int errNum = fileError(); - A2_LOG_ERROR(fmt("Unmapping file %s failed: %s", - filename_.c_str(), fileStrerror(errNum).c_str())); - } else { + A2_LOG_ERROR(fmt("Unmapping file %s failed: %s", filename_.c_str(), + fileStrerror(errNum).c_str())); + } + else { A2_LOG_INFO(fmt("Unmapping file %s succeeded", filename_.c_str())); } mapaddr_ = nullptr; maplen_ = 0; } #endif // HAVE_MMAP || defined __MINGW32__ - if(fd_ != A2_BAD_FD) { + if (fd_ != A2_BAD_FD) { #ifdef __MINGW32__ CloseHandle(fd_); -#else // !__MINGW32__ +#else // !__MINGW32__ close(fd_); #endif // !__MINGW32__ fd_ = A2_BAD_FD; @@ -180,29 +176,32 @@ HANDLE openFileWithFlags(const std::string& filename, int flags, DWORD sharedMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; DWORD creationDisp = 0; - if(flags & O_RDWR) { + if (flags & O_RDWR) { desiredAccess = GENERIC_READ | GENERIC_WRITE; - } else if(flags & O_WRONLY) { + } + else if (flags & O_WRONLY) { desiredAccess = GENERIC_WRITE; - } else { + } + else { desiredAccess = GENERIC_READ; } - if(flags & O_CREAT) { - if(flags & O_TRUNC) { + if (flags & O_CREAT) { + if (flags & O_TRUNC) { creationDisp |= CREATE_ALWAYS; - } else { + } + else { creationDisp |= CREATE_NEW; } - } else { + } + else { creationDisp |= OPEN_EXISTING; } hn = CreateFileW(utf8ToWChar(filename).c_str(), desiredAccess, sharedMode, /* lpSecurityAttributes */ 0, creationDisp, FILE_ATTRIBUTE_NORMAL, /* hTemplateFile */ 0); - if(hn == INVALID_HANDLE_VALUE) { + if (hn == INVALID_HANDLE_VALUE) { int errNum = GetLastError(); - throw DL_ABORT_EX3(errNum, fmt(EX_FILE_OPEN, - filename.c_str(), + throw DL_ABORT_EX3(errNum, fmt(EX_FILE_OPEN, filename.c_str(), fileStrerror(errNum).c_str()), errCode); } @@ -213,14 +212,16 @@ int openFileWithFlags(const std::string& filename, int flags, error_code::Value errCode) { int fd; - while((fd = a2open(utf8ToWChar(filename).c_str(), flags, OPEN_MODE)) == -1 - && errno == EINTR); - if(fd < 0) { + while ((fd = a2open(utf8ToWChar(filename).c_str(), flags, OPEN_MODE)) == -1 && + errno == EINTR) + ; + if (fd < 0) { int errNum = errno; throw DL_ABORT_EX3(errNum, fmt(EX_FILE_OPEN, filename.c_str(), util::safeStrerror(errNum).c_str()), errCode); } + util::make_fd_cloexec(fd); #if defined(__APPLE__) && defined(__MACH__) // This may reduce memory consumption on Mac OS X. fcntl(fd, F_NOCACHE, 1); @@ -233,9 +234,10 @@ int openFileWithFlags(const std::string& filename, int flags, void AbstractDiskWriter::openExistingFile(int64_t totalLength) { int flags = O_BINARY; - if(readOnly_) { + if (readOnly_) { flags |= O_RDONLY; - } else { + } + else { flags |= O_RDWR; } fd_ = openFileWithFlags(filename_, flags, error_code::FILE_OPEN_ERROR); @@ -245,32 +247,38 @@ void AbstractDiskWriter::createFile(int addFlags) { assert(!filename_.empty()); util::mkdirs(File(filename_).getDirname()); - fd_ = openFileWithFlags(filename_, O_CREAT|O_RDWR|O_TRUNC|O_BINARY|addFlags, + fd_ = openFileWithFlags(filename_, + O_CREAT | O_RDWR | O_TRUNC | O_BINARY | addFlags, error_code::FILE_CREATE_ERROR); } ssize_t AbstractDiskWriter::writeDataInternal(const unsigned char* data, size_t len, int64_t offset) { - if(mapaddr_) { + if (mapaddr_) { memcpy(mapaddr_ + offset, data, len); return len; - } else { + } + else { ssize_t writtenLength = 0; seek(offset); - while((size_t)writtenLength < len) { + while ((size_t)writtenLength < len) { #ifdef __MINGW32__ DWORD nwrite; - if(WriteFile(fd_, data+writtenLength, len-writtenLength, &nwrite, 0)) { + if (WriteFile(fd_, data + writtenLength, len - writtenLength, &nwrite, + 0)) { writtenLength += nwrite; - } else { + } + else { return -1; } -#else // !__MINGW32__ +#else // !__MINGW32__ ssize_t ret = 0; - while((ret = write(fd_, data+writtenLength, len-writtenLength)) == -1 && - errno == EINTR); - if(ret == -1) { + while ((ret = write(fd_, data + writtenLength, len - writtenLength)) == + -1 && + errno == EINTR) + ; + if (ret == -1) { return -1; } writtenLength += ret; @@ -283,27 +291,28 @@ ssize_t AbstractDiskWriter::writeDataInternal(const unsigned char* data, ssize_t AbstractDiskWriter::readDataInternal(unsigned char* data, size_t len, int64_t offset) { - if(mapaddr_) { - ssize_t readlen; - if(offset > maplen_) { - readlen = 0; - } else { - readlen = std::min(static_cast(maplen_ - offset), len); + if (mapaddr_) { + if (offset >= maplen_) { + return 0; } + auto readlen = std::min(maplen_ - offset, static_cast(len)); memcpy(data, mapaddr_ + offset, readlen); return readlen; - } else { + } + else { seek(offset); #ifdef __MINGW32__ DWORD nread; - if(ReadFile(fd_, data, len, &nread, 0)) { + if (ReadFile(fd_, data, len, &nread, 0)) { return nread; - } else { + } + else { return -1; } -#else // !__MINGW32__ +#else // !__MINGW32__ ssize_t ret = 0; - while((ret = read(fd_, data, len)) == -1 && errno == EINTR); + while ((ret = read(fd_, data, len)) == -1 && errno == EINTR) + ; return ret; #endif // !__MINGW32__ } @@ -315,78 +324,87 @@ void AbstractDiskWriter::seek(int64_t offset) #ifdef __MINGW32__ LARGE_INTEGER fileLength; fileLength.QuadPart = offset; - if(SetFilePointerEx(fd_, fileLength, 0, FILE_BEGIN) == 0) -#else // !__MINGW32__ - if(a2lseek(fd_, offset, SEEK_SET) == (a2_off_t)-1) + if (SetFilePointerEx(fd_, fileLength, 0, FILE_BEGIN) == 0) +#else // !__MINGW32__ + if (a2lseek(fd_, offset, SEEK_SET) == (a2_off_t)-1) #endif // !__MINGW32__ - { - int errNum = fileError(); - throw DL_ABORT_EX2(fmt(EX_FILE_SEEK, filename_.c_str(), - fileStrerror(errNum).c_str()), - error_code::FILE_IO_ERROR); - } + { + int errNum = fileError(); + throw DL_ABORT_EX2( + fmt(EX_FILE_SEEK, filename_.c_str(), fileStrerror(errNum).c_str()), + error_code::FILE_IO_ERROR); + } } void AbstractDiskWriter::ensureMmapWrite(size_t len, int64_t offset) { #if defined(HAVE_MMAP) || defined(__MINGW32__) - if(enableMmap_) { - if(mapaddr_) { - if(static_cast(len + offset) > maplen_) { + if (enableMmap_) { + if (mapaddr_) { + if (static_cast(len + offset) > maplen_) { int errNum = 0; #ifdef __MINGW32__ - if(!UnmapViewOfFile(mapaddr_)) { + if (!UnmapViewOfFile(mapaddr_)) { errNum = GetLastError(); } CloseHandle(mapView_); mapView_ = INVALID_HANDLE_VALUE; -#else // !__MINGW32__ - if(munmap(mapaddr_, maplen_) == -1) { +#else // !__MINGW32__ + if (munmap(mapaddr_, maplen_) == -1) { errNum = errno; } #endif // !__MINGW32__ - if(errNum != 0) { - A2_LOG_ERROR(fmt("Unmapping file %s failed: %s", - filename_.c_str(), fileStrerror(errNum).c_str())); + if (errNum != 0) { + A2_LOG_ERROR(fmt("Unmapping file %s failed: %s", filename_.c_str(), + fileStrerror(errNum).c_str())); } mapaddr_ = nullptr; maplen_ = 0; enableMmap_ = false; } - } else { + } + else { int64_t filesize = size(); + + if (filesize == 0) { + // mapping 0 length file is useless. Also munmap with size == + // 0 will fail with EINVAL. + enableMmap_ = false; + return; + } + int errNum = 0; - if(static_cast(len + offset) <= filesize) { + if (static_cast(len + offset) <= filesize) { #ifdef __MINGW32__ - mapView_ = CreateFileMapping(fd_, 0, PAGE_READWRITE, - filesize >> 32, filesize & 0xffffffffu, - 0); - if(mapView_) { - mapaddr_ = reinterpret_cast - (MapViewOfFile(mapView_, FILE_MAP_WRITE, 0, 0, 0)); - if(!mapaddr_) { + mapView_ = CreateFileMapping(fd_, 0, PAGE_READWRITE, filesize >> 32, + filesize & 0xffffffffu, 0); + if (mapView_) { + mapaddr_ = reinterpret_cast( + MapViewOfFile(mapView_, FILE_MAP_WRITE, 0, 0, 0)); + if (!mapaddr_) { errNum = GetLastError(); CloseHandle(mapView_); mapView_ = INVALID_HANDLE_VALUE; } - } else { + } + else { errNum = GetLastError(); } -#else // !__MINGW32__ - mapaddr_ = reinterpret_cast - (mmap(nullptr, size(), PROT_READ | PROT_WRITE, MAP_SHARED, fd_, 0)); - if(!mapaddr_) { +#else // !__MINGW32__ + mapaddr_ = reinterpret_cast(mmap( + nullptr, filesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd_, 0)); + if (!mapaddr_) { errNum = errno; } #endif // !__MINGW32__ - if(mapaddr_) { + if (mapaddr_) { A2_LOG_DEBUG(fmt("Mapping file %s succeeded, length=%" PRId64 "", - filename_.c_str(), - static_cast(filesize))); + filename_.c_str(), static_cast(filesize))); maplen_ = filesize; - } else { - A2_LOG_WARN(fmt("Mapping file %s failed: %s", - filename_.c_str(), fileStrerror(errNum).c_str())); + } + else { + A2_LOG_WARN(fmt("Mapping file %s failed: %s", filename_.c_str(), + fileStrerror(errNum).c_str())); enableMmap_ = false; } } @@ -395,158 +413,151 @@ void AbstractDiskWriter::ensureMmapWrite(size_t len, int64_t offset) #endif // HAVE_MMAP || __MINGW32__ } -void AbstractDiskWriter::writeData(const unsigned char* data, size_t len, int64_t offset) +void AbstractDiskWriter::writeData(const unsigned char* data, size_t len, + int64_t offset) { ensureMmapWrite(len, offset); - if(writeDataInternal(data, len, offset) < 0) { + if (writeDataInternal(data, len, offset) < 0) { int errNum = fileError(); - if( - // If the error indicates disk full situation, throw - // DownloadFailureException and abort download instantly. + if ( +// If the error indicates disk full situation, throw +// DownloadFailureException and abort download instantly. #ifdef __MINGW32__ - errNum == ERROR_DISK_FULL || errNum == ERROR_HANDLE_DISK_FULL -#else // !__MINGW32__ - errNum == ENOSPC + errNum == ERROR_DISK_FULL || errNum == ERROR_HANDLE_DISK_FULL +#else // !__MINGW32__ + errNum == ENOSPC #endif // !__MINGW32__ - ) { - throw DOWNLOAD_FAILURE_EXCEPTION3 - (errNum, fmt(EX_FILE_WRITE, filename_.c_str(), - fileStrerror(errNum).c_str()), - error_code::NOT_ENOUGH_DISK_SPACE); - } else { - throw DL_ABORT_EX3 - (errNum, fmt(EX_FILE_WRITE, filename_.c_str(), - fileStrerror(errNum).c_str()), - error_code::FILE_IO_ERROR); + ) { + throw DOWNLOAD_FAILURE_EXCEPTION3( + errNum, + fmt(EX_FILE_WRITE, filename_.c_str(), fileStrerror(errNum).c_str()), + error_code::NOT_ENOUGH_DISK_SPACE); + } + else { + throw DL_ABORT_EX3(errNum, fmt(EX_FILE_WRITE, filename_.c_str(), + fileStrerror(errNum).c_str()), + error_code::FILE_IO_ERROR); } } } -ssize_t AbstractDiskWriter::readData(unsigned char* data, size_t len, int64_t offset) +ssize_t AbstractDiskWriter::readData(unsigned char* data, size_t len, + int64_t offset) { ssize_t ret; - if((ret = readDataInternal(data, len, offset)) < 0) { + if ((ret = readDataInternal(data, len, offset)) < 0) { int errNum = fileError(); - throw DL_ABORT_EX3 - (errNum, fmt(EX_FILE_READ, filename_.c_str(), - fileStrerror(errNum).c_str()), - error_code::FILE_IO_ERROR); + throw DL_ABORT_EX3(errNum, fmt(EX_FILE_READ, filename_.c_str(), + fileStrerror(errNum).c_str()), + error_code::FILE_IO_ERROR); } return ret; } void AbstractDiskWriter::truncate(int64_t length) { - if(fd_ == A2_BAD_FD) { + if (fd_ == A2_BAD_FD) { throw DL_ABORT_EX("File not yet opened."); } #ifdef __MINGW32__ // Since mingw32's ftruncate cannot handle over 2GB files, we use // SetEndOfFile instead. seek(length); - if(SetEndOfFile(fd_) == 0) -#else // !__MINGW32__ - if(a2ftruncate(fd_, length) == -1) + if (SetEndOfFile(fd_) == 0) +#else // !__MINGW32__ + if (a2ftruncate(fd_, length) == -1) #endif // !__MINGW32__ - { - int errNum = fileError(); - throw DL_ABORT_EX2(fmt("File truncation failed. cause: %s", - fileStrerror(errNum).c_str()), - error_code::FILE_IO_ERROR); - } + { + int errNum = fileError(); + throw DL_ABORT_EX2( + fmt("File truncation failed. cause: %s", fileStrerror(errNum).c_str()), + error_code::FILE_IO_ERROR); + } } void AbstractDiskWriter::allocate(int64_t offset, int64_t length, bool sparse) { - if(fd_ == A2_BAD_FD) { + if (fd_ == A2_BAD_FD) { throw DL_ABORT_EX("File not yet opened."); } - if(sparse) { + if (sparse) { #ifdef __MINGW32__ DWORD bytesReturned; - if(!DeviceIoControl(fd_, FSCTL_SET_SPARSE, 0, 0, 0, 0, - &bytesReturned, 0)) { + if (!DeviceIoControl(fd_, FSCTL_SET_SPARSE, 0, 0, 0, 0, &bytesReturned, + 0)) { A2_LOG_WARN(fmt("Making file sparse failed or pending: %s", fileStrerror(GetLastError()).c_str())); } #endif // __MINGW32__ - truncate(offset+length); + truncate(offset + length); return; } -#ifdef HAVE_SOME_FALLOCATE -# ifdef __MINGW32__ - truncate(offset+length); -# elif defined(__APPLE__) && defined(__MACH__) +#ifdef HAVE_SOME_FALLOCATE +#ifdef __MINGW32__ + truncate(offset + length); + if (!SetFileValidData(fd_, offset + length)) { + auto errNum = fileError(); + A2_LOG_WARN(fmt( + "File allocation (SetFileValidData) failed (cause: %s). File will be " + "allocated by filling zero, which blocks whole aria2 execution. Run " + "aria2 as an administrator or use a different file allocation method " + "(see --file-allocation).", + fileStrerror(errNum).c_str())); + } +#elif defined(__APPLE__) && defined(__MACH__) auto toalloc = offset + length - size(); while (toalloc > 0) { fstore_t fstore = { - F_ALLOCATECONTIG | F_ALLOCATEALL, - F_PEOFPOSMODE, - 0, - // Allocate in 1GB chunks or else some OSX versions may choke. - std::min(toalloc, (int64_t)1<<30), - 0 - }; + F_ALLOCATECONTIG | F_ALLOCATEALL, F_PEOFPOSMODE, 0, + // Allocate in 1GB chunks or else some OSX versions may choke. + std::min(toalloc, (int64_t)1 << 30), 0}; if (fcntl(fd_, F_PREALLOCATE, &fstore) == -1) { // Retry non-contig. fstore.fst_flags = F_ALLOCATEALL; if (fcntl(fd_, F_PREALLOCATE, &fstore) == -1) { int err = errno; - throw DL_ABORT_EX3(err, - fmt("fcntl(F_PREALLOCATE) of %" PRId64 " failed. cause: %s", - fstore.fst_length, util::safeStrerror(err).c_str()), - error_code::FILE_IO_ERROR); + throw DL_ABORT_EX3( + err, fmt("fcntl(F_PREALLOCATE) of %" PRId64 " failed. cause: %s", + fstore.fst_length, util::safeStrerror(err).c_str()), + error_code::FILE_IO_ERROR); } } toalloc -= fstore.fst_bytesalloc; } // This forces the allocation on disk. ftruncate(fd_, offset + length); -# elif HAVE_FALLOCATE +#elif HAVE_FALLOCATE // For linux, we use fallocate to detect file system supports // fallocate or not. int r; - while((r = fallocate(fd_, 0, offset, length)) == -1 && errno == EINTR); + while ((r = fallocate(fd_, 0, offset, length)) == -1 && errno == EINTR) + ; int errNum = errno; - if(r == -1) { - throw DL_ABORT_EX3(errNum, - fmt("fallocate failed. cause: %s", - util::safeStrerror(errNum).c_str()), + if (r == -1) { + throw DL_ABORT_EX3(errNum, fmt("fallocate failed. cause: %s", + util::safeStrerror(errNum).c_str()), error_code::FILE_IO_ERROR); } -# elif HAVE_POSIX_FALLOCATE +#elif HAVE_POSIX_FALLOCATE int r = posix_fallocate(fd_, offset, length); - if(r != 0) { - throw DL_ABORT_EX3(r, - fmt("posix_fallocate failed. cause: %s", - util::safeStrerror(r).c_str()), + if (r != 0) { + throw DL_ABORT_EX3(r, fmt("posix_fallocate failed. cause: %s", + util::safeStrerror(r).c_str()), error_code::FILE_IO_ERROR); } -# else -# error "no *_fallocate function available." -# endif +#else +#error "no *_fallocate function available." +#endif #endif // HAVE_SOME_FALLOCATE } -int64_t AbstractDiskWriter::size() -{ - return File(filename_).size(); -} +int64_t AbstractDiskWriter::size() { return File(filename_).size(); } -void AbstractDiskWriter::enableReadOnly() -{ - readOnly_ = true; -} +void AbstractDiskWriter::enableReadOnly() { readOnly_ = true; } -void AbstractDiskWriter::disableReadOnly() -{ - readOnly_ = false; -} +void AbstractDiskWriter::disableReadOnly() { readOnly_ = false; } -void AbstractDiskWriter::enableMmap() -{ - enableMmap_ = true; -} +void AbstractDiskWriter::enableMmap() { enableMmap_ = true; } void AbstractDiskWriter::dropCache(int64_t len, int64_t offset) { diff --git a/src/AbstractDiskWriter.h b/src/AbstractDiskWriter.h index f469ab4f..9e5c4799 100644 --- a/src/AbstractDiskWriter.h +++ b/src/AbstractDiskWriter.h @@ -48,7 +48,7 @@ private: HANDLE fd_; // The handle for memory mapped file. mmap equivalent in Windows. HANDLE mapView_; -#else // !__MINGW32__ +#else // !__MINGW32__ int fd_; #endif // !__MINGW32__ @@ -65,8 +65,10 @@ private: void seek(int64_t offset); void ensureMmapWrite(size_t len, int64_t offset); + protected: void createFile(int addFlags = 0); + public: AbstractDiskWriter(const std::string& filename); virtual ~AbstractDiskWriter(); @@ -77,17 +79,17 @@ public: virtual void openExistingFile(int64_t totalLength = 0) CXX11_OVERRIDE; - virtual void writeData(const unsigned char* data, size_t len, int64_t offset) - CXX11_OVERRIDE; + virtual void writeData(const unsigned char* data, size_t len, + int64_t offset) CXX11_OVERRIDE; - virtual ssize_t readData(unsigned char* data, size_t len, int64_t offset) - CXX11_OVERRIDE; + virtual ssize_t readData(unsigned char* data, size_t len, + int64_t offset) CXX11_OVERRIDE; virtual void truncate(int64_t length) CXX11_OVERRIDE; // File must be opened before calling this function. - virtual void allocate(int64_t offset, int64_t length, bool sparse) - CXX11_OVERRIDE; + virtual void allocate(int64_t offset, int64_t length, + bool sparse) CXX11_OVERRIDE; virtual int64_t size() CXX11_OVERRIDE; diff --git a/src/AbstractHttpServerResponseCommand.cc b/src/AbstractHttpServerResponseCommand.cc index 057e74fa..80923ae9 100644 --- a/src/AbstractHttpServerResponseCommand.cc +++ b/src/AbstractHttpServerResponseCommand.cc @@ -47,17 +47,15 @@ namespace aria2 { -AbstractHttpServerResponseCommand::AbstractHttpServerResponseCommand -(cuid_t cuid, - const std::shared_ptr& httpServer, - DownloadEngine* e, - const std::shared_ptr& socket) - : Command(cuid), - e_(e), - socket_(socket), - httpServer_(httpServer), - readCheck_(false), - writeCheck_(true) +AbstractHttpServerResponseCommand::AbstractHttpServerResponseCommand( + cuid_t cuid, const std::shared_ptr& httpServer, + DownloadEngine* e, const std::shared_ptr& socket) + : Command(cuid), + e_(e), + socket_(socket), + httpServer_(httpServer), + readCheck_(false), + writeCheck_(true) { setStatus(Command::STATUS_ONESHOT_REALTIME); e_->addSocketForWriteCheck(socket_, this); @@ -65,31 +63,33 @@ AbstractHttpServerResponseCommand::AbstractHttpServerResponseCommand AbstractHttpServerResponseCommand::~AbstractHttpServerResponseCommand() { - if(readCheck_) { + if (readCheck_) { e_->deleteSocketForReadCheck(socket_, this); } - if(writeCheck_) { + if (writeCheck_) { e_->deleteSocketForWriteCheck(socket_, this); } } void AbstractHttpServerResponseCommand::updateReadWriteCheck() { - if(httpServer_->wantRead()) { - if(!readCheck_) { + if (httpServer_->wantRead()) { + if (!readCheck_) { readCheck_ = true; e_->addSocketForReadCheck(socket_, this); } - } else if(readCheck_) { + } + else if (readCheck_) { readCheck_ = false; e_->deleteSocketForReadCheck(socket_, this); } - if(httpServer_->wantWrite()) { - if(!writeCheck_) { + if (httpServer_->wantWrite()) { + if (!writeCheck_) { writeCheck_ = true; e_->addSocketForWriteCheck(socket_, this); } - } else if(writeCheck_) { + } + else if (writeCheck_) { writeCheck_ = false; e_->deleteSocketForWriteCheck(socket_, this); } @@ -97,34 +97,36 @@ void AbstractHttpServerResponseCommand::updateReadWriteCheck() bool AbstractHttpServerResponseCommand::execute() { - if(e_->getRequestGroupMan()->downloadFinished() || e_->isHaltRequested()) { + if (e_->getRequestGroupMan()->downloadFinished() || e_->isHaltRequested()) { return true; } try { ssize_t len = httpServer_->sendResponse(); - if(len > 0) { + if (len > 0) { timeoutTimer_ = global::wallclock(); } - } catch(RecoverableException& e) { - A2_LOG_INFO_EX - (fmt("CUID#%" PRId64 - " - Error occurred while transmitting response body.", - getCuid()), - e); + } + catch (RecoverableException& e) { + A2_LOG_INFO_EX(fmt("CUID#%" PRId64 + " - Error occurred while transmitting response body.", + getCuid()), + e); return true; } - if(httpServer_->sendBufferIsEmpty()) { + if (httpServer_->sendBufferIsEmpty()) { A2_LOG_INFO(fmt("CUID#%" PRId64 " - HttpServer: all response transmitted.", getCuid())); afterSend(httpServer_, e_); return true; - } else { + } + else { if (timeoutTimer_.difference(global::wallclock()) >= 30_s) { A2_LOG_INFO(fmt("CUID#%" PRId64 " - HttpServer: Timeout while trasmitting response.", getCuid())); return true; - } else { + } + else { updateReadWriteCheck(); e_->addCommand(std::unique_ptr(this)); return false; diff --git a/src/AbstractHttpServerResponseCommand.h b/src/AbstractHttpServerResponseCommand.h index 431351b8..9d07d771 100644 --- a/src/AbstractHttpServerResponseCommand.h +++ b/src/AbstractHttpServerResponseCommand.h @@ -57,19 +57,17 @@ private: bool writeCheck_; void updateReadWriteCheck(); + protected: - DownloadEngine* getDownloadEngine() - { - return e_; - } + DownloadEngine* getDownloadEngine() { return e_; } // Called after content body is completely sent. virtual void afterSend(const std::shared_ptr& httpServer, DownloadEngine* e) = 0; + public: - AbstractHttpServerResponseCommand(cuid_t cuid, - const std::shared_ptr& httpServer, - DownloadEngine* e, - const std::shared_ptr& socket); + AbstractHttpServerResponseCommand( + cuid_t cuid, const std::shared_ptr& httpServer, + DownloadEngine* e, const std::shared_ptr& socket); virtual ~AbstractHttpServerResponseCommand(); diff --git a/src/AbstractOptionHandler.cc b/src/AbstractOptionHandler.cc index c888d504..51fdf4ff 100644 --- a/src/AbstractOptionHandler.cc +++ b/src/AbstractOptionHandler.cc @@ -44,20 +44,19 @@ namespace aria2 { -AbstractOptionHandler::AbstractOptionHandler -(PrefPtr pref, - const char* description, - const std::string& defaultValue, - ARG_TYPE argType, - char shortName) - : pref_(pref), - description_(description), - defaultValue_(defaultValue), - argType_(argType), - shortName_(shortName), - tags_(0), - flags_(0) -{} +AbstractOptionHandler::AbstractOptionHandler(PrefPtr pref, + const char* description, + const std::string& defaultValue, + ARG_TYPE argType, char shortName) + : pref_(pref), + description_(description), + defaultValue_(defaultValue), + argType_(argType), + shortName_(shortName), + tags_(0), + flags_(0) +{ +} AbstractOptionHandler::~AbstractOptionHandler() {} @@ -65,7 +64,8 @@ void AbstractOptionHandler::parse(Option& option, const std::string& arg) const { try { parseArg(option, arg); - } catch(Exception& e) { + } + catch (Exception& e) { throw OPTION_HANDLER_EXCEPTION2(pref_, e); } } @@ -75,49 +75,38 @@ bool AbstractOptionHandler::hasTag(uint32_t tag) const return (tags_ & (1 << tag)); } -void AbstractOptionHandler::addTag(uint32_t tag) -{ - tags_ |= (1 << tag); -} +void AbstractOptionHandler::addTag(uint32_t tag) { tags_ |= (1 << tag); } std::string AbstractOptionHandler::toTagString() const { std::string s; - for(int i = 0; i < MAX_HELP_TAG; ++i) { - if(tags_ & (1 << i)) { + for (int i = 0; i < MAX_HELP_TAG; ++i) { + if (tags_ & (1 << i)) { s += strHelpTag(i); s += ", "; } } - if(!s.empty()) { + if (!s.empty()) { s.resize(s.size() - 2); } return s; } -const char* AbstractOptionHandler::getName() const -{ - return pref_->k; -} +const char* AbstractOptionHandler::getName() const { return pref_->k; } void AbstractOptionHandler::updateFlags(int flag, bool val) { - if(val) { + if (val) { flags_ |= flag; - } else { + } + else { flags_ &= ~flag; } } -bool AbstractOptionHandler::isHidden() const -{ - return flags_ & FLAG_HIDDEN; -} +bool AbstractOptionHandler::isHidden() const { return flags_ & FLAG_HIDDEN; } -void AbstractOptionHandler::hide() -{ - updateFlags(FLAG_HIDDEN, true); -} +void AbstractOptionHandler::hide() { updateFlags(FLAG_HIDDEN, true); } bool AbstractOptionHandler::getEraseAfterParse() const { diff --git a/src/AbstractOptionHandler.h b/src/AbstractOptionHandler.h index f59518db..20e91dd4 100644 --- a/src/AbstractOptionHandler.h +++ b/src/AbstractOptionHandler.h @@ -55,17 +55,16 @@ protected: char shortName_; virtual void parseArg(Option& option, const std::string& arg) const = 0; + public: - AbstractOptionHandler(PrefPtr pref, - const char* description = NO_DESCRIPTION, - const std::string& defaultValue = NO_DEFAULT_VALUE, - ARG_TYPE argType = REQ_ARG, - char shortName = 0); + AbstractOptionHandler(PrefPtr pref, const char* description = NO_DESCRIPTION, + const std::string& defaultValue = NO_DEFAULT_VALUE, + ARG_TYPE argType = REQ_ARG, char shortName = 0); virtual ~AbstractOptionHandler(); - virtual void parse(Option& option, const std::string& arg) const - CXX11_OVERRIDE; + virtual void parse(Option& option, + const std::string& arg) const CXX11_OVERRIDE; virtual bool hasTag(uint32_t tag) const CXX11_OVERRIDE; @@ -85,15 +84,9 @@ public: return defaultValue_; } - virtual PrefPtr getPref() const CXX11_OVERRIDE - { - return pref_; - } + virtual PrefPtr getPref() const CXX11_OVERRIDE { return pref_; } - virtual char getShortName() const CXX11_OVERRIDE - { - return shortName_; - } + virtual char getShortName() const CXX11_OVERRIDE { return shortName_; } virtual OptionHandler::ARG_TYPE getArgType() const CXX11_OVERRIDE { @@ -137,6 +130,7 @@ public: FLAG_CHANGE_GLOBAL_OPTION = 1 << 5, FLAG_CUMULATIVE = 1 << 6 }; + private: // bitwise OR of (1 << HelpTag value) defined in help_tags.h. uint32_t tags_; diff --git a/src/AbstractProxyRequestCommand.cc b/src/AbstractProxyRequestCommand.cc index 3dd01adf..74d23142 100644 --- a/src/AbstractProxyRequestCommand.cc +++ b/src/AbstractProxyRequestCommand.cc @@ -49,20 +49,15 @@ namespace aria2 { -AbstractProxyRequestCommand::AbstractProxyRequestCommand -(cuid_t cuid, - const std::shared_ptr& req, - const std::shared_ptr& fileEntry, - RequestGroup* requestGroup, - DownloadEngine* e, - const std::shared_ptr& proxyRequest, - const std::shared_ptr& s) - : - AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), - proxyRequest_(proxyRequest), - httpConnection_ - (std::make_shared - (cuid, s, std::make_shared(s))) +AbstractProxyRequestCommand::AbstractProxyRequestCommand( + cuid_t cuid, const std::shared_ptr& req, + const std::shared_ptr& fileEntry, RequestGroup* requestGroup, + DownloadEngine* e, const std::shared_ptr& proxyRequest, + const std::shared_ptr& s) + : AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), + proxyRequest_(proxyRequest), + httpConnection_(std::make_shared( + cuid, s, std::make_shared(s))) { setTimeout(std::chrono::seconds(getOption()->getAsInt(PREF_CONNECT_TIMEOUT))); disableReadCheckSocket(); @@ -71,22 +66,25 @@ AbstractProxyRequestCommand::AbstractProxyRequestCommand AbstractProxyRequestCommand::~AbstractProxyRequestCommand() {} -bool AbstractProxyRequestCommand::executeInternal() { - //socket->setBlockingMode(); - if(httpConnection_->sendBufferIsEmpty()) { +bool AbstractProxyRequestCommand::executeInternal() +{ + // socket->setBlockingMode(); + if (httpConnection_->sendBufferIsEmpty()) { auto httpRequest = make_unique(); httpRequest->setUserAgent(getOption()->get(PREF_USER_AGENT)); httpRequest->setRequest(getRequest()); httpRequest->setProxyRequest(proxyRequest_); httpConnection_->sendProxyRequest(std::move(httpRequest)); - } else { + } + else { httpConnection_->sendPendingData(); } - if(httpConnection_->sendBufferIsEmpty()) { + if (httpConnection_->sendBufferIsEmpty()) { getDownloadEngine()->addCommand(getNextCommand()); return true; - } else { + } + else { setWriteCheckSocket(getSocket()); addCommandSelf(); return false; diff --git a/src/AbstractProxyRequestCommand.h b/src/AbstractProxyRequestCommand.h index e394a2a4..07835b31 100644 --- a/src/AbstractProxyRequestCommand.h +++ b/src/AbstractProxyRequestCommand.h @@ -47,6 +47,7 @@ private: std::shared_ptr proxyRequest_; std::shared_ptr httpConnection_; + protected: virtual bool executeInternal() CXX11_OVERRIDE; @@ -59,12 +60,11 @@ protected: { return proxyRequest_; } + public: - AbstractProxyRequestCommand(cuid_t cuid, - const std::shared_ptr& req, + AbstractProxyRequestCommand(cuid_t cuid, const std::shared_ptr& req, const std::shared_ptr& fileEntry, - RequestGroup* requestGroup, - DownloadEngine* e, + RequestGroup* requestGroup, DownloadEngine* e, const std::shared_ptr& proxyRequest, const std::shared_ptr& s); diff --git a/src/AbstractProxyResponseCommand.cc b/src/AbstractProxyResponseCommand.cc index 14461ea7..90a11244 100644 --- a/src/AbstractProxyResponseCommand.cc +++ b/src/AbstractProxyResponseCommand.cc @@ -50,27 +50,28 @@ namespace aria2 { -AbstractProxyResponseCommand::AbstractProxyResponseCommand -(cuid_t cuid, - const std::shared_ptr& req, - const std::shared_ptr& fileEntry, - RequestGroup* requestGroup, - const std::shared_ptr& httpConnection, - DownloadEngine* e, - const std::shared_ptr& s) - :AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), - httpConnection_(httpConnection) {} +AbstractProxyResponseCommand::AbstractProxyResponseCommand( + cuid_t cuid, const std::shared_ptr& req, + const std::shared_ptr& fileEntry, RequestGroup* requestGroup, + const std::shared_ptr& httpConnection, DownloadEngine* e, + const std::shared_ptr& s) + : AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), + httpConnection_(httpConnection) +{ +} AbstractProxyResponseCommand::~AbstractProxyResponseCommand() {} -bool AbstractProxyResponseCommand::executeInternal() { - std::shared_ptr httpResponse = httpConnection_->receiveResponse(); - if(!httpResponse) { +bool AbstractProxyResponseCommand::executeInternal() +{ + std::shared_ptr httpResponse = + httpConnection_->receiveResponse(); + if (!httpResponse) { // the server has not responded our request yet. addCommandSelf(); return false; } - if(httpResponse->getStatusCode() != 200) { + if (httpResponse->getStatusCode() != 200) { throw DL_RETRY_EX(EX_PROXY_CONNECTION_FAILED); } getDownloadEngine()->addCommand(getNextCommand()); diff --git a/src/AbstractProxyResponseCommand.h b/src/AbstractProxyResponseCommand.h index edc19583..8bcdd36d 100644 --- a/src/AbstractProxyResponseCommand.h +++ b/src/AbstractProxyResponseCommand.h @@ -45,6 +45,7 @@ class SocketCore; class AbstractProxyResponseCommand : public AbstractCommand { private: std::shared_ptr httpConnection_; + protected: virtual bool executeInternal() CXX11_OVERRIDE; @@ -52,15 +53,13 @@ protected: { return httpConnection_; } + public: - AbstractProxyResponseCommand - (cuid_t cuid, - const std::shared_ptr& req, - const std::shared_ptr& fileEntry, - RequestGroup* requestGroup, - const std::shared_ptr& httpConnection, - DownloadEngine* e, - const std::shared_ptr& s); + AbstractProxyResponseCommand( + cuid_t cuid, const std::shared_ptr& req, + const std::shared_ptr& fileEntry, RequestGroup* requestGroup, + const std::shared_ptr& httpConnection, DownloadEngine* e, + const std::shared_ptr& s); virtual ~AbstractProxyResponseCommand(); diff --git a/src/AbstractSingleDiskAdaptor.cc b/src/AbstractSingleDiskAdaptor.cc index 899168f1..470beb37 100644 --- a/src/AbstractSingleDiskAdaptor.cc +++ b/src/AbstractSingleDiskAdaptor.cc @@ -41,13 +41,15 @@ #include "WrDiskCacheEntry.h" #include "LogFactory.h" #ifdef HAVE_SOME_FALLOCATE -# include "FallocFileAllocationIterator.h" +#include "FallocFileAllocationIterator.h" #endif // HAVE_SOME_FALLOCATE namespace aria2 { -AbstractSingleDiskAdaptor::AbstractSingleDiskAdaptor(): - totalLength_(0), readOnly_(false) {} +AbstractSingleDiskAdaptor::AbstractSingleDiskAdaptor() + : totalLength_(0), readOnly_(false) +{ +} AbstractSingleDiskAdaptor::~AbstractSingleDiskAdaptor() {} @@ -61,34 +63,31 @@ void AbstractSingleDiskAdaptor::openFile() diskWriter_->openFile(totalLength_); } -void AbstractSingleDiskAdaptor::closeFile() -{ - diskWriter_->closeFile(); -} +void AbstractSingleDiskAdaptor::closeFile() { diskWriter_->closeFile(); } void AbstractSingleDiskAdaptor::openExistingFile() { diskWriter_->openExistingFile(totalLength_); } -void AbstractSingleDiskAdaptor::writeData -(const unsigned char* data, size_t len, int64_t offset) +void AbstractSingleDiskAdaptor::writeData(const unsigned char* data, size_t len, + int64_t offset) { diskWriter_->writeData(data, len, offset); } -ssize_t AbstractSingleDiskAdaptor::readData -(unsigned char* data, size_t len, int64_t offset) +ssize_t AbstractSingleDiskAdaptor::readData(unsigned char* data, size_t len, + int64_t offset) { return diskWriter_->readData(data, len, offset); } -ssize_t AbstractSingleDiskAdaptor::readDataDropCache -(unsigned char* data, size_t len, int64_t offset) +ssize_t AbstractSingleDiskAdaptor::readDataDropCache(unsigned char* data, + size_t len, int64_t offset) { auto rv = readData(data, len, offset); - if(rv > 0) { + if (rv > 0) { diskWriter_->dropCache(len, offset); } @@ -106,31 +105,32 @@ void AbstractSingleDiskAdaptor::writeCache(const WrDiskCacheEntry* entry) size_t buflen = 0; size_t buffoffset = 0; const WrDiskCacheEntry::DataCellSet& dataSet = entry->getDataSet(); - for(auto & d : dataSet) { - if(start+static_cast(buflen) < d->goff) { - A2_LOG_DEBUG(fmt("Cache flush goff=%" PRId64 ", len=%lu", - start, static_cast(buflen))); - writeData(buf+buffoffset, buflen-buffoffset, start); + for (auto& d : dataSet) { + if (start + static_cast(buflen) < d->goff) { + A2_LOG_DEBUG(fmt("Cache flush goff=%" PRId64 ", len=%lu", start, + static_cast(buflen))); + writeData(buf + buffoffset, buflen - buffoffset, start); start = d->goff; buflen = buffoffset = 0; } - if(buflen == 0 && (d->goff & 0xfff) == 0 && (d->len & 0xfff) == 0) { + if (buflen == 0 && (d->goff & 0xfff) == 0 && (d->len & 0xfff) == 0) { // Already aligned. Write it without copy. - A2_LOG_DEBUG(fmt("Cache flush goff=%" PRId64 ", len=%lu", - start, static_cast(d->len))); + A2_LOG_DEBUG(fmt("Cache flush goff=%" PRId64 ", len=%lu", start, + static_cast(d->len))); writeData(d->data + d->offset, d->len, start); start += d->len; - } else { - if(buflen == 0) { + } + else { + if (buflen == 0) { buflen = buffoffset = d->goff & 0xfff; } size_t wlen = std::min(sizeof(buf) - buflen, d->len); - memcpy(buf+buflen, d->data + d->offset, wlen); + memcpy(buf + buflen, d->data + d->offset, wlen); buflen += wlen; - if(buflen == sizeof(buf)) { - A2_LOG_DEBUG(fmt("Cache flush goff=%" PRId64 ", len=%lu", - start, static_cast(buflen))); - writeData(buf+buffoffset, buflen-buffoffset, start); + if (buflen == sizeof(buf)) { + A2_LOG_DEBUG(fmt("Cache flush goff=%" PRId64 ", len=%lu", start, + static_cast(buflen))); + writeData(buf + buffoffset, buflen - buffoffset, start); memcpy(buf, d->data + d->offset + wlen, d->len - wlen); start += sizeof(buf) - buffoffset; buflen = d->len - wlen; @@ -138,7 +138,7 @@ void AbstractSingleDiskAdaptor::writeCache(const WrDiskCacheEntry* entry) } } } - writeData(buf+buffoffset, buflen-buffoffset, start); + writeData(buf + buffoffset, buflen - buffoffset, start); } bool AbstractSingleDiskAdaptor::fileExists() @@ -146,10 +146,7 @@ bool AbstractSingleDiskAdaptor::fileExists() return File(getFilePath()).exists(); } -int64_t AbstractSingleDiskAdaptor::size() -{ - return File(getFilePath()).size(); -} +int64_t AbstractSingleDiskAdaptor::size() { return File(getFilePath()).size(); } void AbstractSingleDiskAdaptor::truncate(int64_t length) { @@ -159,18 +156,18 @@ void AbstractSingleDiskAdaptor::truncate(int64_t length) std::unique_ptr AbstractSingleDiskAdaptor::fileAllocationIterator() { - switch(getFileAllocationMethod()) { + switch (getFileAllocationMethod()) { #ifdef HAVE_SOME_FALLOCATE - case(DiskAdaptor::FILE_ALLOC_FALLOC): - return make_unique - (diskWriter_.get(), size() ,totalLength_); + case (DiskAdaptor::FILE_ALLOC_FALLOC): + return make_unique(diskWriter_.get(), size(), + totalLength_); #endif // HAVE_SOME_FALLOCATE - case(DiskAdaptor::FILE_ALLOC_TRUNC): - return make_unique - (diskWriter_.get(), size(), totalLength_); + case (DiskAdaptor::FILE_ALLOC_TRUNC): + return make_unique(diskWriter_.get(), size(), + totalLength_); default: - return make_unique - (diskWriter_.get(), size(), totalLength_); + return make_unique(diskWriter_.get(), + size(), totalLength_); } } @@ -186,20 +183,17 @@ void AbstractSingleDiskAdaptor::disableReadOnly() readOnly_ = false; } -void AbstractSingleDiskAdaptor::enableMmap() -{ - diskWriter_->enableMmap(); -} +void AbstractSingleDiskAdaptor::enableMmap() { diskWriter_->enableMmap(); } void AbstractSingleDiskAdaptor::cutTrailingGarbage() { - if(File(getFilePath()).size() > totalLength_) { + if (File(getFilePath()).size() > totalLength_) { diskWriter_->truncate(totalLength_); } } -void AbstractSingleDiskAdaptor::setDiskWriter -(std::unique_ptr diskWriter) +void AbstractSingleDiskAdaptor::setDiskWriter( + std::unique_ptr diskWriter) { diskWriter_ = std::move(diskWriter); } diff --git a/src/AbstractSingleDiskAdaptor.h b/src/AbstractSingleDiskAdaptor.h index ef279df1..8d17686c 100644 --- a/src/AbstractSingleDiskAdaptor.h +++ b/src/AbstractSingleDiskAdaptor.h @@ -47,6 +47,7 @@ private: std::unique_ptr diskWriter_; int64_t totalLength_; bool readOnly_; + public: AbstractSingleDiskAdaptor(); @@ -63,12 +64,11 @@ public: virtual void writeData(const unsigned char* data, size_t len, int64_t offset) CXX11_OVERRIDE; - virtual ssize_t readData(unsigned char* data, size_t len, int64_t offset) - CXX11_OVERRIDE; + virtual ssize_t readData(unsigned char* data, size_t len, + int64_t offset) CXX11_OVERRIDE; virtual ssize_t readDataDropCache(unsigned char* data, size_t len, - int64_t offset) - CXX11_OVERRIDE; + int64_t offset) CXX11_OVERRIDE; virtual void writeCache(const WrDiskCacheEntry* entry) CXX11_OVERRIDE; @@ -78,8 +78,8 @@ public: virtual void truncate(int64_t length) CXX11_OVERRIDE; - virtual std::unique_ptr fileAllocationIterator() - CXX11_OVERRIDE; + virtual std::unique_ptr + fileAllocationIterator() CXX11_OVERRIDE; // Make sure that DiskWriter is set before calling this function. virtual void enableReadOnly() CXX11_OVERRIDE; @@ -104,10 +104,7 @@ public: void setTotalLength(int64_t totalLength); - int64_t getTotalLength() const - { - return totalLength_; - } + int64_t getTotalLength() const { return totalLength_; } }; } // namespace aria2 diff --git a/src/ActivePeerConnectionCommand.cc b/src/ActivePeerConnectionCommand.cc index 1e2b44da..7e566b42 100644 --- a/src/ActivePeerConnectionCommand.cc +++ b/src/ActivePeerConnectionCommand.cc @@ -56,16 +56,14 @@ namespace aria2 { -ActivePeerConnectionCommand::ActivePeerConnectionCommand -(cuid_t cuid, - RequestGroup* requestGroup, - DownloadEngine* e, - std::chrono::seconds interval) - : Command(cuid), - requestGroup_(requestGroup), - interval_(std::move(interval)), - e_(e), - numNewConnection_(5) +ActivePeerConnectionCommand::ActivePeerConnectionCommand( + cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, + std::chrono::seconds interval) + : Command(cuid), + requestGroup_(requestGroup), + interval_(std::move(interval)), + e_(e), + numNewConnection_(5) { requestGroup_->increaseNumCommand(); } @@ -75,50 +73,53 @@ ActivePeerConnectionCommand::~ActivePeerConnectionCommand() requestGroup_->decreaseNumCommand(); } -bool ActivePeerConnectionCommand::execute() { - if(btRuntime_->isHalt()) { +bool ActivePeerConnectionCommand::execute() +{ + if (btRuntime_->isHalt()) { return true; } - if(checkPoint_.difference(global::wallclock()) >= interval_) { + if (checkPoint_.difference(global::wallclock()) >= interval_) { checkPoint_ = global::wallclock(); NetStat& stat = requestGroup_->getDownloadContext()->getNetStat(); const int maxDownloadLimit = requestGroup_->getMaxDownloadSpeedLimit(); const int maxUploadLimit = requestGroup_->getMaxUploadSpeedLimit(); int thresholdSpeed; - if(!bittorrent::getTorrentAttrs - (requestGroup_->getDownloadContext())->metadata.empty()) { - thresholdSpeed = - requestGroup_->getOption()->getAsInt(PREF_BT_REQUEST_PEER_SPEED_LIMIT); - } else { + if (!bittorrent::getTorrentAttrs(requestGroup_->getDownloadContext()) + ->metadata.empty()) { + thresholdSpeed = requestGroup_->getOption()->getAsInt( + PREF_BT_REQUEST_PEER_SPEED_LIMIT); + } + else { thresholdSpeed = 0; } - if(maxDownloadLimit > 0) { + if (maxDownloadLimit > 0) { thresholdSpeed = std::min(maxDownloadLimit, thresholdSpeed); } - if(// for seeder state - (pieceStorage_->downloadFinished() && btRuntime_->lessThanMaxPeers() && - (maxUploadLimit == 0 || - stat.calculateUploadSpeed() < maxUploadLimit*0.8)) || - // for leecher state - (!pieceStorage_->downloadFinished() && - (stat.calculateDownloadSpeed() < thresholdSpeed || - btRuntime_->lessThanMinPeers()))) { + if ( // for seeder state + (pieceStorage_->downloadFinished() && btRuntime_->lessThanMaxPeers() && + (maxUploadLimit == 0 || + stat.calculateUploadSpeed() < maxUploadLimit * 0.8)) || + // for leecher state + (!pieceStorage_->downloadFinished() && + (stat.calculateDownloadSpeed() < thresholdSpeed || + btRuntime_->lessThanMinPeers()))) { int numConnection = 0; - if(pieceStorage_->downloadFinished()) { - if(btRuntime_->getMaxPeers() > btRuntime_->getConnections()) { + if (pieceStorage_->downloadFinished()) { + if (btRuntime_->getMaxPeers() > btRuntime_->getConnections()) { numConnection = - std::min(numNewConnection_, - btRuntime_->getMaxPeers()-btRuntime_->getConnections()); + std::min(numNewConnection_, btRuntime_->getMaxPeers() - + btRuntime_->getConnections()); } - } else { + } + else { numConnection = numNewConnection_; } makeNewConnections(numConnection); - if(btRuntime_->getConnections() == 0 && - !pieceStorage_->downloadFinished()) { + if (btRuntime_->getConnections() == 0 && + !pieceStorage_->downloadFinished()) { btAnnounce_->overrideMinInterval(BtAnnounce::DEFAULT_ANNOUNCE_INTERVAL); } } @@ -129,43 +130,43 @@ bool ActivePeerConnectionCommand::execute() { void ActivePeerConnectionCommand::makeNewConnections(int num) { - for(; num && peerStorage_->isPeerAvailable(); --num) { + for (; num && peerStorage_->isPeerAvailable(); --num) { cuid_t ncuid = e_->newCUID(); std::shared_ptr peer = peerStorage_->checkoutPeer(ncuid); // sanity check - if(!peer) { + if (!peer) { break; } - auto command = make_unique - (ncuid, requestGroup_, peer, e_, btRuntime_); + auto command = make_unique( + ncuid, requestGroup_, peer, e_, btRuntime_); command->setPeerStorage(peerStorage_); command->setPieceStorage(pieceStorage_); e_->addCommand(std::move(command)); - A2_LOG_INFO(fmt(MSG_CONNECTING_TO_PEER, getCuid(), - peer->getIPAddress().c_str())); + A2_LOG_INFO( + fmt(MSG_CONNECTING_TO_PEER, getCuid(), peer->getIPAddress().c_str())); } } -void ActivePeerConnectionCommand::setBtRuntime -(const std::shared_ptr& btRuntime) +void ActivePeerConnectionCommand::setBtRuntime( + const std::shared_ptr& btRuntime) { btRuntime_ = btRuntime; } -void ActivePeerConnectionCommand::setPieceStorage -(const std::shared_ptr& pieceStorage) +void ActivePeerConnectionCommand::setPieceStorage( + const std::shared_ptr& pieceStorage) { pieceStorage_ = pieceStorage; } -void ActivePeerConnectionCommand::setPeerStorage -(const std::shared_ptr& peerStorage) +void ActivePeerConnectionCommand::setPeerStorage( + const std::shared_ptr& peerStorage) { peerStorage_ = peerStorage; } -void ActivePeerConnectionCommand::setBtAnnounce -(const std::shared_ptr& btAnnounce) +void ActivePeerConnectionCommand::setBtAnnounce( + const std::shared_ptr& btAnnounce) { btAnnounce_ = btAnnounce; } diff --git a/src/ActivePeerConnectionCommand.h b/src/ActivePeerConnectionCommand.h index fc6203f8..d92dc260 100644 --- a/src/ActivePeerConnectionCommand.h +++ b/src/ActivePeerConnectionCommand.h @@ -64,10 +64,8 @@ private: Timer checkPoint_; int numNewConnection_; // the number of the connection to establish. public: - ActivePeerConnectionCommand(cuid_t cuid, - RequestGroup* requestGroup, - DownloadEngine* e, - std::chrono::seconds interval); + ActivePeerConnectionCommand(cuid_t cuid, RequestGroup* requestGroup, + DownloadEngine* e, std::chrono::seconds interval); virtual ~ActivePeerConnectionCommand(); diff --git a/src/AdaptiveFileAllocationIterator.cc b/src/AdaptiveFileAllocationIterator.cc index f86517a8..05093b68 100644 --- a/src/AdaptiveFileAllocationIterator.cc +++ b/src/AdaptiveFileAllocationIterator.cc @@ -40,68 +40,71 @@ #include "Logger.h" #include "a2functional.h" #ifdef HAVE_FALLOCATE -# include "FallocFileAllocationIterator.h" +#include "FallocFileAllocationIterator.h" #endif // HAVE_FALLOCATE namespace aria2 { -AdaptiveFileAllocationIterator::AdaptiveFileAllocationIterator -(BinaryStream* stream, int64_t offset, int64_t totalLength) - : stream_(stream), - offset_(offset), - totalLength_(totalLength) -{} +AdaptiveFileAllocationIterator::AdaptiveFileAllocationIterator( + BinaryStream* stream, int64_t offset, int64_t totalLength) + : stream_(stream), offset_(offset), totalLength_(totalLength) +{ +} AdaptiveFileAllocationIterator::~AdaptiveFileAllocationIterator() {} void AdaptiveFileAllocationIterator::allocateChunk() { - if(!allocator_) { + if (!allocator_) { #ifdef HAVE_FALLOCATE try { A2_LOG_DEBUG("Testing file system supports fallocate."); - if(offset_ < totalLength_) { + if (offset_ < totalLength_) { int64_t len = std::min(totalLength_ - offset_, static_cast(4_k)); stream_->allocate(offset_, len, false); offset_ += len; } A2_LOG_DEBUG("File system supports fallocate."); - allocator_ = make_unique - (stream_, offset_, totalLength_); - } catch(RecoverableException& e) { + allocator_ = make_unique(stream_, offset_, + totalLength_); + } + catch (RecoverableException& e) { A2_LOG_DEBUG("File system does not support fallocate."); - auto salloc = make_unique - (stream_, offset_, totalLength_); + auto salloc = make_unique(stream_, offset_, + totalLength_); salloc->init(); allocator_ = std::move(salloc); } -#else // !HAVE_FALLOCATE - auto salloc = make_unique - (stream_, offset_, totalLength_); +#else // !HAVE_FALLOCATE + auto salloc = make_unique(stream_, offset_, + totalLength_); salloc->init(); allocator_ = std::move(salloc); #endif // !HAVE_FALLOCATE allocator_->allocateChunk(); - } else { + } + else { allocator_->allocateChunk(); } } bool AdaptiveFileAllocationIterator::finished() { - if(!allocator_) { + if (!allocator_) { return offset_ == totalLength_; - } else { + } + else { return allocator_->finished(); } } int64_t AdaptiveFileAllocationIterator::getCurrentLength() { - if(!allocator_) { + if (!allocator_) { return offset_; - } else { + } + else { return allocator_->getCurrentLength(); } } diff --git a/src/AdaptiveFileAllocationIterator.h b/src/AdaptiveFileAllocationIterator.h index 6d0c804d..cbeee594 100644 --- a/src/AdaptiveFileAllocationIterator.h +++ b/src/AdaptiveFileAllocationIterator.h @@ -43,8 +43,7 @@ namespace aria2 { class BinaryStream; -class AdaptiveFileAllocationIterator:public FileAllocationIterator -{ +class AdaptiveFileAllocationIterator : public FileAllocationIterator { private: std::unique_ptr allocator_; @@ -53,9 +52,10 @@ private: int64_t offset_; int64_t totalLength_; + public: - AdaptiveFileAllocationIterator - (BinaryStream* stream, int64_t offset, int64_t totalLength); + AdaptiveFileAllocationIterator(BinaryStream* stream, int64_t offset, + int64_t totalLength); virtual ~AdaptiveFileAllocationIterator(); diff --git a/src/AdaptiveURISelector.cc b/src/AdaptiveURISelector.cc index b820b803..4a9f9b6b 100644 --- a/src/AdaptiveURISelector.cc +++ b/src/AdaptiveURISelector.cc @@ -65,22 +65,21 @@ namespace aria2 { * be tested again. Otherwise, it doesn't return anymore mirrors. */ -AdaptiveURISelector::AdaptiveURISelector -(std::shared_ptr serverStatMan, RequestGroup* requestGroup) - : serverStatMan_(std::move(serverStatMan)), - requestGroup_(requestGroup) +AdaptiveURISelector::AdaptiveURISelector( + std::shared_ptr serverStatMan, RequestGroup* requestGroup) + : serverStatMan_(std::move(serverStatMan)), requestGroup_(requestGroup) { resetCounters(); } AdaptiveURISelector::~AdaptiveURISelector() {} -std::string AdaptiveURISelector::select -(FileEntry* fileEntry, - const std::vector >& usedHosts) +std::string AdaptiveURISelector::select( + FileEntry* fileEntry, + const std::vector>& usedHosts) { - A2_LOG_DEBUG(fmt("AdaptiveURISelector: called %d", - requestGroup_->getNumConnection())); + A2_LOG_DEBUG( + fmt("AdaptiveURISelector: called %d", requestGroup_->getNumConnection())); std::deque& uris = fileEntry->getRemainingUris(); if (uris.empty() && requestGroup_->getNumConnection() <= 1) { // here we know the download will fail, trying to find previously @@ -90,7 +89,7 @@ std::string AdaptiveURISelector::select std::string selected = selectOne(uris); - if(selected != A2STR::NIL) { + if (selected != A2STR::NIL) { uris.erase(std::find(std::begin(uris), std::end(uris), selected)); } return selected; @@ -102,8 +101,9 @@ constexpr auto MAX_TIMEOUT = 60_s; void AdaptiveURISelector::mayRetryWithIncreasedTimeout(FileEntry* fileEntry) { - if (requestGroup_->getTimeout()*2 >= MAX_TIMEOUT) return; - requestGroup_->setTimeout(requestGroup_->getTimeout()*2); + if (requestGroup_->getTimeout() * 2 >= MAX_TIMEOUT) + return; + requestGroup_->setTimeout(requestGroup_->getTimeout() * 2); std::deque& uris = fileEntry->getRemainingUris(); // looking for retries @@ -112,7 +112,7 @@ void AdaptiveURISelector::mayRetryWithIncreasedTimeout(FileEntry* fileEntry) std::transform(std::begin(timeouts), std::end(timeouts), std::back_inserter(uris), std::mem_fn(&URIResult::getURI)); - if(A2_LOG_DEBUG_ENABLED) { + if (A2_LOG_DEBUG_ENABLED) { for (const auto& uri : uris) { A2_LOG_DEBUG( fmt("AdaptiveURISelector: will retry server with increased" @@ -126,25 +126,27 @@ void AdaptiveURISelector::mayRetryWithIncreasedTimeout(FileEntry* fileEntry) std::string AdaptiveURISelector::selectOne(const std::deque& uris) { - if(uris.empty()) { + if (uris.empty()) { return A2STR::NIL; - } else { + } + else { const size_t numPieces = - requestGroup_->getDownloadContext()->getNumPieces(); + requestGroup_->getDownloadContext()->getNumPieces(); - bool reservedContext = numPieces > 0 && - static_cast(nbConnections_) > std::min - (numPieces, - static_cast(requestGroup_->getNumConcurrentCommand())); + bool reservedContext = + numPieces > 0 && + static_cast(nbConnections_) > + std::min(numPieces, static_cast( + requestGroup_->getNumConcurrentCommand())); bool selectBest = numPieces == 0 || reservedContext; - if(numPieces > 0) + if (numPieces > 0) ++nbConnections_; /* At least, 3 mirrors must be tested */ - if(getNbTestedServers(uris) < 3) { + if (getNbTestedServers(uris) < 3) { std::string notTested = getFirstNotTestedUri(uris); - if(notTested != A2STR::NIL) { + if (notTested != A2STR::NIL) { A2_LOG_DEBUG(fmt("AdaptiveURISelector: choosing the first non tested" " mirror: %s", notTested.c_str())); @@ -153,24 +155,26 @@ std::string AdaptiveURISelector::selectOne(const std::deque& uris) } } - if(!selectBest && nbConnections_ > 1 && nbServerToEvaluate_ > 0) { + if (!selectBest && nbConnections_ > 1 && nbServerToEvaluate_ > 0) { nbServerToEvaluate_--; std::string notTested = getFirstNotTestedUri(uris); - if(notTested != A2STR::NIL) { + if (notTested != A2STR::NIL) { /* Here we return the first untested mirror */ A2_LOG_DEBUG(fmt("AdaptiveURISelector: choosing non tested mirror %s" " for connection #%d", notTested.c_str(), nbConnections_)); return notTested; - } else { + } + else { /* Here we return a mirror which need to be tested again */ std::string toReTest = getFirstToTestUri(uris); - if(toReTest != A2STR::NIL) { + if (toReTest != A2STR::NIL) { A2_LOG_DEBUG(fmt("AdaptiveURISelector: choosing mirror %s which has" " not been tested recently for connection #%d", toReTest.c_str(), nbConnections_)); return toReTest; - } else { + } + else { return getBestMirror(uris); } } @@ -181,28 +185,26 @@ std::string AdaptiveURISelector::selectOne(const std::deque& uris) } } -std::string AdaptiveURISelector::getBestMirror -(const std::deque& uris) const +std::string +AdaptiveURISelector::getBestMirror(const std::deque& uris) const { /* Here we return one of the bests mirrors */ int max = getMaxDownloadSpeed(uris); - int min = max-(int)(max*0.25); + int min = max - (int)(max * 0.25); std::deque bests = getUrisBySpeed(uris, min); if (bests.size() < 2) { std::string uri = getMaxDownloadSpeedUri(uris); A2_LOG_DEBUG(fmt("AdaptiveURISelector: choosing the best mirror :" " %.2fKB/s %s (other mirrors are at least 25%% slower)", - (float) max/1024, - uri.c_str())); + (float)max / 1024, uri.c_str())); return uri; - } else { + } + else { std::string uri = selectRandomUri(bests); A2_LOG_DEBUG(fmt("AdaptiveURISelector: choosing randomly one of the best" " mirrors (range [%.2fKB/s, %.2fKB/s]): %s", - (float) min/1024, - (float) max/1024, - uri.c_str())); + (float)min / 1024, (float)max / 1024, uri.c_str())); return uri; } } @@ -210,36 +212,32 @@ std::string AdaptiveURISelector::getBestMirror void AdaptiveURISelector::resetCounters() { nbConnections_ = 1; - nbServerToEvaluate_ = - requestGroup_->getOption()->getAsInt(PREF_SPLIT) - 1; + nbServerToEvaluate_ = requestGroup_->getOption()->getAsInt(PREF_SPLIT) - 1; } -void AdaptiveURISelector::tuneDownloadCommand -(const std::deque& uris, DownloadCommand* command) +void AdaptiveURISelector::tuneDownloadCommand( + const std::deque& uris, DownloadCommand* command) { adjustLowestSpeedLimit(uris, command); } -void AdaptiveURISelector::adjustLowestSpeedLimit -(const std::deque& uris, DownloadCommand* command) const +void AdaptiveURISelector::adjustLowestSpeedLimit( + const std::deque& uris, DownloadCommand* command) const { - int lowest = - requestGroup_->getOption()->getAsInt(PREF_LOWEST_SPEED_LIMIT); + int lowest = requestGroup_->getOption()->getAsInt(PREF_LOWEST_SPEED_LIMIT); if (lowest > 0) { int low_lowest = 4_k; int max = getMaxDownloadSpeed(uris); if (max > 0 && lowest > max / 4) { A2_LOG_NOTICE(fmt(_("Lowering lowest-speed-limit since known max speed is" " too near (new:%d was:%d max:%d)"), - max / 4, - lowest, - max)); + max / 4, lowest, max)); command->setLowestDownloadSpeedLimit(max / 4); - } else if (max == 0 && lowest > low_lowest) { + } + else if (max == 0 && lowest > low_lowest) { A2_LOG_NOTICE(fmt(_("Lowering lowest-speed-limit since we have no clue" " about available speed (now:%d was:%d)"), - low_lowest, - lowest)); + low_lowest, lowest)); command->setLowestDownloadSpeedLimit(low_lowest); } } @@ -253,30 +251,30 @@ int getUriMaxSpeed(std::shared_ptr ss) } } // namespace -int AdaptiveURISelector::getMaxDownloadSpeed -(const std::deque& uris) const +int AdaptiveURISelector::getMaxDownloadSpeed( + const std::deque& uris) const { std::string uri = getMaxDownloadSpeedUri(uris); - if(uri == A2STR::NIL) + if (uri == A2STR::NIL) return 0; return getUriMaxSpeed(getServerStats(uri)); } -std::string AdaptiveURISelector::getMaxDownloadSpeedUri -(const std::deque& uris) const +std::string AdaptiveURISelector::getMaxDownloadSpeedUri( + const std::deque& uris) const { int max = -1; std::string uri = A2STR::NIL; - for(auto& u : uris) { + for (auto& u : uris) { std::shared_ptr ss = getServerStats(u); - if(!ss) + if (!ss) continue; - if((int)ss->getSingleConnectionAvgSpeed() > max) { + if ((int)ss->getSingleConnectionAvgSpeed() > max) { max = ss->getSingleConnectionAvgSpeed(); uri = u; } - if((int)ss->getMultiConnectionAvgSpeed() > max) { + if ((int)ss->getMultiConnectionAvgSpeed() > max) { max = ss->getMultiConnectionAvgSpeed(); uri = u; } @@ -284,84 +282,86 @@ std::string AdaptiveURISelector::getMaxDownloadSpeedUri return uri; } -std::deque AdaptiveURISelector::getUrisBySpeed -(const std::deque& uris, int min) const +std::deque +AdaptiveURISelector::getUrisBySpeed(const std::deque& uris, + int min) const { std::deque bests; - for(auto& uri : uris) { + for (auto& uri : uris) { std::shared_ptr ss = getServerStats(uri); - if(!ss) + if (!ss) continue; - if(ss->getSingleConnectionAvgSpeed() > min || - ss->getMultiConnectionAvgSpeed() > min) { + if (ss->getSingleConnectionAvgSpeed() > min || + ss->getMultiConnectionAvgSpeed() > min) { bests.push_back(uri); } } return bests; } -std::string AdaptiveURISelector::selectRandomUri -(const std::deque& uris) const +std::string +AdaptiveURISelector::selectRandomUri(const std::deque& uris) const { int pos = SimpleRandomizer::getInstance()->getRandomNumber(uris.size()); auto i = std::begin(uris); - i = i+pos; + i = i + pos; return *i; } -std::string AdaptiveURISelector::getFirstNotTestedUri -(const std::deque& uris) const +std::string AdaptiveURISelector::getFirstNotTestedUri( + const std::deque& uris) const { for (const auto& i : uris) { std::shared_ptr ss = getServerStats(i); - if(!ss) + if (!ss) return i; } return A2STR::NIL; } -std::string AdaptiveURISelector::getFirstToTestUri -(const std::deque& uris) const +std::string AdaptiveURISelector::getFirstToTestUri( + const std::deque& uris) const { int counter; int power; for (const auto& u : uris) { std::shared_ptr ss = getServerStats(u); - if(!ss) + if (!ss) continue; counter = ss->getCounter(); - if(counter > 8) + if (counter > 8) continue; power = (int)pow(2.0, (float)counter); /* We test the mirror another time if it has not been * tested since 2^counter days */ - if(ss->getLastUpdated().difference() > std::chrono::hours(power * 24)) { + if (ss->getLastUpdated().difference() > std::chrono::hours(power * 24)) { return u; } } return A2STR::NIL; } -std::shared_ptr AdaptiveURISelector::getServerStats -(const std::string& uri) const +std::shared_ptr +AdaptiveURISelector::getServerStats(const std::string& uri) const { uri_split_result us; - if(uri_split(&us, uri.c_str()) == 0) { + if (uri_split(&us, uri.c_str()) == 0) { std::string host = uri::getFieldString(us, USR_HOST, uri.c_str()); std::string protocol = uri::getFieldString(us, USR_SCHEME, uri.c_str()); return serverStatMan_->find(host, protocol); - } else { + } + else { return nullptr; } } -int AdaptiveURISelector::getNbTestedServers -(const std::deque& uris) const +int AdaptiveURISelector::getNbTestedServers( + const std::deque& uris) const { int counter = 0; - for(const auto& u : uris) { + for (const auto& u : uris) { std::shared_ptr ss = getServerStats(u); - if(!ss) + if (!ss) ++counter; } return uris.size() - counter; diff --git a/src/AdaptiveURISelector.h b/src/AdaptiveURISelector.h index 28a7fa0b..88122bde 100644 --- a/src/AdaptiveURISelector.h +++ b/src/AdaptiveURISelector.h @@ -46,7 +46,7 @@ class ServerStatMan; class RequestGroup; class ServerStat; -class AdaptiveURISelector:public URISelector { +class AdaptiveURISelector : public URISelector { private: std::shared_ptr serverStatMan_; // No need to delete requestGroup_ @@ -69,20 +69,20 @@ private: std::shared_ptr getServerStats(const std::string& uri) const; int getNbTestedServers(const std::deque& uris) const; std::string getBestMirror(const std::deque& uris) const; + public: AdaptiveURISelector(std::shared_ptr serverStatMan, RequestGroup* requestGroup); virtual ~AdaptiveURISelector(); - virtual std::string select - (FileEntry* fileEntry, - const std::vector >& usedHosts) - CXX11_OVERRIDE; + virtual std::string + select(FileEntry* fileEntry, + const std::vector>& usedHosts) + CXX11_OVERRIDE; virtual void tuneDownloadCommand(const std::deque& uris, - DownloadCommand* command) - CXX11_OVERRIDE; + DownloadCommand* command) CXX11_OVERRIDE; virtual void resetCounters() CXX11_OVERRIDE; }; diff --git a/src/Adler32MessageDigestImpl.cc b/src/Adler32MessageDigestImpl.cc index 96ce07ca..f356999a 100644 --- a/src/Adler32MessageDigestImpl.cc +++ b/src/Adler32MessageDigestImpl.cc @@ -43,23 +43,18 @@ namespace aria2 { Adler32MessageDigestImpl::Adler32MessageDigestImpl() - : adler_(adler32(0, Z_NULL, 0)) -{} - -size_t Adler32MessageDigestImpl::getDigestLength() const + : adler_(adler32(0, Z_NULL, 0)) { - return length(); } -void Adler32MessageDigestImpl::reset() -{ - adler_ = adler32(0, Z_NULL, 0); -} +size_t Adler32MessageDigestImpl::getDigestLength() const { return length(); } + +void Adler32MessageDigestImpl::reset() { adler_ = adler32(0, Z_NULL, 0); } void Adler32MessageDigestImpl::update(const void* data, size_t length) { - adler_ = adler32(adler_, reinterpret_cast(data), - length); + adler_ = + adler32(adler_, reinterpret_cast(data), length); } void Adler32MessageDigestImpl::digest(unsigned char* md) @@ -68,9 +63,6 @@ void Adler32MessageDigestImpl::digest(unsigned char* md) memcpy(md, &adler, getDigestLength()); } -size_t Adler32MessageDigestImpl::length() -{ - return 4; -} +size_t Adler32MessageDigestImpl::length() { return 4; } } // namespace aria2 diff --git a/src/Adler32MessageDigestImpl.h b/src/Adler32MessageDigestImpl.h index 1fb91785..048edbaf 100644 --- a/src/Adler32MessageDigestImpl.h +++ b/src/Adler32MessageDigestImpl.h @@ -41,8 +41,11 @@ namespace aria2 { #ifdef HAVE_ZLIB -#define ADLER32_MESSAGE_DIGEST \ - { "adler32", make_hi() }, +#define ADLER32_MESSAGE_DIGEST \ + { \ + "adler32", make_hi() \ + } \ + , class Adler32MessageDigestImpl : public MessageDigestImpl { public: @@ -52,6 +55,7 @@ public: virtual void update(const void* data, size_t length) CXX11_OVERRIDE; virtual void digest(unsigned char* md) CXX11_OVERRIDE; static size_t length(); + private: unsigned long adler_; }; diff --git a/src/AnnounceList.cc b/src/AnnounceList.cc index b65106d3..234a33c8 100644 --- a/src/AnnounceList.cc +++ b/src/AnnounceList.cc @@ -42,64 +42,71 @@ namespace aria2 { -AnnounceList::AnnounceList():currentTrackerInitialized_(false) {} +AnnounceList::AnnounceList() : currentTrackerInitialized_(false) {} -AnnounceList::AnnounceList -(const std::vector>& announceList): - currentTrackerInitialized_(false) { +AnnounceList::AnnounceList( + const std::vector>& announceList) + : currentTrackerInitialized_(false) +{ reconfigure(announceList); } -AnnounceList::AnnounceList -(const std::deque>& announceTiers): - tiers_(announceTiers), currentTrackerInitialized_(false) { +AnnounceList::AnnounceList( + const std::deque>& announceTiers) + : tiers_(announceTiers), currentTrackerInitialized_(false) +{ resetIterator(); } AnnounceList::~AnnounceList() {} -void AnnounceList::reconfigure -(const std::vector>& announceList) +void AnnounceList::reconfigure( + const std::vector>& announceList) { - for (const auto& vec: announceList) { - if(vec.empty()) { + for (const auto& vec : announceList) { + if (vec.empty()) { continue; } std::deque uris(std::begin(vec), std::end(vec)); - auto tier = - std::make_shared(std::move(uris)); + auto tier = std::make_shared(std::move(uris)); tiers_.push_back(std::move(tier)); } resetIterator(); } -void AnnounceList::reconfigure(const std::string& url) { - std::deque urls{ url }; +void AnnounceList::reconfigure(const std::string& url) +{ + std::deque urls{url}; tiers_.push_back(std::make_shared(std::move(urls))); resetIterator(); } -void AnnounceList::resetIterator() { +void AnnounceList::resetIterator() +{ currentTier_ = std::begin(tiers_); - if(currentTier_ != std::end(tiers_) && (*currentTier_)->urls.size()) { + if (currentTier_ != std::end(tiers_) && (*currentTier_)->urls.size()) { currentTracker_ = std::begin((*currentTier_)->urls); currentTrackerInitialized_ = true; - } else { + } + else { currentTrackerInitialized_ = false; } } -std::string AnnounceList::getAnnounce() const { - if(currentTrackerInitialized_) { +std::string AnnounceList::getAnnounce() const +{ + if (currentTrackerInitialized_) { return *currentTracker_; - } else { + } + else { return A2STR::NIL; } } -void AnnounceList::announceSuccess() { - if(currentTrackerInitialized_) { +void AnnounceList::announceSuccess() +{ + if (currentTrackerInitialized_) { (*currentTier_)->nextEvent(); auto url = *currentTracker_; (*currentTier_)->urls.erase(currentTracker_); @@ -109,39 +116,45 @@ void AnnounceList::announceSuccess() { } } -void AnnounceList::announceFailure() { - if(currentTrackerInitialized_) { +void AnnounceList::announceFailure() +{ + if (currentTrackerInitialized_) { ++currentTracker_; - if(currentTracker_ == std::end((*currentTier_)->urls)) { + if (currentTracker_ == std::end((*currentTier_)->urls)) { // force next event (*currentTier_)->nextEventIfAfterStarted(); ++currentTier_; - if(currentTier_ == std::end(tiers_)) { + if (currentTier_ == std::end(tiers_)) { currentTrackerInitialized_ = false; - } else { + } + else { currentTracker_ = std::begin((*currentTier_)->urls); } } } } -AnnounceTier::AnnounceEvent AnnounceList::getEvent() const { - if(currentTrackerInitialized_) { +AnnounceTier::AnnounceEvent AnnounceList::getEvent() const +{ + if (currentTrackerInitialized_) { return (*currentTier_)->event; - } else { + } + else { return AnnounceTier::STARTED; } } -void AnnounceList::setEvent(AnnounceTier::AnnounceEvent event) { - if(currentTrackerInitialized_) { +void AnnounceList::setEvent(AnnounceTier::AnnounceEvent event) +{ + if (currentTrackerInitialized_) { (*currentTier_)->event = event; } } -const char* AnnounceList::getEventString() const { - if(currentTrackerInitialized_) { - switch((*currentTier_)->event) { +const char* AnnounceList::getEventString() const +{ + if (currentTrackerInitialized_) { + switch ((*currentTier_)->event) { case AnnounceTier::STARTED: case AnnounceTier::STARTED_AFTER_COMPLETION: return "started"; @@ -152,7 +165,8 @@ const char* AnnounceList::getEventString() const { default: return ""; } - } else { + } + else { return ""; } } @@ -160,8 +174,9 @@ const char* AnnounceList::getEventString() const { namespace { class FindStoppedAllowedTier { public: - bool operator()(const std::shared_ptr& tier) const { - switch(tier->event) { + bool operator()(const std::shared_ptr& tier) const + { + switch (tier->event) { case AnnounceTier::DOWNLOADING: case AnnounceTier::STOPPED: case AnnounceTier::COMPLETED: @@ -177,8 +192,9 @@ public: namespace { class FindCompletedAllowedTier { public: - bool operator()(const std::shared_ptr& tier) const { - switch(tier->event) { + bool operator()(const std::shared_ptr& tier) const + { + switch (tier->event) { case AnnounceTier::DOWNLOADING: case AnnounceTier::COMPLETED: return true; @@ -189,38 +205,44 @@ public: }; } // namespace -size_t AnnounceList::countStoppedAllowedTier() const { +size_t AnnounceList::countStoppedAllowedTier() const +{ return count_if(std::begin(tiers_), std::end(tiers_), FindStoppedAllowedTier()); } -size_t AnnounceList::countCompletedAllowedTier() const { +size_t AnnounceList::countCompletedAllowedTier() const +{ return count_if(std::begin(tiers_), std::end(tiers_), FindCompletedAllowedTier()); } -void AnnounceList::setCurrentTier -(std::deque>::iterator itr) { - if(itr != std::end(tiers_)) { +void AnnounceList::setCurrentTier( + std::deque>::iterator itr) +{ + if (itr != std::end(tiers_)) { currentTier_ = std::move(itr); currentTracker_ = std::begin((*currentTier_)->urls); } } -void AnnounceList::moveToStoppedAllowedTier() { +void AnnounceList::moveToStoppedAllowedTier() +{ auto itr = find_wrap_if(std::begin(tiers_), std::end(tiers_), currentTier_, FindStoppedAllowedTier()); setCurrentTier(std::move(itr)); } -void AnnounceList::moveToCompletedAllowedTier() { +void AnnounceList::moveToCompletedAllowedTier() +{ auto itr = find_wrap_if(std::begin(tiers_), std::end(tiers_), currentTier_, FindCompletedAllowedTier()); setCurrentTier(std::move(itr)); } -void AnnounceList::shuffle() { - for (const auto& tier: tiers_) { +void AnnounceList::shuffle() +{ + for (const auto& tier : tiers_) { auto& urls = tier->urls; std::shuffle(std::begin(urls), std::end(urls), *SimpleRandomizer::getInstance()); @@ -232,14 +254,11 @@ bool AnnounceList::allTiersFailed() const return currentTier_ == std::end(tiers_); } -void AnnounceList::resetTier() -{ - resetIterator(); -} +void AnnounceList::resetTier() { resetIterator(); } bool AnnounceList::currentTierAcceptsStoppedEvent() const { - if(currentTrackerInitialized_) { + if (currentTrackerInitialized_) { return FindStoppedAllowedTier()(*currentTier_); } @@ -248,16 +267,13 @@ bool AnnounceList::currentTierAcceptsStoppedEvent() const bool AnnounceList::currentTierAcceptsCompletedEvent() const { - if(currentTrackerInitialized_) { + if (currentTrackerInitialized_) { return FindCompletedAllowedTier()(*currentTier_); } return false; } -size_t AnnounceList::countTier() const -{ - return tiers_.size(); -} +size_t AnnounceList::countTier() const { return tiers_.size(); } } // namespace aria2 diff --git a/src/AnnounceList.h b/src/AnnounceList.h index c5d1da35..dd4e8f7e 100644 --- a/src/AnnounceList.h +++ b/src/AnnounceList.h @@ -56,8 +56,8 @@ private: bool currentTrackerInitialized_; void resetIterator(); - void setCurrentTier - (std::deque>::iterator itr); + void setCurrentTier(std::deque>::iterator itr); + public: AnnounceList(); AnnounceList(const std::vector>& announceList); diff --git a/src/AnnounceTier.cc b/src/AnnounceTier.cc index 577994e4..7472b36e 100644 --- a/src/AnnounceTier.cc +++ b/src/AnnounceTier.cc @@ -37,14 +37,15 @@ namespace aria2 { AnnounceTier::AnnounceTier(std::deque urls) - : event(STARTED), urls(std::move(urls)) -{} + : event(STARTED), urls(std::move(urls)) +{ +} AnnounceTier::~AnnounceTier() {} void AnnounceTier::nextEvent() { - switch(event) { + switch (event) { case STARTED: event = DOWNLOADING; break; @@ -64,7 +65,7 @@ void AnnounceTier::nextEvent() void AnnounceTier::nextEventIfAfterStarted() { - switch(event) { + switch (event) { case STOPPED: event = HALTED; break; diff --git a/src/AnonDiskWriterFactory.h b/src/AnonDiskWriterFactory.h index 573d203e..25d2dc26 100644 --- a/src/AnonDiskWriterFactory.h +++ b/src/AnonDiskWriterFactory.h @@ -42,14 +42,14 @@ namespace aria2 { // DiskwriterFactory class template to create DiskWriter derived // object, ignoring filename. -template -class AnonDiskWriterFactory:public DiskWriterFactory { +template +class AnonDiskWriterFactory : public DiskWriterFactory { public: AnonDiskWriterFactory() {} virtual ~AnonDiskWriterFactory() {} - virtual std::unique_ptr newDiskWriter(const std::string& filename) - CXX11_OVERRIDE + virtual std::unique_ptr + newDiskWriter(const std::string& filename) CXX11_OVERRIDE { return make_unique(); } diff --git a/src/ApiCallbackDownloadEventListener.cc b/src/ApiCallbackDownloadEventListener.cc index 3a5e3742..9145dd92 100644 --- a/src/ApiCallbackDownloadEventListener.cc +++ b/src/ApiCallbackDownloadEventListener.cc @@ -37,19 +37,16 @@ namespace aria2 { -ApiCallbackDownloadEventListener::ApiCallbackDownloadEventListener -(Session* session, - DownloadEventCallback callback, - void* userData) - : session_(session), - callback_(callback), - userData_(userData) -{} +ApiCallbackDownloadEventListener::ApiCallbackDownloadEventListener( + Session* session, DownloadEventCallback callback, void* userData) + : session_(session), callback_(callback), userData_(userData) +{ +} ApiCallbackDownloadEventListener::~ApiCallbackDownloadEventListener() {} -void ApiCallbackDownloadEventListener::onEvent -(DownloadEvent event, const RequestGroup* group) +void ApiCallbackDownloadEventListener::onEvent(DownloadEvent event, + const RequestGroup* group) { callback_(session_, event, group->getGID(), userData_); } diff --git a/src/ApiCallbackDownloadEventListener.h b/src/ApiCallbackDownloadEventListener.h index 81cae4ff..c7776e1d 100644 --- a/src/ApiCallbackDownloadEventListener.h +++ b/src/ApiCallbackDownloadEventListener.h @@ -45,8 +45,9 @@ public: DownloadEventCallback callback, void* userData); virtual ~ApiCallbackDownloadEventListener(); - virtual void onEvent(DownloadEvent event, const RequestGroup* group) - CXX11_OVERRIDE; + virtual void onEvent(DownloadEvent event, + const RequestGroup* group) CXX11_OVERRIDE; + private: Session* session_; DownloadEventCallback callback_; diff --git a/src/AppleMessageDigestImpl.cc b/src/AppleMessageDigestImpl.cc index 59e4c4dd..4204cc5f 100644 --- a/src/AppleMessageDigestImpl.cc +++ b/src/AppleMessageDigestImpl.cc @@ -42,77 +42,50 @@ namespace aria2 { namespace { -template +template class MessageDigestBase : public MessageDigestImpl { public: MessageDigestBase() { reset(); } virtual ~MessageDigestBase() {} - static size_t length() { - return dlen; - } - virtual size_t getDigestLength() const CXX11_OVERRIDE { - return dlen; - } - virtual void reset() CXX11_OVERRIDE { - init_fn(&ctx_); - } - virtual void update(const void* data, size_t length) CXX11_OVERRIDE { + static size_t length() { return dlen; } + virtual size_t getDigestLength() const CXX11_OVERRIDE { return dlen; } + virtual void reset() CXX11_OVERRIDE { init_fn(&ctx_); } + virtual void update(const void* data, size_t length) CXX11_OVERRIDE + { auto bytes = reinterpret_cast(data); while (length) { - CC_LONG l = std::min(length, (size_t)std::numeric_limits::max()); + CC_LONG l = + std::min(length, (size_t)std::numeric_limits::max()); update_fn(&ctx_, bytes, l); length -= l; bytes += l; } } - virtual void digest(unsigned char* md) CXX11_OVERRIDE { - final_fn(md, &ctx_); - } + virtual void digest(unsigned char* md) CXX11_OVERRIDE { final_fn(md, &ctx_); } + private: ctx_t ctx_; }; -typedef MessageDigestBase -MessageDigestMD5; -typedef MessageDigestBase -MessageDigestSHA1; -typedef MessageDigestBase -MessageDigestSHA224; -typedef MessageDigestBase -MessageDigestSHA256; -typedef MessageDigestBase -MessageDigestSHA384; -typedef MessageDigestBase -MessageDigestSHA512; +typedef MessageDigestBase MessageDigestMD5; +typedef MessageDigestBase MessageDigestSHA1; +typedef MessageDigestBase MessageDigestSHA224; +typedef MessageDigestBase MessageDigestSHA256; +typedef MessageDigestBase MessageDigestSHA384; +typedef MessageDigestBase MessageDigestSHA512; } // namespace @@ -122,13 +95,12 @@ std::unique_ptr MessageDigestImpl::sha1() } MessageDigestImpl::hashes_t MessageDigestImpl::hashes = { - { "sha-1", make_hi() }, - { "sha-224", make_hi() }, - { "sha-256", make_hi() }, - { "sha-384", make_hi() }, - { "sha-512", make_hi() }, - { "md5", make_hi() }, - ADLER32_MESSAGE_DIGEST -}; + {"sha-1", make_hi()}, + {"sha-224", make_hi()}, + {"sha-256", make_hi()}, + {"sha-384", make_hi()}, + {"sha-512", make_hi()}, + {"md5", make_hi()}, + ADLER32_MESSAGE_DIGEST}; } // namespace aria2 diff --git a/src/AppleTLSContext.cc b/src/AppleTLSContext.cc index e53bd87f..808ad570 100644 --- a/src/AppleTLSContext.cc +++ b/src/AppleTLSContext.cc @@ -56,17 +56,11 @@ using namespace aria2; #if defined(__MAC_10_6) #if defined(__MAC_10_7) -static const void* query_keys[] = { - kSecClass, - kSecReturnRef, - kSecMatchPolicy, - kSecMatchLimit -}; +static const void* query_keys[] = {kSecClass, kSecReturnRef, kSecMatchPolicy, + kSecMatchLimit}; #endif // defined(__MAC_10_7) -template -class CFRef -{ +template class CFRef { T ref_; public: @@ -74,10 +68,7 @@ public: CFRef(T ref) : ref_(ref) {} - ~CFRef() - { - reset(nullptr); - } + ~CFRef() { reset(nullptr); } void reset(T ref) { @@ -87,20 +78,11 @@ public: ref_ = ref; } - T get() - { - return ref_; - } + T get() { return ref_; } - const T get() const - { - return ref_; - } + const T get() const { return ref_; } - operator bool() const - { - return !!ref_; - } + operator bool() const { return !!ref_; } }; static inline bool isWhitespace(char c) @@ -116,8 +98,7 @@ static inline std::string stripWhitespace(std::string str) return str; } -struct hash_validator -{ +struct hash_validator { const std::string& hash_; hash_validator(const std::string& hash) : hash_(hash) {} @@ -128,14 +109,14 @@ struct hash_validator } }; -struct hash_finder -{ +struct hash_finder { CFDataRef data_; const std::string& hash_; hash_finder(CFDataRef data, const std::string& hash) - : data_(data), hash_(hash) - {} + : data_(data), hash_(hash) + { + } inline bool operator()(std::string type) const { @@ -163,8 +144,7 @@ std::string errToString(OSStatus err) return rv; } -bool checkIdentity(const SecIdentityRef id, - const std::string& fingerPrint, +bool checkIdentity(const SecIdentityRef id, const std::string& fingerPrint, const std::vector supported) { CFRef ref; @@ -235,10 +215,7 @@ bool AppleTLSContext::addTrustedCACertFile(const std::string& certfile) return false; } -SecIdentityRef AppleTLSContext::getCredentials() -{ - return credentials_; -} +SecIdentityRef AppleTLSContext::getCredentials() { return credentials_; } bool AppleTLSContext::tryAsFingerprint(const std::string& fingerprint) { @@ -264,12 +241,8 @@ bool AppleTLSContext::tryAsFingerprint(const std::string& fingerprint) A2_LOG_ERROR("Failed to create SecPolicy"); return false; } - const void* query_values[] = { - kSecClassIdentity, - kCFBooleanTrue, - policy.get(), - kSecMatchLimitAll - }; + const void* query_values[] = {kSecClassIdentity, kCFBooleanTrue, policy.get(), + kSecMatchLimitAll}; CFRef query(CFDictionaryCreate( nullptr, query_keys, query_values, 4, nullptr, nullptr)); if (!query) { @@ -372,18 +345,12 @@ bool AppleTLSContext::tryAsPKCS12(CFDataRef data, const char* password) #if defined(__MAC_10_6) CFRef passwordRef; if (password) { - passwordRef.reset(CFStringCreateWithBytes(nullptr, - (const UInt8*)password, + passwordRef.reset(CFStringCreateWithBytes(nullptr, (const UInt8*)password, strlen(password), - kCFStringEncodingUTF8, - false)); + kCFStringEncodingUTF8, false)); } - const void* keys[] = { - kSecImportExportPassphrase - }; - const void* values[] = { - passwordRef.get() - }; + const void* keys[] = {kSecImportExportPassphrase}; + const void* values[] = {passwordRef.get()}; CFRef options( CFDictionaryCreate(nullptr, keys, values, 1, nullptr, nullptr)); if (!options) { diff --git a/src/AppleTLSContext.h b/src/AppleTLSContext.h index 6c72e5e9..800b8d46 100644 --- a/src/AppleTLSContext.h +++ b/src/AppleTLSContext.h @@ -46,12 +46,12 @@ namespace aria2 { -class AppleTLSContext : public TLSContext -{ +class AppleTLSContext : public TLSContext { public: AppleTLSContext(TLSSessionSide side, TLSVersion ver) - : side_(side), minTLSVer_(ver), verifyPeer_(true), credentials_(nullptr) - {} + : side_(side), minTLSVer_(ver), verifyPeer_(true), credentials_(nullptr) + { + } virtual ~AppleTLSContext(); @@ -59,28 +59,16 @@ public: virtual bool addCredentialFile(const std::string& certfile, const std::string& keyfile) CXX11_OVERRIDE; - virtual bool addSystemTrustedCACerts() CXX11_OVERRIDE - { - return true; - } + virtual bool addSystemTrustedCACerts() CXX11_OVERRIDE { return true; } // certfile can contain multiple certificates. virtual bool addTrustedCACertFile(const std::string& certfile) CXX11_OVERRIDE; - virtual bool good() const CXX11_OVERRIDE - { - return true; - } + virtual bool good() const CXX11_OVERRIDE { return true; } - virtual TLSSessionSide getSide() const CXX11_OVERRIDE - { - return side_; - } + virtual TLSSessionSide getSide() const CXX11_OVERRIDE { return side_; } - virtual bool getVerifyPeer() const CXX11_OVERRIDE - { - return verifyPeer_; - } + virtual bool getVerifyPeer() const CXX11_OVERRIDE { return verifyPeer_; } virtual void setVerifyPeer(bool verify) CXX11_OVERRIDE { @@ -89,10 +77,7 @@ public: SecIdentityRef getCredentials(); - TLSVersion getMinTLSVersion() const - { - return minTLSVer_; - } + TLSVersion getMinTLSVersion() const { return minTLSVer_; } private: TLSSessionSide side_; diff --git a/src/AppleTLSSession.cc b/src/AppleTLSSession.cc index be2c0713..6b001c86 100644 --- a/src/AppleTLSSession.cc +++ b/src/AppleTLSSession.cc @@ -101,172 +101,180 @@ static inline const char* protoToString(SSLProtocol proto) { \ n, #s \ } -static struct -{ +static struct { SSLCipherSuite suite; const char* name; } kSuites[] = { - // From CipherSuite.h (10.9) - SUITE(SSL_NULL_WITH_NULL_NULL, 0x0000), - SUITE(SSL_RSA_WITH_NULL_MD5, 0x0001), - SUITE(SSL_RSA_WITH_NULL_SHA, 0x0002), - SUITE(SSL_RSA_EXPORT_WITH_RC4_40_MD5, 0x0003), - SUITE(SSL_RSA_WITH_RC4_128_MD5, 0x0004), - SUITE(SSL_RSA_WITH_RC4_128_SHA, 0x0005), - SUITE(SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5, 0x0006), - SUITE(SSL_RSA_WITH_IDEA_CBC_SHA, 0x0007), - SUITE(SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, 0x0008), - SUITE(SSL_RSA_WITH_DES_CBC_SHA, 0x0009), - SUITE(SSL_RSA_WITH_3DES_EDE_CBC_SHA, 0x000A), - SUITE(SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA, 0x000B), - SUITE(SSL_DH_DSS_WITH_DES_CBC_SHA, 0x000C), - SUITE(SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA, 0x000D), - SUITE(SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA, 0x000E), - SUITE(SSL_DH_RSA_WITH_DES_CBC_SHA, 0x000F), - SUITE(SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA, 0x0010), - SUITE(SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, 0x0011), - SUITE(SSL_DHE_DSS_WITH_DES_CBC_SHA, 0x0012), - SUITE(SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, 0x0013), - SUITE(SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, 0x0014), - SUITE(SSL_DHE_RSA_WITH_DES_CBC_SHA, 0x0015), - SUITE(SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, 0x0016), - SUITE(SSL_DH_anon_EXPORT_WITH_RC4_40_MD5, 0x0017), - SUITE(SSL_DH_anon_WITH_RC4_128_MD5, 0x0018), - SUITE(SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA, 0x0019), - SUITE(SSL_DH_anon_WITH_DES_CBC_SHA, 0x001A), - SUITE(SSL_DH_anon_WITH_3DES_EDE_CBC_SHA, 0x001B), - SUITE(SSL_FORTEZZA_DMS_WITH_NULL_SHA, 0x001C), - SUITE(SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA, 0x001D), - SUITE(TLS_RSA_WITH_AES_128_CBC_SHA, 0x002F), - SUITE(TLS_DH_DSS_WITH_AES_128_CBC_SHA, 0x0030), - SUITE(TLS_DH_RSA_WITH_AES_128_CBC_SHA, 0x0031), - SUITE(TLS_DHE_DSS_WITH_AES_128_CBC_SHA, 0x0032), - SUITE(TLS_DHE_RSA_WITH_AES_128_CBC_SHA, 0x0033), - SUITE(TLS_DH_anon_WITH_AES_128_CBC_SHA, 0x0034), - SUITE(TLS_RSA_WITH_AES_256_CBC_SHA, 0x0035), - SUITE(TLS_DH_DSS_WITH_AES_256_CBC_SHA, 0x0036), - SUITE(TLS_DH_RSA_WITH_AES_256_CBC_SHA, 0x0037), - SUITE(TLS_DHE_DSS_WITH_AES_256_CBC_SHA, 0x0038), - SUITE(TLS_DHE_RSA_WITH_AES_256_CBC_SHA, 0x0039), - SUITE(TLS_DH_anon_WITH_AES_256_CBC_SHA, 0x003A), - SUITE(TLS_ECDH_ECDSA_WITH_NULL_SHA, 0xC001), - SUITE(TLS_ECDH_ECDSA_WITH_RC4_128_SHA, 0xC002), - SUITE(TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, 0xC003), - SUITE(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, 0xC004), - SUITE(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, 0xC005), - SUITE(TLS_ECDHE_ECDSA_WITH_NULL_SHA, 0xC006), - SUITE(TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, 0xC007), - SUITE(TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, 0xC008), - SUITE(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, 0xC009), - SUITE(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, 0xC00A), - SUITE(TLS_ECDH_RSA_WITH_NULL_SHA, 0xC00B), - SUITE(TLS_ECDH_RSA_WITH_RC4_128_SHA, 0xC00C), - SUITE(TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, 0xC00D), - SUITE(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, 0xC00E), - SUITE(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, 0xC00F), - SUITE(TLS_ECDHE_RSA_WITH_NULL_SHA, 0xC010), - SUITE(TLS_ECDHE_RSA_WITH_RC4_128_SHA, 0xC011), - SUITE(TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, 0xC012), - SUITE(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, 0xC013), - SUITE(TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, 0xC014), - SUITE(TLS_ECDH_anon_WITH_NULL_SHA, 0xC015), - SUITE(TLS_ECDH_anon_WITH_RC4_128_SHA, 0xC016), - SUITE(TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, 0xC017), - SUITE(TLS_ECDH_anon_WITH_AES_128_CBC_SHA, 0xC018), - SUITE(TLS_ECDH_anon_WITH_AES_256_CBC_SHA, 0xC019), - SUITE(TLS_NULL_WITH_NULL_NULL, 0x0000), - SUITE(TLS_RSA_WITH_NULL_MD5, 0x0001), - SUITE(TLS_RSA_WITH_NULL_SHA, 0x0002), - SUITE(TLS_RSA_WITH_RC4_128_MD5, 0x0004), - SUITE(TLS_RSA_WITH_RC4_128_SHA, 0x0005), - SUITE(TLS_RSA_WITH_3DES_EDE_CBC_SHA, 0x000A), - SUITE(TLS_RSA_WITH_NULL_SHA256, 0x003B), - SUITE(TLS_RSA_WITH_AES_128_CBC_SHA256, 0x003C), - SUITE(TLS_RSA_WITH_AES_256_CBC_SHA256, 0x003D), - SUITE(TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA, 0x000D), - SUITE(TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA, 0x0010), - SUITE(TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, 0x0013), - SUITE(TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, 0x0016), - SUITE(TLS_DH_DSS_WITH_AES_128_CBC_SHA256, 0x003E), - SUITE(TLS_DH_RSA_WITH_AES_128_CBC_SHA256, 0x003F), - SUITE(TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, 0x0040), - SUITE(TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, 0x0067), - SUITE(TLS_DH_DSS_WITH_AES_256_CBC_SHA256, 0x0068), - SUITE(TLS_DH_RSA_WITH_AES_256_CBC_SHA256, 0x0069), - SUITE(TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, 0x006A), - SUITE(TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, 0x006B), - SUITE(TLS_DH_anon_WITH_RC4_128_MD5, 0x0018), - SUITE(TLS_DH_anon_WITH_3DES_EDE_CBC_SHA, 0x001B), - SUITE(TLS_DH_anon_WITH_AES_128_CBC_SHA256, 0x006C), - SUITE(TLS_DH_anon_WITH_AES_256_CBC_SHA256, 0x006D), - SUITE(TLS_PSK_WITH_RC4_128_SHA, 0x008A), - SUITE(TLS_PSK_WITH_3DES_EDE_CBC_SHA, 0x008B), - SUITE(TLS_PSK_WITH_AES_128_CBC_SHA, 0x008C), - SUITE(TLS_PSK_WITH_AES_256_CBC_SHA, 0x008D), - SUITE(TLS_DHE_PSK_WITH_RC4_128_SHA, 0x008E), - SUITE(TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, 0x008F), - SUITE(TLS_DHE_PSK_WITH_AES_128_CBC_SHA, 0x0090), - SUITE(TLS_DHE_PSK_WITH_AES_256_CBC_SHA, 0x0091), - SUITE(TLS_RSA_PSK_WITH_RC4_128_SHA, 0x0092), - SUITE(TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, 0x0093), - SUITE(TLS_RSA_PSK_WITH_AES_128_CBC_SHA, 0x0094), - SUITE(TLS_RSA_PSK_WITH_AES_256_CBC_SHA, 0x0095), - SUITE(TLS_PSK_WITH_NULL_SHA, 0x002C), - SUITE(TLS_DHE_PSK_WITH_NULL_SHA, 0x002D), - SUITE(TLS_RSA_PSK_WITH_NULL_SHA, 0x002E), - SUITE(TLS_RSA_WITH_AES_128_GCM_SHA256, 0x009C), - SUITE(TLS_RSA_WITH_AES_256_GCM_SHA384, 0x009D), - SUITE(TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, 0x009E), - SUITE(TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, 0x009F), - SUITE(TLS_DH_RSA_WITH_AES_128_GCM_SHA256, 0x00A0), - SUITE(TLS_DH_RSA_WITH_AES_256_GCM_SHA384, 0x00A1), - SUITE(TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, 0x00A2), - SUITE(TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, 0x00A3), - SUITE(TLS_DH_DSS_WITH_AES_128_GCM_SHA256, 0x00A4), - SUITE(TLS_DH_DSS_WITH_AES_256_GCM_SHA384, 0x00A5), - SUITE(TLS_DH_anon_WITH_AES_128_GCM_SHA256, 0x00A6), - SUITE(TLS_DH_anon_WITH_AES_256_GCM_SHA384, 0x00A7), - SUITE(TLS_PSK_WITH_AES_128_GCM_SHA256, 0x00A8), - SUITE(TLS_PSK_WITH_AES_256_GCM_SHA384, 0x00A9), - SUITE(TLS_DHE_PSK_WITH_AES_128_GCM_SHA256, 0x00AA), - SUITE(TLS_DHE_PSK_WITH_AES_256_GCM_SHA384, 0x00AB), - SUITE(TLS_RSA_PSK_WITH_AES_128_GCM_SHA256, 0x00AC), - SUITE(TLS_RSA_PSK_WITH_AES_256_GCM_SHA384, 0x00AD), - SUITE(TLS_PSK_WITH_AES_128_CBC_SHA256, 0x00AE), - SUITE(TLS_PSK_WITH_AES_256_CBC_SHA384, 0x00AF), - SUITE(TLS_PSK_WITH_NULL_SHA256, 0x00B0), - SUITE(TLS_PSK_WITH_NULL_SHA384, 0x00B1), - SUITE(TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, 0x00B2), - SUITE(TLS_DHE_PSK_WITH_AES_256_CBC_SHA384, 0x00B3), - SUITE(TLS_DHE_PSK_WITH_NULL_SHA256, 0x00B4), - SUITE(TLS_DHE_PSK_WITH_NULL_SHA384, 0x00B5), - SUITE(TLS_RSA_PSK_WITH_AES_128_CBC_SHA256, 0x00B6), - SUITE(TLS_RSA_PSK_WITH_AES_256_CBC_SHA384, 0x00B7), - SUITE(TLS_RSA_PSK_WITH_NULL_SHA256, 0x00B8), - SUITE(TLS_RSA_PSK_WITH_NULL_SHA384, 0x00B9), - SUITE(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, 0xC023), - SUITE(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, 0xC024), - SUITE(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, 0xC025), - SUITE(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, 0xC026), - SUITE(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, 0xC027), - SUITE(TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, 0xC028), - SUITE(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, 0xC029), - SUITE(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, 0xC02A), - SUITE(TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 0xC02B), - SUITE(TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, 0xC02C), - SUITE(TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, 0xC02D), - SUITE(TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, 0xC02E), - SUITE(TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 0xC02F), - SUITE(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 0xC030), - SUITE(TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, 0xC031), - SUITE(TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, 0xC032), - SUITE(TLS_EMPTY_RENEGOTIATION_INFO_SCSV, 0x00FF), - SUITE(SSL_RSA_WITH_RC2_CBC_MD5, 0xFF80), - SUITE(SSL_RSA_WITH_IDEA_CBC_MD5, 0xFF81), - SUITE(SSL_RSA_WITH_DES_CBC_MD5, 0xFF82), - SUITE(SSL_RSA_WITH_3DES_EDE_CBC_MD5, 0xFF83), - SUITE(SSL_NO_SUCH_CIPHERSUITE, 0xFFFF) -}; + // From CipherSuite.h (10.11) + SUITE(SSL_NULL_WITH_NULL_NULL, 0x0000), + SUITE(SSL_RSA_WITH_NULL_MD5, 0x0001), SUITE(SSL_RSA_WITH_NULL_SHA, 0x0002), + SUITE(SSL_RSA_EXPORT_WITH_RC4_40_MD5, 0x0003), + SUITE(SSL_RSA_WITH_RC4_128_MD5, 0x0004), + SUITE(SSL_RSA_WITH_RC4_128_SHA, 0x0005), + SUITE(SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5, 0x0006), + SUITE(SSL_RSA_WITH_IDEA_CBC_SHA, 0x0007), + SUITE(SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, 0x0008), + SUITE(SSL_RSA_WITH_DES_CBC_SHA, 0x0009), + SUITE(SSL_RSA_WITH_3DES_EDE_CBC_SHA, 0x000A), + SUITE(SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA, 0x000B), + SUITE(SSL_DH_DSS_WITH_DES_CBC_SHA, 0x000C), + SUITE(SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA, 0x000D), + SUITE(SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA, 0x000E), + SUITE(SSL_DH_RSA_WITH_DES_CBC_SHA, 0x000F), + SUITE(SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA, 0x0010), + SUITE(SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, 0x0011), + SUITE(SSL_DHE_DSS_WITH_DES_CBC_SHA, 0x0012), + SUITE(SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, 0x0013), + SUITE(SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, 0x0014), + SUITE(SSL_DHE_RSA_WITH_DES_CBC_SHA, 0x0015), + SUITE(SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, 0x0016), + SUITE(SSL_DH_anon_EXPORT_WITH_RC4_40_MD5, 0x0017), + SUITE(SSL_DH_anon_WITH_RC4_128_MD5, 0x0018), + SUITE(SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA, 0x0019), + SUITE(SSL_DH_anon_WITH_DES_CBC_SHA, 0x001A), + SUITE(SSL_DH_anon_WITH_3DES_EDE_CBC_SHA, 0x001B), + SUITE(SSL_FORTEZZA_DMS_WITH_NULL_SHA, 0x001C), + SUITE(SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA, 0x001D), + SUITE(TLS_RSA_WITH_AES_128_CBC_SHA, 0x002F), + SUITE(TLS_DH_DSS_WITH_AES_128_CBC_SHA, 0x0030), + SUITE(TLS_DH_RSA_WITH_AES_128_CBC_SHA, 0x0031), + SUITE(TLS_DHE_DSS_WITH_AES_128_CBC_SHA, 0x0032), + SUITE(TLS_DHE_RSA_WITH_AES_128_CBC_SHA, 0x0033), + SUITE(TLS_DH_anon_WITH_AES_128_CBC_SHA, 0x0034), + SUITE(TLS_RSA_WITH_AES_256_CBC_SHA, 0x0035), + SUITE(TLS_DH_DSS_WITH_AES_256_CBC_SHA, 0x0036), + SUITE(TLS_DH_RSA_WITH_AES_256_CBC_SHA, 0x0037), + SUITE(TLS_DHE_DSS_WITH_AES_256_CBC_SHA, 0x0038), + SUITE(TLS_DHE_RSA_WITH_AES_256_CBC_SHA, 0x0039), + SUITE(TLS_DH_anon_WITH_AES_256_CBC_SHA, 0x003A), + SUITE(TLS_ECDH_ECDSA_WITH_NULL_SHA, 0xC001), + SUITE(TLS_ECDH_ECDSA_WITH_RC4_128_SHA, 0xC002), + SUITE(TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, 0xC003), + SUITE(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, 0xC004), + SUITE(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, 0xC005), + SUITE(TLS_ECDHE_ECDSA_WITH_NULL_SHA, 0xC006), + SUITE(TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, 0xC007), + SUITE(TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, 0xC008), + SUITE(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, 0xC009), + SUITE(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, 0xC00A), + SUITE(TLS_ECDH_RSA_WITH_NULL_SHA, 0xC00B), + SUITE(TLS_ECDH_RSA_WITH_RC4_128_SHA, 0xC00C), + SUITE(TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, 0xC00D), + SUITE(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, 0xC00E), + SUITE(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, 0xC00F), + SUITE(TLS_ECDHE_RSA_WITH_NULL_SHA, 0xC010), + SUITE(TLS_ECDHE_RSA_WITH_RC4_128_SHA, 0xC011), + SUITE(TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, 0xC012), + SUITE(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, 0xC013), + SUITE(TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, 0xC014), + SUITE(TLS_ECDH_anon_WITH_NULL_SHA, 0xC015), + SUITE(TLS_ECDH_anon_WITH_RC4_128_SHA, 0xC016), + SUITE(TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA, 0xC017), + SUITE(TLS_ECDH_anon_WITH_AES_128_CBC_SHA, 0xC018), + SUITE(TLS_ECDH_anon_WITH_AES_256_CBC_SHA, 0xC019), + SUITE(TLS_NULL_WITH_NULL_NULL, 0x0000), + SUITE(TLS_RSA_WITH_NULL_MD5, 0x0001), SUITE(TLS_RSA_WITH_NULL_SHA, 0x0002), + SUITE(TLS_RSA_WITH_RC4_128_MD5, 0x0004), + SUITE(TLS_RSA_WITH_RC4_128_SHA, 0x0005), + SUITE(TLS_RSA_WITH_3DES_EDE_CBC_SHA, 0x000A), + SUITE(TLS_RSA_WITH_AES_128_CBC_SHA, 0x002F), + SUITE(TLS_RSA_WITH_AES_256_CBC_SHA, 0x0035), + SUITE(TLS_RSA_WITH_NULL_SHA256, 0x003B), + SUITE(TLS_RSA_WITH_AES_128_CBC_SHA256, 0x003C), + SUITE(TLS_RSA_WITH_AES_256_CBC_SHA256, 0x003D), + SUITE(TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA, 0x000D), + SUITE(TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA, 0x0010), + SUITE(TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA, 0x0013), + SUITE(TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA, 0x0016), + SUITE(TLS_DH_DSS_WITH_AES_128_CBC_SHA, 0x0030), + SUITE(TLS_DH_RSA_WITH_AES_128_CBC_SHA, 0x0031), + SUITE(TLS_DHE_DSS_WITH_AES_128_CBC_SHA, 0x0032), + SUITE(TLS_DHE_RSA_WITH_AES_128_CBC_SHA, 0x0033), + SUITE(TLS_DH_DSS_WITH_AES_256_CBC_SHA, 0x0036), + SUITE(TLS_DH_RSA_WITH_AES_256_CBC_SHA, 0x0037), + SUITE(TLS_DHE_DSS_WITH_AES_256_CBC_SHA, 0x0038), + SUITE(TLS_DHE_RSA_WITH_AES_256_CBC_SHA, 0x0039), + SUITE(TLS_DH_DSS_WITH_AES_128_CBC_SHA256, 0x003E), + SUITE(TLS_DH_RSA_WITH_AES_128_CBC_SHA256, 0x003F), + SUITE(TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, 0x0040), + SUITE(TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, 0x0067), + SUITE(TLS_DH_DSS_WITH_AES_256_CBC_SHA256, 0x0068), + SUITE(TLS_DH_RSA_WITH_AES_256_CBC_SHA256, 0x0069), + SUITE(TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, 0x006A), + SUITE(TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, 0x006B), + SUITE(TLS_DH_anon_WITH_RC4_128_MD5, 0x0018), + SUITE(TLS_DH_anon_WITH_3DES_EDE_CBC_SHA, 0x001B), + SUITE(TLS_DH_anon_WITH_AES_128_CBC_SHA, 0x0034), + SUITE(TLS_DH_anon_WITH_AES_256_CBC_SHA, 0x003A), + SUITE(TLS_DH_anon_WITH_AES_128_CBC_SHA256, 0x006C), + SUITE(TLS_DH_anon_WITH_AES_256_CBC_SHA256, 0x006D), + SUITE(TLS_PSK_WITH_RC4_128_SHA, 0x008A), + SUITE(TLS_PSK_WITH_3DES_EDE_CBC_SHA, 0x008B), + SUITE(TLS_PSK_WITH_AES_128_CBC_SHA, 0x008C), + SUITE(TLS_PSK_WITH_AES_256_CBC_SHA, 0x008D), + SUITE(TLS_DHE_PSK_WITH_RC4_128_SHA, 0x008E), + SUITE(TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA, 0x008F), + SUITE(TLS_DHE_PSK_WITH_AES_128_CBC_SHA, 0x0090), + SUITE(TLS_DHE_PSK_WITH_AES_256_CBC_SHA, 0x0091), + SUITE(TLS_RSA_PSK_WITH_RC4_128_SHA, 0x0092), + SUITE(TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA, 0x0093), + SUITE(TLS_RSA_PSK_WITH_AES_128_CBC_SHA, 0x0094), + SUITE(TLS_RSA_PSK_WITH_AES_256_CBC_SHA, 0x0095), + SUITE(TLS_PSK_WITH_NULL_SHA, 0x002C), + SUITE(TLS_DHE_PSK_WITH_NULL_SHA, 0x002D), + SUITE(TLS_RSA_PSK_WITH_NULL_SHA, 0x002E), + SUITE(TLS_RSA_WITH_AES_128_GCM_SHA256, 0x009C), + SUITE(TLS_RSA_WITH_AES_256_GCM_SHA384, 0x009D), + SUITE(TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, 0x009E), + SUITE(TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, 0x009F), + SUITE(TLS_DH_RSA_WITH_AES_128_GCM_SHA256, 0x00A0), + SUITE(TLS_DH_RSA_WITH_AES_256_GCM_SHA384, 0x00A1), + SUITE(TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, 0x00A2), + SUITE(TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, 0x00A3), + SUITE(TLS_DH_DSS_WITH_AES_128_GCM_SHA256, 0x00A4), + SUITE(TLS_DH_DSS_WITH_AES_256_GCM_SHA384, 0x00A5), + SUITE(TLS_DH_anon_WITH_AES_128_GCM_SHA256, 0x00A6), + SUITE(TLS_DH_anon_WITH_AES_256_GCM_SHA384, 0x00A7), + SUITE(TLS_PSK_WITH_AES_128_GCM_SHA256, 0x00A8), + SUITE(TLS_PSK_WITH_AES_256_GCM_SHA384, 0x00A9), + SUITE(TLS_DHE_PSK_WITH_AES_128_GCM_SHA256, 0x00AA), + SUITE(TLS_DHE_PSK_WITH_AES_256_GCM_SHA384, 0x00AB), + SUITE(TLS_RSA_PSK_WITH_AES_128_GCM_SHA256, 0x00AC), + SUITE(TLS_RSA_PSK_WITH_AES_256_GCM_SHA384, 0x00AD), + SUITE(TLS_PSK_WITH_AES_128_CBC_SHA256, 0x00AE), + SUITE(TLS_PSK_WITH_AES_256_CBC_SHA384, 0x00AF), + SUITE(TLS_PSK_WITH_NULL_SHA256, 0x00B0), + SUITE(TLS_PSK_WITH_NULL_SHA384, 0x00B1), + SUITE(TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, 0x00B2), + SUITE(TLS_DHE_PSK_WITH_AES_256_CBC_SHA384, 0x00B3), + SUITE(TLS_DHE_PSK_WITH_NULL_SHA256, 0x00B4), + SUITE(TLS_DHE_PSK_WITH_NULL_SHA384, 0x00B5), + SUITE(TLS_RSA_PSK_WITH_AES_128_CBC_SHA256, 0x00B6), + SUITE(TLS_RSA_PSK_WITH_AES_256_CBC_SHA384, 0x00B7), + SUITE(TLS_RSA_PSK_WITH_NULL_SHA256, 0x00B8), + SUITE(TLS_RSA_PSK_WITH_NULL_SHA384, 0x00B9), + SUITE(TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, 0xC023), + SUITE(TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, 0xC024), + SUITE(TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, 0xC025), + SUITE(TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, 0xC026), + SUITE(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, 0xC027), + SUITE(TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, 0xC028), + SUITE(TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, 0xC029), + SUITE(TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, 0xC02A), + SUITE(TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 0xC02B), + SUITE(TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, 0xC02C), + SUITE(TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, 0xC02D), + SUITE(TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, 0xC02E), + SUITE(TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 0xC02F), + SUITE(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 0xC030), + SUITE(TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, 0xC031), + SUITE(TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, 0xC032), + SUITE(TLS_EMPTY_RENEGOTIATION_INFO_SCSV, 0x00FF), + SUITE(SSL_RSA_WITH_RC2_CBC_MD5, 0xFF80), + SUITE(SSL_RSA_WITH_IDEA_CBC_MD5, 0xFF81), + SUITE(SSL_RSA_WITH_DES_CBC_MD5, 0xFF82), + SUITE(SSL_RSA_WITH_3DES_EDE_CBC_MD5, 0xFF83), + SUITE(SSL_NO_SUCH_CIPHERSUITE, 0xFFFF)}; #undef SUITE static inline std::string suiteToString(const SSLCipherSuite suite) @@ -283,9 +291,8 @@ static inline std::string suiteToString(const SSLCipherSuite suite) return ss.str(); } -static const char* kBlocked[] = { - "NULL", "anon", "MD5", "EXPORT", "DES", "IDEA", "NO_SUCH", "EMPTY", "PSK" -}; +static const char* kBlocked[] = {"NULL", "anon", "MD5", "EXPORT", + "DES", "IDEA", "NO_SUCH", "PSK"}; static inline bool isBlockedSuite(SSLCipherSuite suite) { @@ -309,7 +316,7 @@ static SSLCipherSuiteList constructEnabledSuites(SSLContextRef ctx) #ifndef CIPHER_CONSTRUCT_ALWAYS static #endif - SSLCipherSuiteList rv(0); + SSLCipherSuiteList rv(0); #ifndef CIPHER_CONSTRUCT_ALWAYS if (!rv.empty()) { @@ -345,17 +352,16 @@ TLSSession* TLSSession::make(TLSContext* ctx) } AppleTLSSession::AppleTLSSession(AppleTLSContext* ctx) - : sslCtx_(nullptr), - sockfd_(0), - state_(st_constructed), - lastError_(noErr), - writeBuffered_(0) + : sslCtx_(nullptr), + sockfd_(0), + state_(st_constructed), + lastError_(noErr), + writeBuffered_(0) { #if defined(__MAC_10_8) - sslCtx_ = SSLCreateContext(nullptr, - ctx->getSide() == TLS_SERVER ? kSSLServerSide : - kSSLClientSide, - kSSLStreamType); + sslCtx_ = SSLCreateContext( + nullptr, ctx->getSide() == TLS_SERVER ? kSSLServerSide : kSSLClientSide, + kSSLStreamType); lastError_ = sslCtx_ ? noErr : paramErr; #else lastError_ = SSLNewContext(ctx->getSide() == TLS_SERVER, &sslCtx_); @@ -388,13 +394,13 @@ AppleTLSSession::AppleTLSSession(AppleTLSContext* ctx) switch (ctx->getMinTLSVersion()) { case TLS_PROTO_SSL3: (void)SSLSetProtocolVersionEnabled(sslCtx_, kSSLProtocol3, true); - // fall through + // fall through case TLS_PROTO_TLS10: (void)SSLSetProtocolVersionEnabled(sslCtx_, kTLSProtocol1, true); - // fall through + // fall through case TLS_PROTO_TLS11: (void)SSLSetProtocolVersionEnabled(sslCtx_, kTLSProtocol11, true); - // fall through + // fall through case TLS_PROTO_TLS12: (void)SSLSetProtocolVersionEnabled(sslCtx_, kTLSProtocol12, true); default: @@ -410,12 +416,16 @@ AppleTLSSession::AppleTLSSession(AppleTLSContext* ctx) (SSLSessionOption)0x4, // kSSLSessionOptionSendOneByteRecord #endif true); +// False Start, if available +#if defined(__MAC_10_9) + (void)SSLSetSessionOption(sslCtx_, kSSLSessionOptionFalseStart, true); +#endif #if defined(__MAC_10_8) if (!ctx->getVerifyPeer()) { // This disables client verification - (void)SSLSetSessionOption( - sslCtx_, kSSLSessionOptionBreakOnServerAuth, true); + (void)SSLSetSessionOption(sslCtx_, kSSLSessionOptionBreakOnServerAuth, + true); } #else (void)SSLSetEnableCertVerify(sslCtx_, ctx->getVerifyPeer()); @@ -700,8 +710,7 @@ OSStatus AppleTLSSession::sockRead(void* data, size_t* len) } int AppleTLSSession::tlsConnect(const std::string& hostname, - TLSVersion& version, - std::string& handshakeErr) + TLSVersion& version, std::string& handshakeErr) { if (state_ != st_initialized) { return TLS_ERR_ERROR; @@ -733,27 +742,25 @@ int AppleTLSSession::tlsConnect(const std::string& hostname, (void)SSLGetNegotiatedProtocolVersion(sslCtx_, &proto); SSLCipherSuite suite = SSL_NO_SUCH_CIPHERSUITE; (void)SSLGetNegotiatedCipher(sslCtx_, &suite); - A2_LOG_INFO(fmt("AppleTLS: Connected to %s with %s (%s)", - hostname.c_str(), - protoToString(proto), - suiteToString(suite).c_str())); + A2_LOG_INFO(fmt("AppleTLS: Connected to %s with %s (%s)", hostname.c_str(), + protoToString(proto), suiteToString(suite).c_str())); switch (proto) { - case kSSLProtocol3: - version = TLS_PROTO_SSL3; - break; - case kTLSProtocol1: - version = TLS_PROTO_TLS10; - break; - case kTLSProtocol11: - version = TLS_PROTO_TLS11; - break; - case kTLSProtocol12: - version = TLS_PROTO_TLS12; - break; - default: - version = TLS_PROTO_NONE; - break; + case kSSLProtocol3: + version = TLS_PROTO_SSL3; + break; + case kTLSProtocol1: + version = TLS_PROTO_TLS10; + break; + case kTLSProtocol11: + version = TLS_PROTO_TLS11; + break; + case kTLSProtocol12: + version = TLS_PROTO_TLS12; + break; + default: + version = TLS_PROTO_NONE; + break; } return TLS_ERR_OK; diff --git a/src/AppleTLSSession.h b/src/AppleTLSSession.h index 2c491dff..5213b7b7 100644 --- a/src/AppleTLSSession.h +++ b/src/AppleTLSSession.h @@ -41,8 +41,7 @@ namespace aria2 { -class AppleTLSSession : public TLSSession -{ +class AppleTLSSession : public TLSSession { enum state_t { st_constructed, st_initialized, @@ -95,8 +94,7 @@ public: // if the underlying transport blocks, or TLS_ERR_ERROR. // When returning TLS_ERR_ERROR, provide certificate validation error // in |handshakeErr|. - virtual int tlsConnect(const std::string& hostname, - TLSVersion& version, + virtual int tlsConnect(const std::string& hostname, TLSVersion& version, std::string& handshakeErr) CXX11_OVERRIDE; // Performs server side handshake. This function returns TLS_ERR_OK @@ -107,9 +105,11 @@ public: // Returns last error string virtual std::string getLastErrorString() CXX11_OVERRIDE; + virtual size_t getRecvBufferedLength() CXX11_OVERRIDE { return 0; } + private: - static OSStatus - SocketWrite(SSLConnectionRef conn, const void* data, size_t* len) + static OSStatus SocketWrite(SSLConnectionRef conn, const void* data, + size_t* len) { return ((AppleTLSSession*)conn)->sockWrite(data, len); } diff --git a/src/AsyncNameResolver.cc b/src/AsyncNameResolver.cc index 34a33dc1..b041d6f9 100644 --- a/src/AsyncNameResolver.cc +++ b/src/AsyncNameResolver.cc @@ -46,50 +46,47 @@ namespace aria2 { void callback(void* arg, int status, int timeouts, struct hostent* host) { AsyncNameResolver* resolverPtr = reinterpret_cast(arg); - if(status != ARES_SUCCESS) { + if (status != ARES_SUCCESS) { resolverPtr->error_ = ares_strerror(status); resolverPtr->status_ = AsyncNameResolver::STATUS_ERROR; return; } - for(char** ap = host->h_addr_list; *ap; ++ap) { + for (char** ap = host->h_addr_list; *ap; ++ap) { char addrstring[NI_MAXHOST]; - if(inetNtop(host->h_addrtype, *ap, addrstring, sizeof(addrstring)) == 0) { + if (inetNtop(host->h_addrtype, *ap, addrstring, sizeof(addrstring)) == 0) { resolverPtr->resolvedAddresses_.push_back(addrstring); } } - if(resolverPtr->resolvedAddresses_.empty()) { + if (resolverPtr->resolvedAddresses_.empty()) { resolverPtr->error_ = "no address returned or address conversion failed"; resolverPtr->status_ = AsyncNameResolver::STATUS_ERROR; - } else { + } + else { resolverPtr->status_ = AsyncNameResolver::STATUS_SUCCESS; } } -AsyncNameResolver::AsyncNameResolver -(int family +AsyncNameResolver::AsyncNameResolver(int family #ifdef HAVE_ARES_ADDR_NODE - , ares_addr_node* servers + , + ares_addr_node* servers #endif // HAVE_ARES_ADDR_NODE - ) - : status_(STATUS_READY), - family_(family) + ) + : status_(STATUS_READY), family_(family) { // TODO evaluate return value ares_init(&channel_); #if defined(HAVE_ARES_SET_SERVERS) && defined(HAVE_ARES_ADDR_NODE) - if(servers) { + if (servers) { // ares_set_servers has been added since c-ares 1.7.1 - if(ares_set_servers(channel_, servers) != ARES_SUCCESS) { + if (ares_set_servers(channel_, servers) != ARES_SUCCESS) { A2_LOG_DEBUG("ares_set_servers failed"); } } #endif // HAVE_ARES_SET_SERVERS && HAVE_ARES_ADDR_NODE } -AsyncNameResolver::~AsyncNameResolver() -{ - ares_destroy(channel_); -} +AsyncNameResolver::~AsyncNameResolver() { ares_destroy(channel_); } void AsyncNameResolver::resolve(const std::string& name) { @@ -148,11 +145,11 @@ ares_addr_node* parseAsyncDNSServers(const std::string& serversOpt) ares_addr_node root; root.next = nullptr; ares_addr_node* tail = &root; - for (const auto& s: servers) { + for (const auto& s : servers) { auto node = make_unique(); size_t len = net::getBinAddr(&node->addr, s.c_str()); - if(len != 0) { + if (len != 0) { node->next = nullptr; node->family = (len == 4 ? AF_INET : AF_INET6); tail->next = node.release(); diff --git a/src/AsyncNameResolver.h b/src/AsyncNameResolver.h index fac6df5e..de7113c3 100644 --- a/src/AsyncNameResolver.h +++ b/src/AsyncNameResolver.h @@ -47,8 +47,9 @@ namespace aria2 { class AsyncNameResolver { - friend void callback - (void* arg, int status, int timeouts, struct hostent* host); + friend void callback(void* arg, int status, int timeouts, + struct hostent* host); + public: enum STATUS { STATUS_READY, @@ -56,6 +57,7 @@ public: STATUS_SUCCESS, STATUS_ERROR, }; + private: STATUS status_; int family_; @@ -64,13 +66,14 @@ private: std::vector resolvedAddresses_; std::string error_; std::string hostname_; + public: - AsyncNameResolver - (int family + AsyncNameResolver(int family #ifdef HAVE_ARES_ADDR_NODE - , ares_addr_node* servers + , + ares_addr_node* servers #endif // HAVE_ARES_ADDR_NODE - ); + ); ~AsyncNameResolver(); @@ -81,24 +84,15 @@ public: return resolvedAddresses_; } - const std::string& getError() const - { - return error_; - } + const std::string& getError() const { return error_; } - STATUS getStatus() const - { - return status_; - } + STATUS getStatus() const { return status_; } int getFds(fd_set* rfdsPtr, fd_set* wfdsPtr) const; void process(fd_set* rfdsPtr, fd_set* wfdsPtr); - int getFamily() const - { - return family_; - } + int getFamily() const { return family_; } #ifdef HAVE_LIBCARES int getsock(sock_t* sockets) const; @@ -113,11 +107,7 @@ public: void reset(); - const std::string& getHostname() const - { - return hostname_; - } - + const std::string& getHostname() const { return hostname_; } }; #ifdef HAVE_ARES_ADDR_NODE @@ -126,7 +116,6 @@ ares_addr_node* parseAsyncDNSServers(const std::string& serversOpt); #endif // HAVE_ARES_ADDR_NODE - } // namespace aria2 #endif // D_ASYNC_NAME_RESOLVER_H diff --git a/src/AsyncNameResolverMan.cc b/src/AsyncNameResolverMan.cc index ddf044f6..ef5fb741 100644 --- a/src/AsyncNameResolverMan.cc +++ b/src/AsyncNameResolverMan.cc @@ -49,21 +49,16 @@ namespace aria2 { AsyncNameResolverMan::AsyncNameResolverMan() - : numResolver_(0), - resolverCheck_(0), - ipv4_(true), - ipv6_(true) -{} - -AsyncNameResolverMan::~AsyncNameResolverMan() + : numResolver_(0), resolverCheck_(0), ipv4_(true), ipv6_(true) { - assert(!resolverCheck_); } +AsyncNameResolverMan::~AsyncNameResolverMan() { assert(!resolverCheck_); } + bool AsyncNameResolverMan::started() const { - for(size_t i = 0; i < numResolver_; ++i) { - if(asyncNameResolver_[i]) { + for (size_t i = 0; i < numResolver_; ++i) { + if (asyncNameResolver_[i]) { return true; } } @@ -71,46 +66,44 @@ bool AsyncNameResolverMan::started() const } void AsyncNameResolverMan::startAsync(const std::string& hostname, - DownloadEngine* e, - Command* command) + DownloadEngine* e, Command* command) { numResolver_ = 0; // Set IPv6 resolver first, so that we can push IPv6 address in // front of IPv6 address in getResolvedAddress(). - if(ipv6_) { + if (ipv6_) { startAsyncFamily(hostname, AF_INET6, e, command); ++numResolver_; } - if(ipv4_) { + if (ipv4_) { startAsyncFamily(hostname, AF_INET, e, command); ++numResolver_; } - A2_LOG_INFO(fmt(MSG_RESOLVING_HOSTNAME, command->getCuid(), - hostname.c_str())); + A2_LOG_INFO( + fmt(MSG_RESOLVING_HOSTNAME, command->getCuid(), hostname.c_str())); } void AsyncNameResolverMan::startAsyncFamily(const std::string& hostname, - int family, - DownloadEngine* e, + int family, DownloadEngine* e, Command* command) { - asyncNameResolver_[numResolver_] = std::make_shared - (family + asyncNameResolver_[numResolver_] = + std::make_shared(family #ifdef HAVE_ARES_ADDR_NODE - , - e->getAsyncDNSServers() + , + e->getAsyncDNSServers() #endif // HAVE_ARES_ADDR_NODE - ); + ); asyncNameResolver_[numResolver_]->resolve(hostname); setNameResolverCheck(numResolver_, e, command); } -void AsyncNameResolverMan::getResolvedAddress(std::vector& res) -const +void AsyncNameResolverMan::getResolvedAddress( + std::vector& res) const { - for(size_t i = 0; i < numResolver_; ++i) { - if(asyncNameResolver_[i]->getStatus() == - AsyncNameResolver::STATUS_SUCCESS) { + for (size_t i = 0; i < numResolver_; ++i) { + if (asyncNameResolver_[i]->getStatus() == + AsyncNameResolver::STATUS_SUCCESS) { auto& addrs = asyncNameResolver_[i]->getResolvedAddresses(); res.insert(std::end(res), std::begin(addrs), std::end(addrs)); } @@ -121,16 +114,15 @@ const void AsyncNameResolverMan::setNameResolverCheck(DownloadEngine* e, Command* command) { - for(size_t i = 0; i < numResolver_; ++i) { + for (size_t i = 0; i < numResolver_; ++i) { setNameResolverCheck(i, e, command); } } -void AsyncNameResolverMan::setNameResolverCheck(size_t index, - DownloadEngine* e, +void AsyncNameResolverMan::setNameResolverCheck(size_t index, DownloadEngine* e, Command* command) { - if(asyncNameResolver_[index]) { + if (asyncNameResolver_[index]) { assert((resolverCheck_ & (1 << index)) == 0); resolverCheck_ |= 1 << index; e->addNameResolverCheck(asyncNameResolver_[index], command); @@ -140,7 +132,7 @@ void AsyncNameResolverMan::setNameResolverCheck(size_t index, void AsyncNameResolverMan::disableNameResolverCheck(DownloadEngine* e, Command* command) { - for(size_t i = 0; i < numResolver_; ++i) { + for (size_t i = 0; i < numResolver_; ++i) { disableNameResolverCheck(i, e, command); } } @@ -149,7 +141,7 @@ void AsyncNameResolverMan::disableNameResolverCheck(size_t index, DownloadEngine* e, Command* command) { - if(asyncNameResolver_[index] && (resolverCheck_ & (1 << index))) { + if (asyncNameResolver_[index] && (resolverCheck_ & (1 << index))) { resolverCheck_ &= ~(1 << index); e->deleteNameResolverCheck(asyncNameResolver_[index], command); } @@ -160,11 +152,11 @@ int AsyncNameResolverMan::getStatus() const size_t success = 0; size_t error = 0; bool ipv4Success = false; - for(size_t i = 0; i < numResolver_; ++i) { - switch(asyncNameResolver_[i]->getStatus()) { + for (size_t i = 0; i < numResolver_; ++i) { + switch (asyncNameResolver_[i]->getStatus()) { case AsyncNameResolver::STATUS_SUCCESS: ++success; - if(asyncNameResolver_[i]->getFamily() == AF_INET) { + if (asyncNameResolver_[i]->getFamily() == AF_INET) { ipv4Success = true; } break; @@ -180,19 +172,21 @@ int AsyncNameResolverMan::getStatus() const // have to wait for a long time before timeout. We don't do the // inverse, because, based on today's deployment of DNS servers, // almost all of them can respond to A queries just fine. - if((success && ipv4Success) || success == numResolver_) { + if ((success && ipv4Success) || success == numResolver_) { return 1; - } else if(error == numResolver_) { + } + else if (error == numResolver_) { return -1; - } else { + } + else { return 0; } } const std::string& AsyncNameResolverMan::getLastError() const { - for(size_t i = 0; i < numResolver_; ++i) { - if(asyncNameResolver_[i]->getStatus() == AsyncNameResolver::STATUS_ERROR) { + for (size_t i = 0; i < numResolver_; ++i) { + if (asyncNameResolver_[i]->getStatus() == AsyncNameResolver::STATUS_ERROR) { // TODO This is not last error chronologically. return asyncNameResolver_[i]->getError(); } @@ -204,7 +198,7 @@ void AsyncNameResolverMan::reset(DownloadEngine* e, Command* command) { disableNameResolverCheck(e, command); assert(resolverCheck_ == 0); - for(size_t i = 0; i < numResolver_; ++i) { + for (size_t i = 0; i < numResolver_; ++i) { asyncNameResolver_[i].reset(); } numResolver_ = 0; @@ -219,14 +213,13 @@ void configureAsyncNameResolverMan(AsyncNameResolverMan* asyncNameResolverMan, // before network interfaces up. To workaround this, we check // addresses again if both addresses are not configured at the // startup. - if(!net::getIPv4AddrConfigured() && !net::getIPv6AddrConfigured()) { + if (!net::getIPv4AddrConfigured() && !net::getIPv6AddrConfigured()) { net::checkAddrconfig(); } - if(!net::getIPv4AddrConfigured()) { + if (!net::getIPv4AddrConfigured()) { asyncNameResolverMan->setIPv4(false); } - if(!net::getIPv6AddrConfigured() || - option->getAsBool(PREF_DISABLE_IPV6)) { + if (!net::getIPv6AddrConfigured() || option->getAsBool(PREF_DISABLE_IPV6)) { asyncNameResolverMan->setIPv6(false); } } diff --git a/src/AsyncNameResolverMan.h b/src/AsyncNameResolverMan.h index 6f84434e..617474ec 100644 --- a/src/AsyncNameResolverMan.h +++ b/src/AsyncNameResolverMan.h @@ -55,15 +55,9 @@ public: // must call it before the destruction of this object. ~AsyncNameResolverMan(); // Enable IPv4 address lookup. default: true - void setIPv4(bool ipv4) - { - ipv4_ = ipv4; - } + void setIPv4(bool ipv4) { ipv4_ = ipv4; } // Enable IPv6 address lookup. default: true - void setIPv6(bool ipv6) - { - ipv6_ = ipv6; - } + void setIPv6(bool ipv6) { ipv6_ = ipv6; } // Returns true if asynchronous name resolution has been started. bool started() const; // Starts asynchronous name resolution. @@ -76,10 +70,7 @@ public: // Removes resolvers from DownloadEngine. void disableNameResolverCheck(DownloadEngine* e, Command* command); // Returns true if any of resolvers are added in DownloadEngine. - bool resolverChecked() const - { - return resolverCheck_; - } + bool resolverChecked() const { return resolverCheck_; } // Returns status value: 0 for inprogress, 1 for success and -1 for // failure. int getStatus() const; @@ -87,9 +78,9 @@ public: const std::string& getLastError() const; // Resets state. Also removes resolvers from DownloadEngine. void reset(DownloadEngine* e, Command* command); + private: - void startAsyncFamily(const std::string& hostname, - int family, + void startAsyncFamily(const std::string& hostname, int family, DownloadEngine* e, Command* command); void setNameResolverCheck(size_t resolverIndex, DownloadEngine* e, Command* command); diff --git a/src/AuthConfig.cc b/src/AuthConfig.cc index a2f22ce1..6184ec3c 100644 --- a/src/AuthConfig.cc +++ b/src/AuthConfig.cc @@ -43,9 +43,9 @@ namespace aria2 { AuthConfig::AuthConfig() {} AuthConfig::AuthConfig(std::string user, std::string password) - : user_(std::move(user)), - password_(std::move(password)) -{} + : user_(std::move(user)), password_(std::move(password)) +{ +} AuthConfig::~AuthConfig() {} @@ -57,12 +57,13 @@ std::string AuthConfig::getAuthText() const return s; } -std::unique_ptr AuthConfig::create -(std::string user, std::string password) +std::unique_ptr AuthConfig::create(std::string user, + std::string password) { - if(user.empty()) { + if (user.empty()) { return nullptr; - } else { + } + else { return make_unique(std::move(user), std::move(password)); } } diff --git a/src/AuthConfig.h b/src/AuthConfig.h index e25c0af3..6c35dbef 100644 --- a/src/AuthConfig.h +++ b/src/AuthConfig.h @@ -48,6 +48,7 @@ private: std::string authScheme_; std::string user_; std::string password_; + public: AuthConfig(); AuthConfig(std::string user, std::string password); @@ -59,18 +60,12 @@ public: std::string getAuthText() const; - const std::string& getUser() const - { - return user_; - } + const std::string& getUser() const { return user_; } - const std::string& getPassword() const - { - return password_; - } + const std::string& getPassword() const { return password_; } - static std::unique_ptr create - (std::string user, std::string password); + static std::unique_ptr create(std::string user, + std::string password); }; std::ostream& operator<<(std::ostream& o, diff --git a/src/AuthConfigFactory.cc b/src/AuthConfigFactory.cc index 2f3c0573..43ba7285 100644 --- a/src/AuthConfigFactory.cc +++ b/src/AuthConfigFactory.cc @@ -57,51 +57,54 @@ AuthConfigFactory::AuthConfigFactory() {} AuthConfigFactory::~AuthConfigFactory() {} std::unique_ptr -AuthConfigFactory::createAuthConfig -(const std::shared_ptr& request, const Option* op) +AuthConfigFactory::createAuthConfig(const std::shared_ptr& request, + const Option* op) { - if(request->getProtocol() == "http" || request->getProtocol() == "https") { - if(op->getAsBool(PREF_HTTP_AUTH_CHALLENGE)) { - if(!request->getUsername().empty()) { - updateBasicCred(make_unique(request->getUsername(), - request->getPassword(), - request->getHost(), - request->getPort(), - request->getDir(), true)); + if (request->getProtocol() == "http" || request->getProtocol() == "https") { + if (op->getAsBool(PREF_HTTP_AUTH_CHALLENGE)) { + if (!request->getUsername().empty()) { + updateBasicCred(make_unique( + request->getUsername(), request->getPassword(), request->getHost(), + request->getPort(), request->getDir(), true)); return AuthConfig::create(request->getUsername(), request->getPassword()); } auto i = findBasicCred(request->getHost(), request->getPort(), request->getDir()); - if(i == std::end(basicCreds_)) { + if (i == std::end(basicCreds_)) { return nullptr; - } else { + } + else { return AuthConfig::create((*i)->user_, (*i)->password_); } - } else { - if(!request->getUsername().empty()) { + } + else { + if (!request->getUsername().empty()) { return AuthConfig::create(request->getUsername(), request->getPassword()); - } else { - return - createHttpAuthResolver(op)->resolveAuthConfig(request->getHost()); + } + else { + return createHttpAuthResolver(op) + ->resolveAuthConfig(request->getHost()); } } - } else if(request->getProtocol() == "ftp" || - request->getProtocol() == "sftp") { - if(!request->getUsername().empty()) { - if(request->hasPassword()) { + } + else if (request->getProtocol() == "ftp" || + request->getProtocol() == "sftp") { + if (!request->getUsername().empty()) { + if (request->hasPassword()) { return AuthConfig::create(request->getUsername(), request->getPassword()); - } else { - if(!op->getAsBool(PREF_NO_NETRC)) { + } + else { + if (!op->getAsBool(PREF_NO_NETRC)) { // First, check we have password corresponding to host and // username NetrcAuthResolver authResolver; authResolver.setNetrc(netrc_.get()); auto ac = authResolver.resolveAuthConfig(request->getHost()); - if(ac && ac->getUser() == request->getUsername()) { + if (ac && ac->getUser() == request->getUsername()) { return ac; } } @@ -110,22 +113,24 @@ AuthConfigFactory::createAuthConfig return AuthConfig::create(request->getUsername(), op->get(PREF_FTP_PASSWD)); } - } else { - return - createFtpAuthResolver(op)->resolveAuthConfig(request->getHost()); } - } else { + else { + return createFtpAuthResolver(op)->resolveAuthConfig(request->getHost()); + } + } + else { return nullptr; } } -std::unique_ptr AuthConfigFactory::createHttpAuthResolver -(const Option* op) const +std::unique_ptr +AuthConfigFactory::createHttpAuthResolver(const Option* op) const { std::unique_ptr resolver; - if(op->getAsBool(PREF_NO_NETRC)) { + if (op->getAsBool(PREF_NO_NETRC)) { resolver = make_unique(); - } else { + } + else { auto authResolver = make_unique(); authResolver->setNetrc(netrc_.get()); authResolver->ignoreDefault(); @@ -136,13 +141,14 @@ std::unique_ptr AuthConfigFactory::createHttpAuthResolver return std::move(resolver); } -std::unique_ptr AuthConfigFactory::createFtpAuthResolver -(const Option* op) const +std::unique_ptr +AuthConfigFactory::createFtpAuthResolver(const Option* op) const { std::unique_ptr resolver; - if(op->getAsBool(PREF_NO_NETRC)) { + if (op->getAsBool(PREF_NO_NETRC)) { resolver = make_unique(); - } else { + } + else { auto authResolver = make_unique(); authResolver->setNetrc(netrc_.get()); resolver = std::move(authResolver); @@ -161,61 +167,55 @@ void AuthConfigFactory::setNetrc(std::unique_ptr netrc) void AuthConfigFactory::updateBasicCred(std::unique_ptr basicCred) { auto i = basicCreds_.lower_bound(basicCred); - if(i != std::end(basicCreds_) && *i == basicCred) { + if (i != std::end(basicCreds_) && *i == basicCred) { *(*i) = std::move(*basicCred); - } else { + } + else { basicCreds_.insert(i, std::move(basicCred)); } } -bool AuthConfigFactory::activateBasicCred -(const std::string& host, - uint16_t port, - const std::string& path, - const Option* op) +bool AuthConfigFactory::activateBasicCred(const std::string& host, + uint16_t port, + const std::string& path, + const Option* op) { auto i = findBasicCred(host, port, path); - if(i == std::end(basicCreds_)) { + if (i == std::end(basicCreds_)) { auto authConfig = createHttpAuthResolver(op)->resolveAuthConfig(host); - if(!authConfig) { + if (!authConfig) { return false; - } else { + } + else { basicCreds_.insert(make_unique(authConfig->getUser(), - authConfig->getPassword(), - host, port, path, true)); + authConfig->getPassword(), host, + port, path, true)); return true; } - } else { + } + else { (*i)->activate(); return true; } } -BasicCred::BasicCred -(std::string user, std::string password, - std::string host, uint16_t port, std::string path, - bool activated) - : user_(std::move(user)), - password_(std::move(password)), - host_(std::move(host)), - port_(port), - path_(std::move(path)), - activated_(activated) +BasicCred::BasicCred(std::string user, std::string password, std::string host, + uint16_t port, std::string path, bool activated) + : user_(std::move(user)), + password_(std::move(password)), + host_(std::move(host)), + port_(port), + path_(std::move(path)), + activated_(activated) { - if(path_.empty() || path_[path_.size()-1] != '/') { + if (path_.empty() || path_[path_.size() - 1] != '/') { path_ += "/"; } } -void BasicCred::activate() -{ - activated_ = true; -} +void BasicCred::activate() { activated_ = true; } -bool BasicCred::isActivated() const -{ - return activated_; -} +bool BasicCred::isActivated() const { return activated_; } bool BasicCred::operator==(const BasicCred& cred) const { @@ -224,22 +224,21 @@ bool BasicCred::operator==(const BasicCred& cred) const bool BasicCred::operator<(const BasicCred& cred) const { - return host_ < cred.host_ || - (!(cred.host_ < host_) && (port_ < cred.port_ || - (!(cred.port_ < port_) && path_ > cred.path_))); + return host_ < cred.host_ || (!(cred.host_ < host_) && + (port_ < cred.port_ || (!(cred.port_ < port_) && + path_ > cred.path_))); } -AuthConfigFactory::BasicCredSet::iterator AuthConfigFactory::findBasicCred -(const std::string& host, - uint16_t port, - const std::string& path) +AuthConfigFactory::BasicCredSet::iterator +AuthConfigFactory::findBasicCred(const std::string& host, uint16_t port, + const std::string& path) { auto bc = make_unique("", "", host, port, path); auto i = basicCreds_.lower_bound(bc); - for(; i != std::end(basicCreds_) && - (*i)->host_ == host && - (*i)->port_ == port; ++i) { - if(util::startsWith(bc->path_, (*i)->path_)) { + for (; + i != std::end(basicCreds_) && (*i)->host_ == host && (*i)->port_ == port; + ++i) { + if (util::startsWith(bc->path_, (*i)->path_)) { return i; } } diff --git a/src/AuthConfigFactory.h b/src/AuthConfigFactory.h index 03c85bd4..c9ae60ec 100644 --- a/src/AuthConfigFactory.h +++ b/src/AuthConfigFactory.h @@ -61,9 +61,8 @@ public: std::string path_; bool activated_; - BasicCred(std::string user, std::string password, - std::string host, uint16_t port, std::string path, - bool activated = false); + BasicCred(std::string user, std::string password, std::string host, + uint16_t port, std::string path, bool activated = false); void activate(); @@ -78,6 +77,7 @@ class AuthConfigFactory { public: typedef std::set, DerefLess>> BasicCredSet; + private: std::unique_ptr netrc_; @@ -86,6 +86,7 @@ private: std::unique_ptr createFtpAuthResolver(const Option* op) const; BasicCredSet basicCreds_; + public: AuthConfigFactory(); @@ -95,8 +96,8 @@ public: // are used in this method: PREF_HTTP_USER, PREF_HTTP_PASSWD, // PREF_FTP_USER, PREF_FTP_PASSWD, PREF_NO_NETRC and // PREF_HTTP_AUTH_CHALLENGE. - std::unique_ptr createAuthConfig - (const std::shared_ptr& request, const Option* op); + std::unique_ptr + createAuthConfig(const std::shared_ptr& request, const Option* op); void setNetrc(std::unique_ptr netrc); @@ -106,20 +107,14 @@ public: // null, then returns false. Otherwise new BasicCred is created // using this AuthConfig object with given host and path "/" and // returns true. - bool activateBasicCred - (const std::string& host, - uint16_t port, - const std::string& path, - const Option* op); + bool activateBasicCred(const std::string& host, uint16_t port, + const std::string& path, const Option* op); // Find a BasicCred using host, port and path and return the // iterator pointing to it. If not found, then return // basicCreds_.end(). - BasicCredSet::iterator - findBasicCred - (const std::string& host, - uint16_t port, - const std::string& path); + BasicCredSet::iterator findBasicCred(const std::string& host, uint16_t port, + const std::string& path); // If the same BasicCred is already added, then it is replaced with // given basicCred. Otherwise, insert given basicCred to diff --git a/src/AuthResolver.h b/src/AuthResolver.h index c02e5ec5..86438f9f 100644 --- a/src/AuthResolver.h +++ b/src/AuthResolver.h @@ -48,8 +48,8 @@ class AuthResolver { public: virtual ~AuthResolver() {} - virtual std::unique_ptr resolveAuthConfig - (const std::string& hostname) = 0; + virtual std::unique_ptr + resolveAuthConfig(const std::string& hostname) = 0; }; } // namespace aria2 diff --git a/src/AutoSaveCommand.cc b/src/AutoSaveCommand.cc index 400a55dc..b0471f0d 100644 --- a/src/AutoSaveCommand.cc +++ b/src/AutoSaveCommand.cc @@ -40,15 +40,16 @@ namespace aria2 { AutoSaveCommand::AutoSaveCommand(cuid_t cuid, DownloadEngine* e, std::chrono::seconds interval) - : TimeBasedCommand(cuid, e, std::move(interval), true) -{} + : TimeBasedCommand(cuid, e, std::move(interval), true) +{ +} AutoSaveCommand::~AutoSaveCommand() {} void AutoSaveCommand::preProcess() { - if(getDownloadEngine()->getRequestGroupMan()->downloadFinished() || - getDownloadEngine()->isHaltRequested()) { + if (getDownloadEngine()->getRequestGroupMan()->downloadFinished() || + getDownloadEngine()->isHaltRequested()) { enableExit(); } } diff --git a/src/AutoSaveCommand.h b/src/AutoSaveCommand.h index 591246a0..66b97398 100644 --- a/src/AutoSaveCommand.h +++ b/src/AutoSaveCommand.h @@ -39,8 +39,7 @@ namespace aria2 { -class AutoSaveCommand : public TimeBasedCommand -{ +class AutoSaveCommand : public TimeBasedCommand { public: AutoSaveCommand(cuid_t cuid, DownloadEngine* e, std::chrono::seconds interval); diff --git a/src/BackupIPv4ConnectCommand.cc b/src/BackupIPv4ConnectCommand.cc index 66eaf6a9..61ef9e28 100644 --- a/src/BackupIPv4ConnectCommand.cc +++ b/src/BackupIPv4ConnectCommand.cc @@ -45,24 +45,22 @@ namespace aria2 { -BackupConnectInfo::BackupConnectInfo() - : cancel(false) -{} +BackupConnectInfo::BackupConnectInfo() : cancel(false) {} -BackupIPv4ConnectCommand::BackupIPv4ConnectCommand -(cuid_t cuid, const std::string& ipaddr, uint16_t port, - const std::shared_ptr& info, Command* mainCommand, - RequestGroup* requestGroup, DownloadEngine* e) -: Command(cuid), - ipaddr_(ipaddr), - port_(port), - info_(info), - mainCommand_(mainCommand), - requestGroup_(requestGroup), - e_(e), - startTime_(global::wallclock()), - timeoutCheck_(global::wallclock()), - timeout_(requestGroup_->getOption()->getAsInt(PREF_CONNECT_TIMEOUT)) +BackupIPv4ConnectCommand::BackupIPv4ConnectCommand( + cuid_t cuid, const std::string& ipaddr, uint16_t port, + const std::shared_ptr& info, Command* mainCommand, + RequestGroup* requestGroup, DownloadEngine* e) + : Command(cuid), + ipaddr_(ipaddr), + port_(port), + info_(info), + mainCommand_(mainCommand), + requestGroup_(requestGroup), + e_(e), + startTime_(global::wallclock()), + timeoutCheck_(global::wallclock()), + timeout_(requestGroup_->getOption()->getAsInt(PREF_CONNECT_TIMEOUT)) { requestGroup_->increaseStreamCommand(); requestGroup_->increaseNumCommand(); @@ -72,7 +70,7 @@ BackupIPv4ConnectCommand::~BackupIPv4ConnectCommand() { requestGroup_->decreaseNumCommand(); requestGroup_->decreaseStreamCommand(); - if(socket_) { + if (socket_) { e_->deleteSocketForWriteCheck(socket_, this); } } @@ -80,60 +78,68 @@ BackupIPv4ConnectCommand::~BackupIPv4ConnectCommand() bool BackupIPv4ConnectCommand::execute() { bool retval = false; - if(requestGroup_->downloadFinished() || requestGroup_->isHaltRequested()) { + if (requestGroup_->downloadFinished() || requestGroup_->isHaltRequested()) { retval = true; - } else if(info_->cancel) { - A2_LOG_INFO(fmt("CUID#%" PRId64 " - Backup connection canceled", - getCuid())); + } + else if (info_->cancel) { + A2_LOG_INFO( + fmt("CUID#%" PRId64 " - Backup connection canceled", getCuid())); retval = true; - } else if(socket_) { - if(writeEventEnabled()) { + } + else if (socket_) { + if (writeEventEnabled()) { try { std::string error = socket_->getSocketError(); - if(error.empty()) { + if (error.empty()) { A2_LOG_INFO(fmt("CUID#%" PRId64 " - Backup connection to %s " - "established", getCuid(), ipaddr_.c_str())); + "established", + getCuid(), ipaddr_.c_str())); info_->ipaddr = ipaddr_; e_->deleteSocketForWriteCheck(socket_, this); info_->socket.swap(socket_); mainCommand_->setStatus(STATUS_ONESHOT_REALTIME); e_->setNoWait(true); retval = true; - } else { + } + else { A2_LOG_INFO(fmt("CUID#%" PRId64 " - Backup connection failed: %s", getCuid(), error.c_str())); retval = true; } - } catch(RecoverableException& e) { - A2_LOG_INFO_EX(fmt("CUID#%" PRId64 " - Backup connection failed", - getCuid()), e); + } + catch (RecoverableException& e) { + A2_LOG_INFO_EX( + fmt("CUID#%" PRId64 " - Backup connection failed", getCuid()), e); retval = true; } } - } else if(!socket_) { + } + else if (!socket_) { // TODO Although we check 300ms initial timeout as described in // RFC 6555, the interval will be much longer and around 1 second // due to the refresh interval mechanism in DownloadEngine. - if(startTime_.difference(global::wallclock()) >= - std::chrono::milliseconds(300)) { + if (startTime_.difference(global::wallclock()) >= + std::chrono::milliseconds(300)) { socket_ = std::make_shared(); try { socket_->establishConnection(ipaddr_, port_); e_->addSocketForWriteCheck(socket_, this); timeoutCheck_ = global::wallclock(); - } catch(RecoverableException& e) { - A2_LOG_INFO_EX(fmt("CUID#%" PRId64 " - Backup connection failed", - getCuid()), e); + } + catch (RecoverableException& e) { + A2_LOG_INFO_EX( + fmt("CUID#%" PRId64 " - Backup connection failed", getCuid()), e); socket_.reset(); retval = true; } } - } else if(timeoutCheck_.difference(global::wallclock()) >= timeout_) { - A2_LOG_INFO(fmt("CUID#%" PRId64 " - Backup connection command timeout", - getCuid())); + } + else if (timeoutCheck_.difference(global::wallclock()) >= timeout_) { + A2_LOG_INFO( + fmt("CUID#%" PRId64 " - Backup connection command timeout", getCuid())); retval = true; } - if(!retval) { + if (!retval) { e_->addCommand(std::unique_ptr(this)); } return retval; diff --git a/src/BackupIPv4ConnectCommand.h b/src/BackupIPv4ConnectCommand.h index 8ae50e06..0c4f8365 100644 --- a/src/BackupIPv4ConnectCommand.h +++ b/src/BackupIPv4ConnectCommand.h @@ -64,13 +64,14 @@ struct BackupConnectInfo { // "Happy Eyeballs" implementation. class BackupIPv4ConnectCommand : public Command { public: - BackupIPv4ConnectCommand(cuid_t cuid, - const std::string& ipaddr, uint16_t port, + BackupIPv4ConnectCommand(cuid_t cuid, const std::string& ipaddr, + uint16_t port, const std::shared_ptr& info, - Command* mainCommand, - RequestGroup* requestGroup, DownloadEngine* e); + Command* mainCommand, RequestGroup* requestGroup, + DownloadEngine* e); ~BackupIPv4ConnectCommand(); virtual bool execute() CXX11_OVERRIDE; + private: std::string ipaddr_; uint16_t port_; diff --git a/src/BencodeParser.cc b/src/BencodeParser.cc index 84d94322..08d36b21 100644 --- a/src/BencodeParser.cc +++ b/src/BencodeParser.cc @@ -55,58 +55,60 @@ enum { BENCODE_STRING_LEN, BENCODE_STRING, BENCODE_NUMBER_SIGN, - BENCODE_NUMBER + BENCODE_NUMBER, + BENCODE_FLOAT_NUMBER_IGNORE, }; } // namespace BencodeParser::BencodeParser(StructParserStateMachine* psm) - : psm_(psm), - currentState_(BENCODE_INITIAL), - strLength_(0), - numberSign_(1), - number_(0), - numConsumed_(0), - lastError_(0) + : psm_(psm), + currentState_(BENCODE_INITIAL), + strLength_(0), + numberSign_(1), + number_(0), + numConsumed_(0), + lastError_(0) { stateStack_.push(BENCODE_FINISH); } -BencodeParser::~BencodeParser() -{} +BencodeParser::~BencodeParser() {} ssize_t BencodeParser::parseUpdate(const char* data, size_t size) { size_t i; - if(currentState_ == BENCODE_FINISH) { + if (currentState_ == BENCODE_FINISH) { return 0; - } else if(currentState_ == BENCODE_ERROR) { + } + else if (currentState_ == BENCODE_ERROR) { return lastError_; } - for(i = 0; i < size && currentState_ != BENCODE_FINISH; ++i) { + for (i = 0; i < size && currentState_ != BENCODE_FINISH; ++i) { char c = data[i]; - switch(currentState_) { + switch (currentState_) { case BENCODE_LIST: - if(c == 'e') { + if (c == 'e') { onListEnd(); break; - } else { + } + else { int rv = pushState(currentState_); - if(rv < 0) { + if (rv < 0) { return rv; } currentState_ = BENCODE_VALUE; runBeginCallback(STRUCT_ARRAY_DATA_T); } - // Fall through + // Fall through case BENCODE_INITIAL: case BENCODE_VALUE: - switch(c) { + switch (c) { case 'd': { currentState_ = BENCODE_DICT_KEY; runBeginCallback(STRUCT_DICT_T); break; } - case'l': + case 'l': currentState_ = BENCODE_LIST; runBeginCallback(STRUCT_ARRAY_T); break; @@ -118,25 +120,26 @@ ssize_t BencodeParser::parseUpdate(const char* data, size_t size) runBeginCallback(STRUCT_NUMBER_T); break; default: - if(util::isDigit(c)) { + if (util::isDigit(c)) { strLength_ = c - '0'; numConsumed_ = 1; currentState_ = BENCODE_STRING_LEN; runBeginCallback(STRUCT_STRING_T); break; - } else { + } + else { currentState_ = BENCODE_ERROR; return lastError_ = ERR_UNEXPECTED_CHAR_BEFORE_VAL; } } break; case BENCODE_DICT_KEY: { - if(c == 'e') { + if (c == 'e') { onDictEnd(); break; } int rv = pushState(currentState_); - if(rv < 0) { + if (rv < 0) { return rv; } strLength_ = 0; @@ -147,8 +150,8 @@ ssize_t BencodeParser::parseUpdate(const char* data, size_t size) } case BENCODE_STRING_LEN: { size_t j; - for(j = i; j < size && in(data[j], '0', '9'); ++j) { - if((INT64_MAX - (data[j] - '0'))/ 10 < strLength_) { + for (j = i; j < size && in(data[j], '0', '9'); ++j) { + if ((INT64_MAX - (data[j] - '0')) / 10 < strLength_) { currentState_ = BENCODE_ERROR; return lastError_ = ERR_STRING_LENGTH_OUT_OF_RANGE; } @@ -156,18 +159,19 @@ ssize_t BencodeParser::parseUpdate(const char* data, size_t size) strLength_ += data[j] - '0'; } numConsumed_ += j - i; - if(j != size) { - if(data[j] != ':' || numConsumed_ == 0) { + if (j != size) { + if (data[j] != ':' || numConsumed_ == 0) { currentState_ = BENCODE_ERROR; return lastError_ = ERR_INVALID_STRING_LENGTH; } i = j; currentState_ = BENCODE_STRING; - if(strLength_ == 0) { + if (strLength_ == 0) { runCharactersCallback(nullptr, 0); onStringEnd(); } - } else { + } + else { i = j - 1; } break; @@ -177,13 +181,13 @@ ssize_t BencodeParser::parseUpdate(const char* data, size_t size) runCharactersCallback(&data[i], nread); strLength_ -= nread; i += nread - 1; - if(strLength_ == 0) { + if (strLength_ == 0) { onStringEnd(); } break; } case BENCODE_NUMBER_SIGN: { - switch(c) { + switch (c) { case '+': numberSign_ = 1; currentState_ = BENCODE_NUMBER; @@ -193,7 +197,7 @@ ssize_t BencodeParser::parseUpdate(const char* data, size_t size) currentState_ = BENCODE_NUMBER; break; default: - if(util::isDigit(c)) { + if (util::isDigit(c)) { number_ = c - '0'; numConsumed_ = 1; currentState_ = BENCODE_NUMBER; @@ -203,8 +207,8 @@ ssize_t BencodeParser::parseUpdate(const char* data, size_t size) } case BENCODE_NUMBER: { size_t j; - for(j = i; j < size && in(data[j], '0', '9'); ++j) { - if((INT64_MAX - (data[j] - '0'))/ 10 < number_) { + for (j = i; j < size && in(data[j], '0', '9'); ++j) { + if ((INT64_MAX - (data[j] - '0')) / 10 < number_) { currentState_ = BENCODE_ERROR; return lastError_ = ERR_NUMBER_OUT_OF_RANGE; } @@ -212,18 +216,54 @@ ssize_t BencodeParser::parseUpdate(const char* data, size_t size) number_ += data[j] - '0'; } numConsumed_ += j - i; - if(j != size) { - if(data[j] != 'e' || numConsumed_ == 0) { + if (j != size) { + if (numConsumed_ == 0) { currentState_ = BENCODE_ERROR; return lastError_ = ERR_INVALID_NUMBER; } + + auto c = data[j]; + if (util::isDigit(c) || c == '.' || c == 'E' || c == '+' || c == '-') { + // some torrent generator adds floating point number in + // scientific notation (e.g., -1.134E+3) in integer field. + // In this case, just skip these bytes until we find 'e'. + number_ = 0; + numConsumed_ = 0; + currentState_ = BENCODE_FLOAT_NUMBER_IGNORE; + + i = j; + + break; + } + + if (c != 'e') { + currentState_ = BENCODE_ERROR; + return lastError_ = ERR_INVALID_NUMBER; + } + i = j; + onNumberEnd(); - } else { + } + else { i = j - 1; } break; } + case BENCODE_FLOAT_NUMBER_IGNORE: { + auto c = data[i]; + if (util::isDigit(c) || c == '.' || c == 'E' || c == '+' || c == '-') { + continue; + } + + if (c != 'e') { + currentState_ = BENCODE_ERROR; + return lastError_ = ERR_INVALID_FLOAT_NUMBER; + } + + onNumberEnd(); + break; + } } } return i; @@ -233,9 +273,8 @@ ssize_t BencodeParser::parseFinal(const char* data, size_t len) { ssize_t rv; rv = parseUpdate(data, len); - if(rv >= 0) { - if(currentState_ != BENCODE_FINISH && - currentState_ != BENCODE_INITIAL) { + if (rv >= 0) { + if (currentState_ != BENCODE_FINISH && currentState_ != BENCODE_INITIAL) { rv = ERR_PREMATURE_DATA; } } @@ -247,7 +286,7 @@ void BencodeParser::reset() psm_->reset(); currentState_ = BENCODE_INITIAL; lastError_ = 0; - while(!stateStack_.empty()) { + while (!stateStack_.empty()) { stateStack_.pop(); } stateStack_.push(BENCODE_FINISH); @@ -255,8 +294,8 @@ void BencodeParser::reset() void BencodeParser::onStringEnd() { - runEndCallback(stateTop() == BENCODE_DICT_KEY ? - STRUCT_DICT_KEY_T : STRUCT_STRING_T); + runEndCallback(stateTop() == BENCODE_DICT_KEY ? STRUCT_DICT_KEY_T + : STRUCT_STRING_T); onValueEnd(); } @@ -281,7 +320,7 @@ void BencodeParser::onListEnd() void BencodeParser::onValueEnd() { - switch(stateTop()) { + switch (stateTop()) { case BENCODE_DICT_KEY: popState(); pushState(BENCODE_DICT_VAL); @@ -307,18 +346,16 @@ void BencodeParser::onValueEnd() int BencodeParser::pushState(int state) { - if(stateStack_.size() >= 50) { + if (stateStack_.size() >= 50) { return ERR_STRUCTURE_TOO_DEEP; - } else { + } + else { stateStack_.push(state); return 0; } } -int BencodeParser::stateTop() const -{ - return stateStack_.top(); -} +int BencodeParser::stateTop() const { return stateStack_.top(); } int BencodeParser::popState() { diff --git a/src/BencodeParser.h b/src/BencodeParser.h index eb1c4d67..7ef697c1 100644 --- a/src/BencodeParser.h +++ b/src/BencodeParser.h @@ -52,7 +52,8 @@ enum BencodeError { ERR_PREMATURE_DATA = -4, ERR_STRUCTURE_TOO_DEEP = -5, ERR_INVALID_STRING_LENGTH = -6, - ERR_STRING_LENGTH_OUT_OF_RANGE = -7 + ERR_STRING_LENGTH_OUT_OF_RANGE = -7, + ERR_INVALID_FLOAT_NUMBER = -8, }; class BencodeParser { @@ -72,6 +73,7 @@ public: // Resets the internal state of the parser and makes it ready for // reuse. void reset(); + private: int pushState(int state); int stateTop() const; diff --git a/src/BitfieldMan.cc b/src/BitfieldMan.cc index 4432253d..0a47b1a8 100644 --- a/src/BitfieldMan.cc +++ b/src/BitfieldMan.cc @@ -45,23 +45,23 @@ using namespace aria2::expr; namespace aria2 { BitfieldMan::BitfieldMan(int32_t blockLength, int64_t totalLength) - : totalLength_(totalLength), - cachedCompletedLength_(0), - cachedFilteredCompletedLength_(0), - cachedFilteredTotalLength_(0), - bitfield_(nullptr), - useBitfield_(nullptr), - filterBitfield_(nullptr), - bitfieldLength_(0), - cachedNumMissingBlock_(0), - cachedNumFilteredBlock_(0), - blocks_(0), - blockLength_(blockLength), - filterEnabled_(false) + : totalLength_(totalLength), + cachedCompletedLength_(0), + cachedFilteredCompletedLength_(0), + cachedFilteredTotalLength_(0), + bitfield_(nullptr), + useBitfield_(nullptr), + filterBitfield_(nullptr), + bitfieldLength_(0), + cachedNumMissingBlock_(0), + cachedNumFilteredBlock_(0), + blocks_(0), + blockLength_(blockLength), + filterEnabled_(false) { - if(blockLength_ > 0 && totalLength_ > 0) { - blocks_ = (totalLength_+blockLength_-1)/blockLength_; - bitfieldLength_ = blocks_/8+(blocks_%8 ? 1 : 0); + if (blockLength_ > 0 && totalLength_ > 0) { + blocks_ = (totalLength_ + blockLength_ - 1) / blockLength_; + bitfieldLength_ = blocks_ / 8 + (blocks_ % 8 ? 1 : 0); bitfield_ = new unsigned char[bitfieldLength_]; useBitfield_ = new unsigned char[bitfieldLength_]; memset(bitfield_, 0, bitfieldLength_); @@ -71,23 +71,23 @@ BitfieldMan::BitfieldMan(int32_t blockLength, int64_t totalLength) } BitfieldMan::BitfieldMan(const BitfieldMan& bitfieldMan) - : totalLength_(bitfieldMan.totalLength_), - cachedCompletedLength_(0), - cachedFilteredCompletedLength_(0), - cachedFilteredTotalLength_(0), - bitfield_(new unsigned char[bitfieldMan.bitfieldLength_]), - useBitfield_(new unsigned char[bitfieldMan.bitfieldLength_]), - filterBitfield_(nullptr), - bitfieldLength_(bitfieldMan.bitfieldLength_), - cachedNumMissingBlock_(0), - cachedNumFilteredBlock_(0), - blocks_(bitfieldMan.blocks_), - blockLength_(bitfieldMan.blockLength_), - filterEnabled_(bitfieldMan.filterEnabled_) + : totalLength_(bitfieldMan.totalLength_), + cachedCompletedLength_(0), + cachedFilteredCompletedLength_(0), + cachedFilteredTotalLength_(0), + bitfield_(new unsigned char[bitfieldMan.bitfieldLength_]), + useBitfield_(new unsigned char[bitfieldMan.bitfieldLength_]), + filterBitfield_(nullptr), + bitfieldLength_(bitfieldMan.bitfieldLength_), + cachedNumMissingBlock_(0), + cachedNumFilteredBlock_(0), + blocks_(bitfieldMan.blocks_), + blockLength_(bitfieldMan.blockLength_), + filterEnabled_(bitfieldMan.filterEnabled_) { memcpy(bitfield_, bitfieldMan.bitfield_, bitfieldLength_); memcpy(useBitfield_, bitfieldMan.useBitfield_, bitfieldLength_); - if(filterEnabled_) { + if (filterEnabled_) { filterBitfield_ = new unsigned char[bitfieldLength_]; memcpy(filterBitfield_, bitfieldMan.filterBitfield_, bitfieldLength_); } @@ -96,26 +96,27 @@ BitfieldMan::BitfieldMan(const BitfieldMan& bitfieldMan) BitfieldMan& BitfieldMan::operator=(const BitfieldMan& bitfieldMan) { - if(this != &bitfieldMan) { + if (this != &bitfieldMan) { totalLength_ = bitfieldMan.totalLength_; blockLength_ = bitfieldMan.blockLength_; blocks_ = bitfieldMan.blocks_; bitfieldLength_ = bitfieldMan.bitfieldLength_; filterEnabled_ = bitfieldMan.filterEnabled_; - delete [] bitfield_; + delete[] bitfield_; bitfield_ = new unsigned char[bitfieldLength_]; memcpy(bitfield_, bitfieldMan.bitfield_, bitfieldLength_); - delete [] useBitfield_; + delete[] useBitfield_; useBitfield_ = new unsigned char[bitfieldLength_]; memcpy(useBitfield_, bitfieldMan.useBitfield_, bitfieldLength_); - delete [] filterBitfield_; - if(filterEnabled_) { + delete[] filterBitfield_; + if (filterEnabled_) { filterBitfield_ = new unsigned char[bitfieldLength_]; memcpy(filterBitfield_, bitfieldMan.filterBitfield_, bitfieldLength_); - } else { + } + else { filterBitfield_ = nullptr; } @@ -124,41 +125,44 @@ BitfieldMan& BitfieldMan::operator=(const BitfieldMan& bitfieldMan) return *this; } -BitfieldMan::~BitfieldMan() { - delete [] bitfield_; - delete [] useBitfield_; - delete [] filterBitfield_; +BitfieldMan::~BitfieldMan() +{ + delete[] bitfield_; + delete[] useBitfield_; + delete[] filterBitfield_; } int32_t BitfieldMan::getLastBlockLength() const { - return totalLength_-blockLength_*(blocks_-1); + return totalLength_ - blockLength_ * (blocks_ - 1); } int32_t BitfieldMan::getBlockLength(size_t index) const { - if(index == blocks_-1) { + if (index == blocks_ - 1) { return getLastBlockLength(); - } else if(index < blocks_-1) { + } + else if (index < blocks_ - 1) { return getBlockLength(); - } else { + } + else { return 0; } } -bool BitfieldMan::hasMissingPiece -(const unsigned char* peerBitfield, size_t length) const +bool BitfieldMan::hasMissingPiece(const unsigned char* peerBitfield, + size_t length) const { - if(bitfieldLength_ != length) { + if (bitfieldLength_ != length) { return false; } bool retval = false; - for(size_t i = 0; i < bitfieldLength_; ++i) { + for (size_t i = 0; i < bitfieldLength_; ++i) { unsigned char temp = peerBitfield[i] & ~bitfield_[i]; - if(filterEnabled_) { + if (filterEnabled_) { temp &= filterBitfield_[i]; } - if(temp&0xffu) { + if (temp & 0xffu) { retval = true; break; } @@ -168,58 +172,66 @@ bool BitfieldMan::hasMissingPiece bool BitfieldMan::getFirstMissingUnusedIndex(size_t& index) const { - if(filterEnabled_) { - return bitfield::getFirstSetBitIndex - (index, ~array(bitfield_)&~array(useBitfield_)&array(filterBitfield_), - blocks_); - } else { - return bitfield::getFirstSetBitIndex - (index, ~array(bitfield_)&~array(useBitfield_), blocks_); + if (filterEnabled_) { + return bitfield::getFirstSetBitIndex(index, ~array(bitfield_) & + ~array(useBitfield_) & + array(filterBitfield_), + blocks_); + } + else { + return bitfield::getFirstSetBitIndex( + index, ~array(bitfield_) & ~array(useBitfield_), blocks_); } } -size_t BitfieldMan::getFirstNMissingUnusedIndex -(std::vector& out, size_t n) const +size_t BitfieldMan::getFirstNMissingUnusedIndex(std::vector& out, + size_t n) const { - if(filterEnabled_) { - return bitfield::getFirstNSetBitIndex - (std::back_inserter(out), n, - ~array(bitfield_)&~array(useBitfield_)&array(filterBitfield_), blocks_); - } else { - return bitfield::getFirstNSetBitIndex - (std::back_inserter(out), n, - ~array(bitfield_)&~array(useBitfield_), blocks_); + if (filterEnabled_) { + return bitfield::getFirstNSetBitIndex( + std::back_inserter(out), n, + ~array(bitfield_) & ~array(useBitfield_) & array(filterBitfield_), + blocks_); + } + else { + return bitfield::getFirstNSetBitIndex( + std::back_inserter(out), n, ~array(bitfield_) & ~array(useBitfield_), + blocks_); } } bool BitfieldMan::getFirstMissingIndex(size_t& index) const { - if(filterEnabled_) { - return bitfield::getFirstSetBitIndex - (index, ~array(bitfield_)&array(filterBitfield_), blocks_); - } else { + if (filterEnabled_) { + return bitfield::getFirstSetBitIndex( + index, ~array(bitfield_) & array(filterBitfield_), blocks_); + } + else { return bitfield::getFirstSetBitIndex(index, ~array(bitfield_), blocks_); } } namespace { -template -size_t getStartIndex(size_t index, const Array& bitfield, size_t blocks) { - while(index < blocks && bitfield::test(bitfield, blocks, index)) { +template +size_t getStartIndex(size_t index, const Array& bitfield, size_t blocks) +{ + while (index < blocks && bitfield::test(bitfield, blocks, index)) { ++index; } - if(blocks <= index) { + if (blocks <= index) { return blocks; - } else { + } + else { return index; } } } // namespace namespace { -template -size_t getEndIndex(size_t index, const Array& bitfield, size_t blocks) { - while(index < blocks && !bitfield::test(bitfield, blocks, index)) { +template +size_t getEndIndex(size_t index, const Array& bitfield, size_t blocks) +{ + while (index < blocks && !bitfield::test(bitfield, blocks, index)) { ++index; } return index; @@ -227,194 +239,180 @@ size_t getEndIndex(size_t index, const Array& bitfield, size_t blocks) { } // namespace namespace { -template -bool getSparseMissingUnusedIndex -(size_t& index, - int32_t minSplitSize, - const Array& bitfield, - const unsigned char* useBitfield, - int32_t blockLength, - size_t blocks) +template +bool getSparseMissingUnusedIndex(size_t& index, int32_t minSplitSize, + const Array& bitfield, + const unsigned char* useBitfield, + int32_t blockLength, size_t blocks) { BitfieldMan::Range maxRange; BitfieldMan::Range currentRange; size_t nextIndex = 0; - while(nextIndex < blocks) { - currentRange.startIndex = - getStartIndex(nextIndex, bitfield, blocks); - if(currentRange.startIndex == blocks) { + while (nextIndex < blocks) { + currentRange.startIndex = getStartIndex(nextIndex, bitfield, blocks); + if (currentRange.startIndex == blocks) { break; } currentRange.endIndex = - getEndIndex(currentRange.startIndex, bitfield, blocks); + getEndIndex(currentRange.startIndex, bitfield, blocks); - if(currentRange.startIndex > 0) { - if(bitfield::test(useBitfield, blocks, currentRange.startIndex-1)) { + if (currentRange.startIndex > 0) { + if (bitfield::test(useBitfield, blocks, currentRange.startIndex - 1)) { currentRange.startIndex = currentRange.getMidIndex(); } } // If range is equal, choose a range where its startIndex-1 is // set. - if(maxRange < currentRange || - (maxRange == currentRange && - maxRange.startIndex > 0 && currentRange.startIndex > 0 && - (!bitfield::test(bitfield, blocks, maxRange.startIndex-1) || - bitfield::test(useBitfield, blocks, maxRange.startIndex-1)) - && - bitfield::test(bitfield, blocks, currentRange.startIndex-1) && - !bitfield::test(useBitfield, blocks, currentRange.startIndex-1))) { + if (maxRange < currentRange || + (maxRange == currentRange && maxRange.startIndex > 0 && + currentRange.startIndex > 0 && + (!bitfield::test(bitfield, blocks, maxRange.startIndex - 1) || + bitfield::test(useBitfield, blocks, maxRange.startIndex - 1)) && + bitfield::test(bitfield, blocks, currentRange.startIndex - 1) && + !bitfield::test(useBitfield, blocks, currentRange.startIndex - 1))) { maxRange = currentRange; } nextIndex = currentRange.endIndex; - } - if(maxRange.getSize()) { - if(maxRange.startIndex == 0) { + if (maxRange.getSize()) { + if (maxRange.startIndex == 0) { index = 0; return true; - } else { - if((!bitfield::test(useBitfield, blocks, maxRange.startIndex-1) && - bitfield::test(bitfield, blocks, maxRange.startIndex-1)) || - (static_cast(maxRange.endIndex-maxRange.startIndex)* - blockLength >= minSplitSize)) { + } + else { + if ((!bitfield::test(useBitfield, blocks, maxRange.startIndex - 1) && + bitfield::test(bitfield, blocks, maxRange.startIndex - 1)) || + (static_cast(maxRange.endIndex - maxRange.startIndex) * + blockLength >= + minSplitSize)) { index = maxRange.startIndex; return true; - } else { + } + else { return false; } } - } else { + } + else { return false; } } } // namespace -bool BitfieldMan::getSparseMissingUnusedIndex -(size_t& index, - int32_t minSplitSize, - const unsigned char* ignoreBitfield, - size_t ignoreBitfieldLength) const +bool BitfieldMan::getSparseMissingUnusedIndex( + size_t& index, int32_t minSplitSize, const unsigned char* ignoreBitfield, + size_t ignoreBitfieldLength) const { - if(filterEnabled_) { - return aria2::getSparseMissingUnusedIndex - (index, minSplitSize, - array(ignoreBitfield)|~array(filterBitfield_)| - array(bitfield_)|array(useBitfield_), - useBitfield_, blockLength_, blocks_); - } else { - return aria2::getSparseMissingUnusedIndex - (index, minSplitSize, - array(ignoreBitfield)|array(bitfield_)|array(useBitfield_), - useBitfield_, blockLength_, blocks_); + if (filterEnabled_) { + return aria2::getSparseMissingUnusedIndex( + index, minSplitSize, array(ignoreBitfield) | ~array(filterBitfield_) | + array(bitfield_) | array(useBitfield_), + useBitfield_, blockLength_, blocks_); + } + else { + return aria2::getSparseMissingUnusedIndex( + index, minSplitSize, + array(ignoreBitfield) | array(bitfield_) | array(useBitfield_), + useBitfield_, blockLength_, blocks_); } } namespace { -template -bool getGeomMissingUnusedIndex -(size_t& index, - int32_t minSplitSize, - const Array& bitfield, - const unsigned char* useBitfield, - int32_t blockLength, - size_t blocks, - double base, - size_t offsetIndex) +template +bool getGeomMissingUnusedIndex(size_t& index, int32_t minSplitSize, + const Array& bitfield, + const unsigned char* useBitfield, + int32_t blockLength, size_t blocks, double base, + size_t offsetIndex) { double start = 0; double end = 1; - while(start+offsetIndex < blocks) { + while (start + offsetIndex < blocks) { index = blocks; - for(size_t i = start+offsetIndex, - eoi = std::min(blocks, static_cast(end+offsetIndex)); - i < eoi; ++i) { - if(bitfield::test(useBitfield, blocks, i)) { + for (size_t i = start + offsetIndex, + eoi = std::min(blocks, static_cast(end + offsetIndex)); + i < eoi; ++i) { + if (bitfield::test(useBitfield, blocks, i)) { break; - } else if(!bitfield::test(bitfield, blocks, i)) { + } + else if (!bitfield::test(bitfield, blocks, i)) { index = i; break; } } - if(index < blocks) { + if (index < blocks) { return true; - } else { + } + else { start = end; end *= base; } } - return getSparseMissingUnusedIndex(index, minSplitSize, - bitfield, useBitfield, + return getSparseMissingUnusedIndex(index, minSplitSize, bitfield, useBitfield, blockLength, blocks); } } // namespace -bool BitfieldMan::getGeomMissingUnusedIndex -(size_t& index, - int32_t minSplitSize, - const unsigned char* ignoreBitfield, - size_t ignoreBitfieldLength, - double base, - size_t offsetIndex) const +bool BitfieldMan::getGeomMissingUnusedIndex(size_t& index, int32_t minSplitSize, + const unsigned char* ignoreBitfield, + size_t ignoreBitfieldLength, + double base, + size_t offsetIndex) const { - if(filterEnabled_) { - return aria2::getGeomMissingUnusedIndex - (index, minSplitSize, - array(ignoreBitfield)|~array(filterBitfield_)| - array(bitfield_)|array(useBitfield_), - useBitfield_, blockLength_, blocks_, - base, offsetIndex); - } else { - return aria2::getGeomMissingUnusedIndex - (index, minSplitSize, - array(ignoreBitfield)|array(bitfield_)|array(useBitfield_), - useBitfield_, blockLength_, blocks_, - base, offsetIndex); + if (filterEnabled_) { + return aria2::getGeomMissingUnusedIndex( + index, minSplitSize, array(ignoreBitfield) | ~array(filterBitfield_) | + array(bitfield_) | array(useBitfield_), + useBitfield_, blockLength_, blocks_, base, offsetIndex); + } + else { + return aria2::getGeomMissingUnusedIndex( + index, minSplitSize, + array(ignoreBitfield) | array(bitfield_) | array(useBitfield_), + useBitfield_, blockLength_, blocks_, base, offsetIndex); } } namespace { -template -bool getInorderMissingUnusedIndex -(size_t& index, - size_t startIndex, - size_t lastIndex, - int32_t minSplitSize, - const Array& bitfield, - const unsigned char* useBitfield, - int32_t blockLength, - size_t blocks) +template +bool getInorderMissingUnusedIndex(size_t& index, size_t startIndex, + size_t lastIndex, int32_t minSplitSize, + const Array& bitfield, + const unsigned char* useBitfield, + int32_t blockLength, size_t blocks) { // We always return first piece if it is available. - if(!bitfield::test(bitfield, blocks, startIndex) && - !bitfield::test(useBitfield, blocks, startIndex)) { + if (!bitfield::test(bitfield, blocks, startIndex) && + !bitfield::test(useBitfield, blocks, startIndex)) { index = startIndex; return true; } - for(size_t i = startIndex + 1; i < lastIndex;) { - if(!bitfield::test(bitfield, blocks, i) && - !bitfield::test(useBitfield, blocks, i)) { + for (size_t i = startIndex + 1; i < lastIndex;) { + if (!bitfield::test(bitfield, blocks, i) && + !bitfield::test(useBitfield, blocks, i)) { // If previous piece has already been retrieved, we can download // from this index. - if(!bitfield::test(useBitfield, blocks, i-1) && - bitfield::test(bitfield, blocks, i-1)) { + if (!bitfield::test(useBitfield, blocks, i - 1) && + bitfield::test(bitfield, blocks, i - 1)) { index = i; return true; } // Check free space of minSplitSize. When checking this, we use // blocks instead of lastIndex. size_t j; - for(j = i; j < blocks; ++j) { - if(bitfield::test(bitfield, blocks, j) || - bitfield::test(useBitfield, blocks, j)) { + for (j = i; j < blocks; ++j) { + if (bitfield::test(bitfield, blocks, j) || + bitfield::test(useBitfield, blocks, j)) { break; } - if(static_cast(j-i+1)*blockLength >= minSplitSize) { + if (static_cast(j - i + 1) * blockLength >= minSplitSize) { index = j; return true; } } - i = j+1; - } else { + i = j + 1; + } + else { ++i; } } @@ -422,73 +420,70 @@ bool getInorderMissingUnusedIndex } } // namespace -bool BitfieldMan::getInorderMissingUnusedIndex -(size_t& index, - int32_t minSplitSize, - const unsigned char* ignoreBitfield, - size_t ignoreBitfieldLength) const +bool BitfieldMan::getInorderMissingUnusedIndex( + size_t& index, int32_t minSplitSize, const unsigned char* ignoreBitfield, + size_t ignoreBitfieldLength) const { - if(filterEnabled_) { - return aria2::getInorderMissingUnusedIndex - (index, 0, blocks_, minSplitSize, - array(ignoreBitfield)|~array(filterBitfield_)| - array(bitfield_)|array(useBitfield_), - useBitfield_, blockLength_, blocks_); - } else { - return aria2::getInorderMissingUnusedIndex - (index, 0, blocks_, minSplitSize, - array(ignoreBitfield)|array(bitfield_)|array(useBitfield_), - useBitfield_, blockLength_, blocks_); + if (filterEnabled_) { + return aria2::getInorderMissingUnusedIndex( + index, 0, blocks_, minSplitSize, + array(ignoreBitfield) | ~array(filterBitfield_) | array(bitfield_) | + array(useBitfield_), + useBitfield_, blockLength_, blocks_); + } + else { + return aria2::getInorderMissingUnusedIndex( + index, 0, blocks_, minSplitSize, + array(ignoreBitfield) | array(bitfield_) | array(useBitfield_), + useBitfield_, blockLength_, blocks_); } } -bool BitfieldMan::getInorderMissingUnusedIndex -(size_t& index, - size_t startIndex, - size_t endIndex, - int32_t minSplitSize, - const unsigned char* ignoreBitfield, - size_t ignoreBitfieldLength) const +bool BitfieldMan::getInorderMissingUnusedIndex( + size_t& index, size_t startIndex, size_t endIndex, int32_t minSplitSize, + const unsigned char* ignoreBitfield, size_t ignoreBitfieldLength) const { endIndex = std::min(endIndex, blocks_); - if(filterEnabled_) { - return aria2::getInorderMissingUnusedIndex - (index, startIndex, endIndex, minSplitSize, - array(ignoreBitfield)|~array(filterBitfield_)| - array(bitfield_)|array(useBitfield_), - useBitfield_, blockLength_, blocks_); - } else { - return aria2::getInorderMissingUnusedIndex - (index, startIndex, endIndex, minSplitSize, - array(ignoreBitfield)|array(bitfield_)|array(useBitfield_), - useBitfield_, blockLength_, blocks_); + if (filterEnabled_) { + return aria2::getInorderMissingUnusedIndex( + index, startIndex, endIndex, minSplitSize, + array(ignoreBitfield) | ~array(filterBitfield_) | array(bitfield_) | + array(useBitfield_), + useBitfield_, blockLength_, blocks_); + } + else { + return aria2::getInorderMissingUnusedIndex( + index, startIndex, endIndex, minSplitSize, + array(ignoreBitfield) | array(bitfield_) | array(useBitfield_), + useBitfield_, blockLength_, blocks_); } } namespace { -template +template bool copyBitfield(unsigned char* dst, const Array& src, size_t blocks) { unsigned char bits = 0; - size_t len = (blocks+7)/8; - for(size_t i = 0; i < len-1; ++i) { + size_t len = (blocks + 7) / 8; + for (size_t i = 0; i < len - 1; ++i) { dst[i] = src[i]; bits |= dst[i]; } - dst[len-1] = src[len-1]&bitfield::lastByteMask(blocks); - bits |= dst[len-1]; + dst[len - 1] = src[len - 1] & bitfield::lastByteMask(blocks); + bits |= dst[len - 1]; return bits != 0; } } // namespace -bool BitfieldMan::getAllMissingIndexes(unsigned char* misbitfield, size_t len) - const +bool BitfieldMan::getAllMissingIndexes(unsigned char* misbitfield, + size_t len) const { assert(len == bitfieldLength_); - if(filterEnabled_) { - return copyBitfield - (misbitfield, ~array(bitfield_)&array(filterBitfield_), blocks_); - } else { + if (filterEnabled_) { + return copyBitfield(misbitfield, ~array(bitfield_) & array(filterBitfield_), + blocks_); + } + else { return copyBitfield(misbitfield, ~array(bitfield_), blocks_); } } @@ -498,18 +493,17 @@ bool BitfieldMan::getAllMissingIndexes(unsigned char* misbitfield, size_t len, size_t peerBitfieldLength) const { assert(len == bitfieldLength_); - if(bitfieldLength_ != peerBitfieldLength) { + if (bitfieldLength_ != peerBitfieldLength) { return false; } - if(filterEnabled_) { - return copyBitfield - (misbitfield, - ~array(bitfield_)&array(peerBitfield)&array(filterBitfield_), - blocks_); - } else { - return copyBitfield - (misbitfield, ~array(bitfield_)&array(peerBitfield), - blocks_); + if (filterEnabled_) { + return copyBitfield(misbitfield, ~array(bitfield_) & array(peerBitfield) & + array(filterBitfield_), + blocks_); + } + else { + return copyBitfield(misbitfield, ~array(bitfield_) & array(peerBitfield), + blocks_); } } @@ -519,102 +513,112 @@ bool BitfieldMan::getAllMissingUnusedIndexes(unsigned char* misbitfield, size_t peerBitfieldLength) const { assert(len == bitfieldLength_); - if(bitfieldLength_ != peerBitfieldLength) { + if (bitfieldLength_ != peerBitfieldLength) { return false; } - if(filterEnabled_) { - return copyBitfield - (misbitfield, - ~array(bitfield_)&~array(useBitfield_)&array(peerBitfield)& - array(filterBitfield_), - blocks_); - } else { - return copyBitfield - (misbitfield, - ~array(bitfield_)&~array(useBitfield_)&array(peerBitfield), - blocks_); + if (filterEnabled_) { + return copyBitfield(misbitfield, + ~array(bitfield_) & ~array(useBitfield_) & + array(peerBitfield) & array(filterBitfield_), + blocks_); + } + else { + return copyBitfield(misbitfield, ~array(bitfield_) & ~array(useBitfield_) & + array(peerBitfield), + blocks_); } } -size_t BitfieldMan::countMissingBlock() const { - return cachedNumMissingBlock_; -} +size_t BitfieldMan::countMissingBlock() const { return cachedNumMissingBlock_; } -size_t BitfieldMan::countMissingBlockNow() const { - if(filterEnabled_) { +size_t BitfieldMan::countMissingBlockNow() const +{ + if (filterEnabled_) { return bitfield::countSetBit(filterBitfield_, blocks_) - - bitfield::countSetBitSlow(array(bitfield_)&array(filterBitfield_), - blocks_); - } else { - return blocks_-bitfield::countSetBit(bitfield_, blocks_); + bitfield::countSetBitSlow(array(bitfield_) & array(filterBitfield_), + blocks_); + } + else { + return blocks_ - bitfield::countSetBit(bitfield_, blocks_); } } -size_t BitfieldMan::countFilteredBlockNow() const { - if(filterEnabled_) { +size_t BitfieldMan::countFilteredBlockNow() const +{ + if (filterEnabled_) { return bitfield::countSetBit(filterBitfield_, blocks_); - } else { + } + else { return 0; } } -bool BitfieldMan::setBitInternal(unsigned char* bitfield, size_t index, bool on) { - if(blocks_ <= index) { return false; } - unsigned char mask = 128 >> (index%8); - if(on) { - bitfield[index/8] |= mask; - } else { - bitfield[index/8] &= ~mask; +bool BitfieldMan::setBitInternal(unsigned char* bitfield, size_t index, bool on) +{ + if (blocks_ <= index) { + return false; + } + unsigned char mask = 128 >> (index % 8); + if (on) { + bitfield[index / 8] |= mask; + } + else { + bitfield[index / 8] &= ~mask; } return true; } -bool BitfieldMan::setUseBit(size_t index) { +bool BitfieldMan::setUseBit(size_t index) +{ return setBitInternal(useBitfield_, index, true); } -bool BitfieldMan::unsetUseBit(size_t index) { +bool BitfieldMan::unsetUseBit(size_t index) +{ return setBitInternal(useBitfield_, index, false); } -bool BitfieldMan::setBit(size_t index) { +bool BitfieldMan::setBit(size_t index) +{ bool b = setBitInternal(bitfield_, index, true); updateCache(); return b; } -bool BitfieldMan::unsetBit(size_t index) { +bool BitfieldMan::unsetBit(size_t index) +{ bool b = setBitInternal(bitfield_, index, false); updateCache(); return b; } -bool BitfieldMan::isFilteredAllBitSet() const { - if(filterEnabled_) { - for(size_t i = 0; i < bitfieldLength_; ++i) { - if((bitfield_[i]&filterBitfield_[i]) != filterBitfield_[i]) { +bool BitfieldMan::isFilteredAllBitSet() const +{ + if (filterEnabled_) { + for (size_t i = 0; i < bitfieldLength_; ++i) { + if ((bitfield_[i] & filterBitfield_[i]) != filterBitfield_[i]) { return false; } } return true; - } else { + } + else { return isAllBitSet(); } } namespace { -bool testAllBitSet -(const unsigned char* bitfield, size_t length, size_t blocks) +bool testAllBitSet(const unsigned char* bitfield, size_t length, size_t blocks) { - if(length == 0) { + if (length == 0) { return true; } - for(size_t i = 0; i < length-1; ++i) { - if(bitfield[i] != 0xffu) { + for (size_t i = 0; i < length - 1; ++i) { + if (bitfield[i] != 0xffu) { return false; } } - return bitfield[length-1] == bitfield::lastByteMask(blocks); + return bitfield[length - 1] == bitfield::lastByteMask(blocks); } } // namespace @@ -625,16 +629,18 @@ bool BitfieldMan::isAllBitSet() const bool BitfieldMan::isAllFilterBitSet() const { - if(!filterBitfield_) { + if (!filterBitfield_) { return false; } return testAllBitSet(filterBitfield_, bitfieldLength_, blocks_); } -bool BitfieldMan::isFilterBitSet(size_t index) const { - if(filterBitfield_) { +bool BitfieldMan::isFilterBitSet(size_t index) const +{ + if (filterBitfield_) { return bitfield::test(filterBitfield_, blocks_, index); - } else { + } + else { return false; } } @@ -649,8 +655,10 @@ bool BitfieldMan::isUseBitSet(size_t index) const return bitfield::test(useBitfield_, blocks_, index); } -void BitfieldMan::setBitfield(const unsigned char* bitfield, size_t bitfieldLength) { - if(bitfieldLength_ != bitfieldLength) { +void BitfieldMan::setBitfield(const unsigned char* bitfield, + size_t bitfieldLength) +{ + if (bitfieldLength_ != bitfieldLength) { return; } memcpy(bitfield_, bitfield, bitfieldLength_); @@ -658,59 +666,66 @@ void BitfieldMan::setBitfield(const unsigned char* bitfield, size_t bitfieldLeng updateCache(); } -void BitfieldMan::clearAllBit() { +void BitfieldMan::clearAllBit() +{ memset(bitfield_, 0, bitfieldLength_); updateCache(); } -void BitfieldMan::setAllBit() { - for(size_t i = 0; i < blocks_; ++i) { +void BitfieldMan::setAllBit() +{ + for (size_t i = 0; i < blocks_; ++i) { setBitInternal(bitfield_, i, true); } updateCache(); } -void BitfieldMan::clearAllUseBit() { +void BitfieldMan::clearAllUseBit() +{ memset(useBitfield_, 0, bitfieldLength_); updateCache(); } -void BitfieldMan::setAllUseBit() { - for(size_t i = 0; i < blocks_; ++i) { +void BitfieldMan::setAllUseBit() +{ + for (size_t i = 0; i < blocks_; ++i) { setBitInternal(useBitfield_, i, true); } } -bool BitfieldMan::setFilterBit(size_t index) { +bool BitfieldMan::setFilterBit(size_t index) +{ return setBitInternal(filterBitfield_, index, true); } void BitfieldMan::ensureFilterBitfield() { - if(!filterBitfield_) { + if (!filterBitfield_) { filterBitfield_ = new unsigned char[bitfieldLength_]; memset(filterBitfield_, 0, bitfieldLength_); } } -void BitfieldMan::addFilter(int64_t offset, int64_t length) { +void BitfieldMan::addFilter(int64_t offset, int64_t length) +{ ensureFilterBitfield(); - if(length > 0) { - size_t startBlock = offset/blockLength_; - size_t endBlock = (offset+length-1)/blockLength_; - for(size_t i = startBlock; i <= endBlock && i < blocks_; i++) { + if (length > 0) { + size_t startBlock = offset / blockLength_; + size_t endBlock = (offset + length - 1) / blockLength_; + for (size_t i = startBlock; i <= endBlock && i < blocks_; i++) { setFilterBit(i); } } updateCache(); } -void BitfieldMan::removeFilter(int64_t offset, int64_t length) { +void BitfieldMan::removeFilter(int64_t offset, int64_t length) +{ ensureFilterBitfield(); - if(length > 0) { - size_t startBlock = offset/blockLength_; - size_t endBlock = (offset+length-1)/blockLength_; - for(size_t i = startBlock; i <= endBlock && i < blocks_; i++) { + if (length > 0) { + size_t startBlock = offset / blockLength_; + size_t endBlock = (offset + length - 1) / blockLength_; + for (size_t i = startBlock; i <= endBlock && i < blocks_; i++) { setBitInternal(filterBitfield_, i, false); } } @@ -720,96 +735,106 @@ void BitfieldMan::removeFilter(int64_t offset, int64_t length) { void BitfieldMan::addNotFilter(int64_t offset, int64_t length) { ensureFilterBitfield(); - if(length > 0 && blocks_ > 0) { - size_t startBlock = offset/blockLength_; - if(blocks_ <= startBlock) { + if (length > 0 && blocks_ > 0) { + size_t startBlock = offset / blockLength_; + if (blocks_ <= startBlock) { startBlock = blocks_; } - size_t endBlock = (offset+length-1)/blockLength_; - for(size_t i = 0; i < startBlock; ++i) { + size_t endBlock = (offset + length - 1) / blockLength_; + for (size_t i = 0; i < startBlock; ++i) { setFilterBit(i); } - for(size_t i = endBlock+1; i < blocks_; ++i) { + for (size_t i = endBlock + 1; i < blocks_; ++i) { setFilterBit(i); } } updateCache(); } -void BitfieldMan::enableFilter() { +void BitfieldMan::enableFilter() +{ ensureFilterBitfield(); filterEnabled_ = true; updateCache(); } -void BitfieldMan::disableFilter() { +void BitfieldMan::disableFilter() +{ filterEnabled_ = false; updateCache(); } -void BitfieldMan::clearFilter() { - if(filterBitfield_) { - delete [] filterBitfield_; +void BitfieldMan::clearFilter() +{ + if (filterBitfield_) { + delete[] filterBitfield_; filterBitfield_ = nullptr; } filterEnabled_ = false; updateCache(); } -int64_t BitfieldMan::getFilteredTotalLengthNow() const { - if(!filterBitfield_) { +int64_t BitfieldMan::getFilteredTotalLengthNow() const +{ + if (!filterBitfield_) { return 0; } size_t filteredBlocks = bitfield::countSetBit(filterBitfield_, blocks_); - if(filteredBlocks == 0) { + if (filteredBlocks == 0) { return 0; } - if(bitfield::test(filterBitfield_, blocks_, blocks_-1)) { - return ((int64_t)filteredBlocks-1)*blockLength_+getLastBlockLength(); - } else { - return ((int64_t)filteredBlocks)*blockLength_; + if (bitfield::test(filterBitfield_, blocks_, blocks_ - 1)) { + return ((int64_t)filteredBlocks - 1) * blockLength_ + getLastBlockLength(); + } + else { + return ((int64_t)filteredBlocks) * blockLength_; } } namespace { -template -int64_t computeCompletedLength(const Array& bitfield, - const BitfieldMan* btman, +template +int64_t computeCompletedLength(const Array& bitfield, const BitfieldMan* btman, CountFun cntfun) { size_t nbits = btman->countBlock(); size_t completedBlocks = cntfun(bitfield, nbits); int64_t completedLength = 0; - if(completedBlocks == 0) { + if (completedBlocks == 0) { completedLength = 0; - } else { - if(bitfield::test(bitfield, nbits, nbits - 1)) { - completedLength = ((int64_t)completedBlocks-1)*btman->getBlockLength() + - btman->getLastBlockLength(); - } else { - completedLength = ((int64_t)completedBlocks)*btman->getBlockLength(); + } + else { + if (bitfield::test(bitfield, nbits, nbits - 1)) { + completedLength = + ((int64_t)completedBlocks - 1) * btman->getBlockLength() + + btman->getLastBlockLength(); + } + else { + completedLength = ((int64_t)completedBlocks) * btman->getBlockLength(); } } return completedLength; } } // namespace -int64_t BitfieldMan::getCompletedLength(bool useFilter) const { - if(useFilter && filterEnabled_) { - auto arr = array(bitfield_)&array(filterBitfield_); - return computeCompletedLength(arr, - this, +int64_t BitfieldMan::getCompletedLength(bool useFilter) const +{ + if (useFilter && filterEnabled_) { + auto arr = array(bitfield_) & array(filterBitfield_); + return computeCompletedLength(arr, this, &bitfield::countSetBitSlow); - } else { + } + else { return computeCompletedLength(bitfield_, this, &bitfield::countSetBit); } } -int64_t BitfieldMan::getCompletedLengthNow() const { +int64_t BitfieldMan::getCompletedLengthNow() const +{ return getCompletedLength(false); } -int64_t BitfieldMan::getFilteredCompletedLengthNow() const { +int64_t BitfieldMan::getFilteredCompletedLengthNow() const +{ return getCompletedLength(true); } @@ -824,8 +849,8 @@ void BitfieldMan::updateCache() bool BitfieldMan::isBitRangeSet(size_t startIndex, size_t endIndex) const { - for(size_t i = startIndex; i <= endIndex; ++i) { - if(!isBitSet(i)) { + for (size_t i = startIndex; i <= endIndex; ++i) { + if (!isBitSet(i)) { return false; } } @@ -834,7 +859,7 @@ bool BitfieldMan::isBitRangeSet(size_t startIndex, size_t endIndex) const void BitfieldMan::unsetBitRange(size_t startIndex, size_t endIndex) { - for(size_t i = startIndex; i <= endIndex; ++i) { + for (size_t i = startIndex; i <= endIndex; ++i) { unsetBit(i); } updateCache(); @@ -842,7 +867,7 @@ void BitfieldMan::unsetBitRange(size_t startIndex, size_t endIndex) void BitfieldMan::setBitRange(size_t startIndex, size_t endIndex) { - for(size_t i = startIndex; i <= endIndex; ++i) { + for (size_t i = startIndex; i <= endIndex; ++i) { setBit(i); } updateCache(); @@ -850,53 +875,53 @@ void BitfieldMan::setBitRange(size_t startIndex, size_t endIndex) bool BitfieldMan::isBitSetOffsetRange(int64_t offset, int64_t length) const { - if(length <= 0) { + if (length <= 0) { return false; } - if(totalLength_ <= offset) { + if (totalLength_ <= offset) { return false; } - if(totalLength_ < offset+length) { - length = totalLength_-offset; + if (totalLength_ < offset + length) { + length = totalLength_ - offset; } - size_t startBlock = offset/blockLength_; - size_t endBlock = (offset+length-1)/blockLength_; - for(size_t i = startBlock; i <= endBlock; i++) { - if(!isBitSet(i)) { + size_t startBlock = offset / blockLength_; + size_t endBlock = (offset + length - 1) / blockLength_; + for (size_t i = startBlock; i <= endBlock; i++) { + if (!isBitSet(i)) { return false; } } return true; } -int64_t BitfieldMan::getOffsetCompletedLength -(int64_t offset, - int64_t length) const +int64_t BitfieldMan::getOffsetCompletedLength(int64_t offset, + int64_t length) const { int64_t res = 0; - if(length == 0 || totalLength_ <= offset) { + if (length == 0 || totalLength_ <= offset) { return 0; } - if(totalLength_ < offset+length) { - length = totalLength_-offset; + if (totalLength_ < offset + length) { + length = totalLength_ - offset; } - size_t start = offset/blockLength_; - size_t end = (offset+length-1)/blockLength_; - if(start == end) { - if(isBitSet(start)) { + size_t start = offset / blockLength_; + size_t end = (offset + length - 1) / blockLength_; + if (start == end) { + if (isBitSet(start)) { res = length; } - } else { - if(isBitSet(start)) { - res += static_cast(start+1)*blockLength_-offset; + } + else { + if (isBitSet(start)) { + res += static_cast(start + 1) * blockLength_ - offset; } - for(size_t i = start+1; i <= end-1; ++i) { - if(isBitSet(i)) { + for (size_t i = start + 1; i <= end - 1; ++i) { + if (isBitSet(i)) { res += blockLength_; } } - if(isBitSet(end)) { - res += offset+length-static_cast(end)*blockLength_; + if (isBitSet(end)) { + res += offset + length - static_cast(end) * blockLength_; } } return res; @@ -904,12 +929,12 @@ int64_t BitfieldMan::getOffsetCompletedLength int64_t BitfieldMan::getMissingUnusedLength(size_t startingIndex) const { - if(blocks_ <= startingIndex) { + if (blocks_ <= startingIndex) { return 0; } int64_t length = 0; - for(size_t i = startingIndex; i < blocks_; ++i) { - if(isBitSet(i) || isUseBitSet(i)) { + for (size_t i = startingIndex; i < blocks_; ++i) { + if (isBitSet(i) || isUseBitSet(i)) { break; } length += getBlockLength(i); @@ -918,19 +943,15 @@ int64_t BitfieldMan::getMissingUnusedLength(size_t startingIndex) const } BitfieldMan::Range::Range(size_t startIndex, size_t endIndex) - : - startIndex(startIndex), - endIndex(endIndex) -{} - -size_t BitfieldMan::Range::getSize() const + : startIndex(startIndex), endIndex(endIndex) { - return endIndex-startIndex; } +size_t BitfieldMan::Range::getSize() const { return endIndex - startIndex; } + size_t BitfieldMan::Range::getMidIndex() const { - return (endIndex-startIndex)/2+startIndex; + return (endIndex - startIndex) / 2 + startIndex; } bool BitfieldMan::Range::operator<(const Range& range) const diff --git a/src/BitfieldMan.h b/src/BitfieldMan.h index 8e33d118..de19d325 100644 --- a/src/BitfieldMan.h +++ b/src/BitfieldMan.h @@ -92,10 +92,7 @@ public: BitfieldMan& operator=(const BitfieldMan& bitfieldMan); - int32_t getBlockLength() const - { - return blockLength_; - } + int32_t getBlockLength() const { return blockLength_; } int32_t getLastBlockLength() const; @@ -131,11 +128,9 @@ public: // if such bit index is found. Otherwise returns false. // // affected by filter - bool getSparseMissingUnusedIndex - (size_t& index, - int32_t minSplitSize, - const unsigned char* ignoreBitfield, - size_t ignoreBitfieldLength) const; + bool getSparseMissingUnusedIndex(size_t& index, int32_t minSplitSize, + const unsigned char* ignoreBitfield, + size_t ignoreBitfieldLength) const; // Stores missing bit index to index. This function first try to // select smallest index starting offsetIndex in the order: @@ -151,13 +146,10 @@ public: // result. // // affected by filter - bool getGeomMissingUnusedIndex - (size_t& index, - int32_t minSplitSize, - const unsigned char* ignoreBitfield, - size_t ignoreBitfieldLength, - double base, - size_t offsetIndex) const; + bool getGeomMissingUnusedIndex(size_t& index, int32_t minSplitSize, + const unsigned char* ignoreBitfield, + size_t ignoreBitfieldLength, double base, + size_t offsetIndex) const; // Stores missing bit index to index. This function selects smallest // index of missing piece, considering minSplitSize. Set bits in @@ -165,11 +157,9 @@ public: // found. Otherwise returns false. // // affected by filter - bool getInorderMissingUnusedIndex - (size_t& index, - int32_t minSplitSize, - const unsigned char* ignoreBitfield, - size_t ignoreBitfieldLength) const; + bool getInorderMissingUnusedIndex(size_t& index, int32_t minSplitSize, + const unsigned char* ignoreBitfield, + size_t ignoreBitfieldLength) const; // Just like getInorderMissingUnusedIndex() above, but limit the // search area in [startIndex, endIndex). |endIndex| is normalized @@ -218,34 +208,19 @@ public: // filterBitfield_ is NULL, returns false. bool isFilterBitSet(size_t index) const; - const unsigned char* getBitfield() const - { - return bitfield_; - } + const unsigned char* getBitfield() const { return bitfield_; } - size_t getBitfieldLength() const - { - return bitfieldLength_; - } + size_t getBitfieldLength() const { return bitfieldLength_; } // affected by filter - size_t countFilteredBlock() const - { - return cachedNumFilteredBlock_; - } + size_t countFilteredBlock() const { return cachedNumFilteredBlock_; } - size_t countBlock() const - { - return blocks_; - } + size_t countBlock() const { return blocks_; } // affected by filter size_t countFilteredBlockNow() const; - size_t getMaxIndex() const - { - return blocks_-1; - } + size_t getMaxIndex() const { return blocks_ - 1; } void setBitfield(const unsigned char* bitfield, size_t bitfieldLength); @@ -265,24 +240,15 @@ public: void enableFilter(); void disableFilter(); - bool isFilterEnabled() const - { - return filterEnabled_; - } + bool isFilterEnabled() const { return filterEnabled_; } // affected by filter - int64_t getFilteredTotalLength() const - { - return cachedFilteredTotalLength_; - } + int64_t getFilteredTotalLength() const { return cachedFilteredTotalLength_; } // affected by filter int64_t getFilteredTotalLengthNow() const; - int64_t getCompletedLength() const - { - return cachedCompletedLength_; - } + int64_t getCompletedLength() const { return cachedCompletedLength_; } int64_t getCompletedLengthNow() const; @@ -311,10 +277,7 @@ public: int64_t getMissingUnusedLength(size_t startingIndex) const; - const unsigned char* getFilterBitfield() const - { - return filterBitfield_; - } + const unsigned char* getFilterBitfield() const { return filterBitfield_; } }; } // namespace aria2 diff --git a/src/BtAbortOutstandingRequestEvent.cc b/src/BtAbortOutstandingRequestEvent.cc index 6afc6f60..673c3f17 100644 --- a/src/BtAbortOutstandingRequestEvent.cc +++ b/src/BtAbortOutstandingRequestEvent.cc @@ -37,10 +37,11 @@ namespace aria2 { -BtAbortOutstandingRequestEvent::BtAbortOutstandingRequestEvent -(const std::shared_ptr& piece) - : piece_(piece) -{} +BtAbortOutstandingRequestEvent::BtAbortOutstandingRequestEvent( + const std::shared_ptr& piece) + : piece_(piece) +{ +} BtAbortOutstandingRequestEvent::~BtAbortOutstandingRequestEvent() {} diff --git a/src/BtAbortOutstandingRequestEvent.h b/src/BtAbortOutstandingRequestEvent.h index b93cd0eb..598fd321 100644 --- a/src/BtAbortOutstandingRequestEvent.h +++ b/src/BtAbortOutstandingRequestEvent.h @@ -46,6 +46,7 @@ class Piece; class BtAbortOutstandingRequestEvent { private: std::shared_ptr piece_; + public: BtAbortOutstandingRequestEvent(const std::shared_ptr& piece); ~BtAbortOutstandingRequestEvent(); diff --git a/src/BtAllowedFastMessage.cc b/src/BtAllowedFastMessage.cc index 9922a624..364d2a23 100644 --- a/src/BtAllowedFastMessage.cc +++ b/src/BtAllowedFastMessage.cc @@ -42,22 +42,24 @@ namespace aria2 { const char BtAllowedFastMessage::NAME[] = "allowed fast"; -BtAllowedFastMessage::BtAllowedFastMessage(size_t index): - IndexBtMessage(ID, NAME, index) {} +BtAllowedFastMessage::BtAllowedFastMessage(size_t index) + : IndexBtMessage(ID, NAME, index) +{ +} -std::unique_ptr BtAllowedFastMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtAllowedFastMessage::create(const unsigned char* data, size_t dataLength) { return IndexBtMessage::create(data, dataLength); } -void BtAllowedFastMessage::doReceivedAction() { - if(!getPeer()->isFastExtensionEnabled()) { - throw DL_ABORT_EX - (fmt("%s received while fast extension is disabled", - toString().c_str())); +void BtAllowedFastMessage::doReceivedAction() +{ + if (!getPeer()->isFastExtensionEnabled()) { + throw DL_ABORT_EX(fmt("%s received while fast extension is disabled", + toString().c_str())); } - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } getPeer()->addPeerAllowedIndex(getIndex()); @@ -65,11 +67,13 @@ void BtAllowedFastMessage::doReceivedAction() { namespace { struct ThisProgressUpdate : public ProgressUpdate { - ThisProgressUpdate(std::shared_ptr peer, size_t index) - : peer(std::move(peer)), index(index) {} + ThisProgressUpdate(std::shared_ptr peer, size_t index) + : peer(std::move(peer)), index(index) + { + } virtual void update(size_t length, bool complete) CXX11_OVERRIDE { - if(complete) { + if (complete) { peer->addAmAllowedIndex(index); } } diff --git a/src/BtAllowedFastMessage.h b/src/BtAllowedFastMessage.h index c58f5190..59dd61ab 100644 --- a/src/BtAllowedFastMessage.h +++ b/src/BtAllowedFastMessage.h @@ -47,8 +47,8 @@ public: static const char NAME[]; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; diff --git a/src/BtAnnounce.h b/src/BtAnnounce.h index 21688bb7..61b3c722 100644 --- a/src/BtAnnounce.h +++ b/src/BtAnnounce.h @@ -104,8 +104,8 @@ public: virtual void processAnnounceResponse(const unsigned char* trackerResponse, size_t trackerResponseLength) = 0; - virtual void processUDPTrackerResponse - (const std::shared_ptr& req) = 0; + virtual void + processUDPTrackerResponse(const std::shared_ptr& req) = 0; /** * Returns true if no more announce is needed. diff --git a/src/BtBitfieldMessage.cc b/src/BtBitfieldMessage.cc index ff801c85..9d55d304 100644 --- a/src/BtBitfieldMessage.cc +++ b/src/BtBitfieldMessage.cc @@ -49,24 +49,23 @@ namespace aria2 { const char BtBitfieldMessage::NAME[] = "bitfield"; BtBitfieldMessage::BtBitfieldMessage() - : SimpleBtMessage(ID, NAME), - bitfieldLength_(0) -{} + : SimpleBtMessage(ID, NAME), bitfieldLength_(0) +{ +} -BtBitfieldMessage::BtBitfieldMessage -(const unsigned char* bitfield, size_t bitfieldLength) - : SimpleBtMessage(ID, NAME), - bitfieldLength_(0) +BtBitfieldMessage::BtBitfieldMessage(const unsigned char* bitfield, + size_t bitfieldLength) + : SimpleBtMessage(ID, NAME), bitfieldLength_(0) { setBitfield(bitfield, bitfieldLength); } -BtBitfieldMessage::~BtBitfieldMessage() -{} +BtBitfieldMessage::~BtBitfieldMessage() {} -void BtBitfieldMessage::setBitfield -(const unsigned char* bitfield, size_t bitfieldLength) { - if(bitfield_.get() == bitfield) { +void BtBitfieldMessage::setBitfield(const unsigned char* bitfield, + size_t bitfieldLength) +{ + if (bitfield_.get() == bitfield) { return; } @@ -78,44 +77,45 @@ void BtBitfieldMessage::setBitfield std::unique_ptr BtBitfieldMessage::create(const unsigned char* data, size_t dataLength) { - bittorrent::assertPayloadLengthGreater(1,dataLength, NAME); + bittorrent::assertPayloadLengthGreater(1, dataLength, NAME); bittorrent::assertID(ID, data, NAME); auto message = make_unique(); - message->setBitfield(data+1, dataLength-1); + message->setBitfield(data + 1, dataLength - 1); return message; } -void BtBitfieldMessage::doReceivedAction() { - if(isMetadataGetMode()) { +void BtBitfieldMessage::doReceivedAction() +{ + if (isMetadataGetMode()) { return; } getPieceStorage()->updatePieceStats(bitfield_.get(), bitfieldLength_, getPeer()->getBitfield()); getPeer()->setBitfield(bitfield_.get(), bitfieldLength_); - if(getPeer()->isSeeder() && getPieceStorage()->downloadFinished()) { + if (getPeer()->isSeeder() && getPieceStorage()->downloadFinished()) { throw DL_ABORT_EX(MSG_GOOD_BYE_SEEDER); } } -unsigned char* BtBitfieldMessage::createMessage() { +unsigned char* BtBitfieldMessage::createMessage() +{ /** * len --- 1+bitfieldLength, 4bytes * id --- 5, 1byte * bitfield --- bitfield, bitfieldLength bytes * total: 5+bitfieldLength bytes */ - const size_t msgLength = 5+bitfieldLength_; + const size_t msgLength = 5 + bitfieldLength_; auto msg = new unsigned char[msgLength]; - bittorrent::createPeerMessageString(msg, msgLength, 1+bitfieldLength_, ID); - memcpy(msg+5, bitfield_.get(), bitfieldLength_); + bittorrent::createPeerMessageString(msg, msgLength, 1 + bitfieldLength_, ID); + memcpy(msg + 5, bitfield_.get(), bitfieldLength_); return msg; } -size_t BtBitfieldMessage::getMessageLength() { - return 5+bitfieldLength_; -} +size_t BtBitfieldMessage::getMessageLength() { return 5 + bitfieldLength_; } -std::string BtBitfieldMessage::toString() const { +std::string BtBitfieldMessage::toString() const +{ std::string s = NAME; s += " "; s += util::toHex(bitfield_.get(), bitfieldLength_); diff --git a/src/BtBitfieldMessage.h b/src/BtBitfieldMessage.h index 8494aa7d..640bf6ff 100644 --- a/src/BtBitfieldMessage.h +++ b/src/BtBitfieldMessage.h @@ -43,6 +43,7 @@ class BtBitfieldMessage : public SimpleBtMessage { private: std::unique_ptr bitfield_; size_t bitfieldLength_; + public: BtBitfieldMessage(); @@ -60,8 +61,8 @@ public: size_t getBitfieldLength() const { return bitfieldLength_; } - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; diff --git a/src/BtBitfieldMessageValidator.cc b/src/BtBitfieldMessageValidator.cc index 03d0bf1f..00bf12f8 100644 --- a/src/BtBitfieldMessageValidator.cc +++ b/src/BtBitfieldMessageValidator.cc @@ -38,19 +38,18 @@ namespace aria2 { -BtBitfieldMessageValidator::BtBitfieldMessageValidator -(const BtBitfieldMessage* message, size_t numPiece) - : message_(message), - numPiece_(numPiece) -{} +BtBitfieldMessageValidator::BtBitfieldMessageValidator( + const BtBitfieldMessage* message, size_t numPiece) + : message_(message), numPiece_(numPiece) +{ +} BtBitfieldMessageValidator::~BtBitfieldMessageValidator() {} void BtBitfieldMessageValidator::validate() { bittorrent::checkBitfield(message_->getBitfield(), - message_->getBitfieldLength(), - numPiece_); + message_->getBitfieldLength(), numPiece_); } } // namespace aria2 diff --git a/src/BtBitfieldMessageValidator.h b/src/BtBitfieldMessageValidator.h index 606250a3..2613e3dc 100644 --- a/src/BtBitfieldMessageValidator.h +++ b/src/BtBitfieldMessageValidator.h @@ -45,9 +45,9 @@ class BtBitfieldMessageValidator : public BtMessageValidator { private: const BtBitfieldMessage* message_; size_t numPiece_; + public: - BtBitfieldMessageValidator(const BtBitfieldMessage* message, - size_t numPiece); + BtBitfieldMessageValidator(const BtBitfieldMessage* message, size_t numPiece); ~BtBitfieldMessageValidator(); virtual void validate() CXX11_OVERRIDE; diff --git a/src/BtCancelMessage.cc b/src/BtCancelMessage.cc index ecfff4f0..1ce499c4 100644 --- a/src/BtCancelMessage.cc +++ b/src/BtCancelMessage.cc @@ -39,23 +39,24 @@ namespace aria2 { const char BtCancelMessage::NAME[] = "cancel"; -BtCancelMessage::BtCancelMessage -(size_t index, int32_t begin, int32_t length) - :RangeBtMessage(ID, NAME, index, begin, length) {} +BtCancelMessage::BtCancelMessage(size_t index, int32_t begin, int32_t length) + : RangeBtMessage(ID, NAME, index, begin, length) +{ +} -std::unique_ptr BtCancelMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtCancelMessage::create(const unsigned char* data, size_t dataLength) { return RangeBtMessage::create(data, dataLength); } void BtCancelMessage::doReceivedAction() { - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } - getBtMessageDispatcher()->doCancelSendingPieceAction - (getIndex(), getBegin(), getLength()); + getBtMessageDispatcher()->doCancelSendingPieceAction(getIndex(), getBegin(), + getLength()); } } // namespace aria2 diff --git a/src/BtCancelMessage.h b/src/BtCancelMessage.h index fd3c601a..eac8d59d 100644 --- a/src/BtCancelMessage.h +++ b/src/BtCancelMessage.h @@ -47,8 +47,8 @@ public: static const char NAME[]; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; }; diff --git a/src/BtCancelSendingPieceEvent.h b/src/BtCancelSendingPieceEvent.h index 18431072..41c1362f 100644 --- a/src/BtCancelSendingPieceEvent.h +++ b/src/BtCancelSendingPieceEvent.h @@ -44,9 +44,12 @@ private: size_t index_; int32_t begin_; int32_t length_; + public: - BtCancelSendingPieceEvent(size_t index, int32_t begin, int32_t length): - index_(index), begin_(begin), length_(length) {} + BtCancelSendingPieceEvent(size_t index, int32_t begin, int32_t length) + : index_(index), begin_(begin), length_(length) + { + } size_t getIndex() const { return index_; } diff --git a/src/BtCheckIntegrityEntry.cc b/src/BtCheckIntegrityEntry.cc index b25c4462..2bd8b7ec 100644 --- a/src/BtCheckIntegrityEntry.cc +++ b/src/BtCheckIntegrityEntry.cc @@ -46,52 +46,52 @@ namespace aria2 { -BtCheckIntegrityEntry::BtCheckIntegrityEntry(RequestGroup* requestGroup): - PieceHashCheckIntegrityEntry(requestGroup, nullptr) {} +BtCheckIntegrityEntry::BtCheckIntegrityEntry(RequestGroup* requestGroup) + : PieceHashCheckIntegrityEntry(requestGroup, nullptr) +{ +} BtCheckIntegrityEntry::~BtCheckIntegrityEntry() {} -void BtCheckIntegrityEntry::onDownloadIncomplete -(std::vector>& commands, DownloadEngine* e) +void BtCheckIntegrityEntry::onDownloadIncomplete( + std::vector>& commands, DownloadEngine* e) { auto& ps = getRequestGroup()->getPieceStorage(); ps->onDownloadIncomplete(); - if(getRequestGroup()->getOption()->getAsBool(PREF_HASH_CHECK_ONLY)) { + if (getRequestGroup()->getOption()->getAsBool(PREF_HASH_CHECK_ONLY)) { return; } const auto& diskAdaptor = ps->getDiskAdaptor(); - if(diskAdaptor->isReadOnlyEnabled()) { + if (diskAdaptor->isReadOnlyEnabled()) { // Now reopen DiskAdaptor with read only disabled. diskAdaptor->closeFile(); diskAdaptor->disableReadOnly(); diskAdaptor->openFile(); } - proceedFileAllocation(commands, - make_unique - (getRequestGroup()), - e); + proceedFileAllocation( + commands, make_unique(getRequestGroup()), e); } -void BtCheckIntegrityEntry::onDownloadFinished -(std::vector>& commands, DownloadEngine* e) +void BtCheckIntegrityEntry::onDownloadFinished( + std::vector>& commands, DownloadEngine* e) { auto group = getRequestGroup(); const auto& option = group->getOption(); - util::executeHookByOptName(group, option.get(), PREF_ON_BT_DOWNLOAD_COMPLETE); - SingletonHolder::instance()->notifyDownloadEvent - (EVENT_ON_BT_DOWNLOAD_COMPLETE, group); + if (option->getAsBool(PREF_BT_ENABLE_HOOK_AFTER_HASH_CHECK)) { + util::executeHookByOptName(group, option.get(), + PREF_ON_BT_DOWNLOAD_COMPLETE); + SingletonHolder::instance()->notifyDownloadEvent( + EVENT_ON_BT_DOWNLOAD_COMPLETE, group); + } // TODO Currently,when all the checksums // are valid, then aria2 goes to seeding mode. Sometimes it is better // to exit rather than doing seeding. So, it would be good to toggle this // behavior. - if(!option->getAsBool(PREF_HASH_CHECK_ONLY) && - option->getAsBool(PREF_BT_HASH_CHECK_SEED)) { - proceedFileAllocation(commands, - make_unique - (getRequestGroup()), - e); + if (!option->getAsBool(PREF_HASH_CHECK_ONLY) && + option->getAsBool(PREF_BT_HASH_CHECK_SEED)) { + proceedFileAllocation( + commands, make_unique(getRequestGroup()), e); } } - } // namespace aria2 diff --git a/src/BtCheckIntegrityEntry.h b/src/BtCheckIntegrityEntry.h index 14f8f74e..491dd3c9 100644 --- a/src/BtCheckIntegrityEntry.h +++ b/src/BtCheckIntegrityEntry.h @@ -45,13 +45,13 @@ public: virtual ~BtCheckIntegrityEntry(); - virtual void onDownloadFinished - (std::vector>& commands, DownloadEngine* e) - CXX11_OVERRIDE; + virtual void + onDownloadFinished(std::vector>& commands, + DownloadEngine* e) CXX11_OVERRIDE; - virtual void onDownloadIncomplete - (std::vector>& commands, DownloadEngine* e) - CXX11_OVERRIDE; + virtual void + onDownloadIncomplete(std::vector>& commands, + DownloadEngine* e) CXX11_OVERRIDE; }; } // namespace aria2 diff --git a/src/BtChokeMessage.cc b/src/BtChokeMessage.cc index 87e5c084..7d75df02 100644 --- a/src/BtChokeMessage.cc +++ b/src/BtChokeMessage.cc @@ -42,17 +42,17 @@ namespace aria2 { const char BtChokeMessage::NAME[] = "choke"; -BtChokeMessage::BtChokeMessage():ZeroBtMessage{ID, NAME} {} +BtChokeMessage::BtChokeMessage() : ZeroBtMessage{ID, NAME} {} -std::unique_ptr BtChokeMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtChokeMessage::create(const unsigned char* data, size_t dataLength) { return ZeroBtMessage::create(data, dataLength); } void BtChokeMessage::doReceivedAction() { - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } getPeer()->peerChoking(true); @@ -60,19 +60,17 @@ void BtChokeMessage::doReceivedAction() getBtRequestFactory()->doChokedAction(); } -bool BtChokeMessage::sendPredicate() const -{ - return !getPeer()->amChoking(); -} +bool BtChokeMessage::sendPredicate() const { return !getPeer()->amChoking(); } namespace { struct ThisProgressUpdate : public ProgressUpdate { - ThisProgressUpdate(std::shared_ptr peer, - BtMessageDispatcher* disp) - : peer(std::move(peer)), disp(disp) {} + ThisProgressUpdate(std::shared_ptr peer, BtMessageDispatcher* disp) + : peer(std::move(peer)), disp(disp) + { + } virtual void update(size_t length, bool complete) CXX11_OVERRIDE { - if(complete) { + if (complete) { peer->amChoking(true); disp->doChokingAction(); } diff --git a/src/BtChokeMessage.h b/src/BtChokeMessage.h index 23a63a5e..3ad96dd1 100644 --- a/src/BtChokeMessage.h +++ b/src/BtChokeMessage.h @@ -49,8 +49,8 @@ public: virtual void doReceivedAction() CXX11_OVERRIDE; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual bool sendPredicate() const CXX11_OVERRIDE; diff --git a/src/BtChokingEvent.h b/src/BtChokingEvent.h index 91a9360e..5fa6a0ce 100644 --- a/src/BtChokingEvent.h +++ b/src/BtChokingEvent.h @@ -39,7 +39,8 @@ namespace aria2 { -class BtChokingEvent {}; +class BtChokingEvent { +}; } // namespace aria2 diff --git a/src/BtDependency.cc b/src/BtDependency.cc index afbe9621..3131c5c2 100644 --- a/src/BtDependency.cc +++ b/src/BtDependency.cc @@ -53,12 +53,11 @@ namespace aria2 { -BtDependency::BtDependency -(RequestGroup* dependant, - const std::shared_ptr& dependee) - : dependant_(dependant), - dependee_(dependee) -{} +BtDependency::BtDependency(RequestGroup* dependant, + const std::shared_ptr& dependee) + : dependant_(dependant), dependee_(dependee) +{ +} BtDependency::~BtDependency() {} @@ -77,9 +76,8 @@ void copyValues(const std::shared_ptr& d, namespace { struct EntryCmp { - bool operator() - (const std::shared_ptr& lhs, - const std::shared_ptr& rhs) const + bool operator()(const std::shared_ptr& lhs, + const std::shared_ptr& rhs) const { return lhs->getOriginalName() < rhs->getOriginalName(); } @@ -88,53 +86,54 @@ struct EntryCmp { bool BtDependency::resolve() { - if(!dependee_) { + if (!dependee_) { return true; } - if(dependee_->getNumCommand() == 0 && dependee_->downloadFinished()) { + if (dependee_->getNumCommand() == 0 && dependee_->downloadFinished()) { std::shared_ptr dependee = dependee_; // cut reference here dependee_.reset(); auto context = std::make_shared(); try { std::shared_ptr diskAdaptor = - dependee->getPieceStorage()->getDiskAdaptor(); + dependee->getPieceStorage()->getDiskAdaptor(); diskAdaptor->openExistingFile(); std::string content = util::toString(diskAdaptor); - if(dependee->getDownloadContext()->hasAttribute(CTX_ATTR_BT)) { + if (dependee->getDownloadContext()->hasAttribute(CTX_ATTR_BT)) { auto attrs = - bittorrent::getTorrentAttrs(dependee->getDownloadContext()); - bittorrent::loadFromMemory - (bittorrent::metadata2Torrent(content, attrs), context, - dependant_->getOption(), "default"); + bittorrent::getTorrentAttrs(dependee->getDownloadContext()); + bittorrent::loadFromMemory(bittorrent::metadata2Torrent(content, attrs), + context, dependant_->getOption(), "default"); // We don't call bittorrent::adjustAnnounceUri() because it // has already been called with attrs. - } else { - bittorrent::loadFromMemory - (content, context, dependant_->getOption(), - File(dependee->getFirstFilePath()).getBasename()); + } + else { + bittorrent::loadFromMemory( + content, context, dependant_->getOption(), + File(dependee->getFirstFilePath()).getBasename()); bittorrent::adjustAnnounceUri(bittorrent::getTorrentAttrs(context), dependant_->getOption()); } - const std::vector >& fileEntries = - context->getFileEntries(); - for (auto &fe : fileEntries) { - auto &uri = fe->getRemainingUris(); + const std::vector>& fileEntries = + context->getFileEntries(); + for (auto& fe : fileEntries) { + auto& uri = fe->getRemainingUris(); std::shuffle(std::begin(uri), std::end(uri), *SimpleRandomizer::getInstance()); } - const std::vector >& dependantFileEntries = - dependant_->getDownloadContext()->getFileEntries(); + const std::vector>& dependantFileEntries = + dependant_->getDownloadContext()->getFileEntries(); // If dependant's FileEntry::getOriginalName() is empty, we // assume that torrent is single file. In Metalink3, this is // always assumed. - if(fileEntries.size() == 1 && dependantFileEntries.size() == 1 && - dependantFileEntries[0]->getOriginalName().empty()) { + if (fileEntries.size() == 1 && dependantFileEntries.size() == 1 && + dependantFileEntries[0]->getOriginalName().empty()) { copyValues(fileEntries[0], dependantFileEntries[0]); - } else { - std::vector > destFiles; + } + else { + std::vector> destFiles; destFiles.reserve(fileEntries.size()); - for(auto & e : fileEntries) { + for (auto& e : fileEntries) { e->setRequested(false); destFiles.push_back(e); } @@ -142,19 +141,21 @@ bool BtDependency::resolve() // Copy file path in dependant_'s FileEntries to newly created // context's FileEntries to endorse the path structure of // dependant_. URIs and singleHostMultiConnection are also copied. - for(const auto& e: dependantFileEntries){ + for (const auto& e : dependantFileEntries) { const auto d = std::lower_bound(std::begin(destFiles), std::end(destFiles), e, EntryCmp()); - if(d == std::end(destFiles) || - (*d)->getOriginalName() != e->getOriginalName()) { - throw DL_ABORT_EX - (fmt("No entry %s in torrent file", e->getOriginalName().c_str())); - } else { + if (d == std::end(destFiles) || + (*d)->getOriginalName() != e->getOriginalName()) { + throw DL_ABORT_EX(fmt("No entry %s in torrent file", + e->getOriginalName().c_str())); + } + else { copyValues(*d, e); } } } - } catch(RecoverableException& e) { + } + catch (RecoverableException& e) { A2_LOG_ERROR_EX(EX_EXCEPTION_CAUGHT, e); A2_LOG_INFO(fmt("BtDependency for GID#%s failed. Go without Bt.", GroupId::toHex(dependant_->getGID()).c_str())); @@ -164,14 +165,16 @@ bool BtDependency::resolve() GroupId::toHex(dependant_->getGID()).c_str())); dependant_->setDownloadContext(context); return true; - } else if(dependee_->getNumCommand() == 0) { + } + else if (dependee_->getNumCommand() == 0) { // dependee_'s download failed. // cut reference here dependee_.reset(); A2_LOG_INFO(fmt("BtDependency for GID#%s failed. Go without Bt.", GroupId::toHex(dependant_->getGID()).c_str())); return true; - } else { + } + else { return false; } } diff --git a/src/BtDependency.h b/src/BtDependency.h index 8613a160..83e66d87 100644 --- a/src/BtDependency.h +++ b/src/BtDependency.h @@ -44,11 +44,11 @@ namespace aria2 { class RequestGroup; class Option; -class BtDependency : public Dependency -{ +class BtDependency : public Dependency { private: RequestGroup* dependant_; std::shared_ptr dependee_; + public: BtDependency(RequestGroup* dependant, const std::shared_ptr& dependee); diff --git a/src/BtExtendedMessage.cc b/src/BtExtendedMessage.cc index 273ea289..add69170 100644 --- a/src/BtExtendedMessage.cc +++ b/src/BtExtendedMessage.cc @@ -50,12 +50,13 @@ namespace aria2 { const char BtExtendedMessage::NAME[] = "extended"; -BtExtendedMessage::BtExtendedMessage -(std::unique_ptr extensionMessage): - SimpleBtMessage(ID, NAME), - extensionMessage_(std::move(extensionMessage)), - msgLength_(0) -{} +BtExtendedMessage::BtExtendedMessage( + std::unique_ptr extensionMessage) + : SimpleBtMessage(ID, NAME), + extensionMessage_(std::move(extensionMessage)), + msgLength_(0) +{ +} unsigned char* BtExtendedMessage::createMessage() { @@ -67,17 +68,18 @@ unsigned char* BtExtendedMessage::createMessage() * total: 6+extpayload.length bytes */ std::string payload = extensionMessage_->getPayload(); - msgLength_ = 6+payload.size(); + msgLength_ = 6 + payload.size(); auto msg = new unsigned char[msgLength_]; - bittorrent::createPeerMessageString(msg, msgLength_, 2+payload.size(), ID); - *(msg+5) = extensionMessage_->getExtensionMessageID(); - memcpy(msg+6, payload.data(), payload.size()); + bittorrent::createPeerMessageString(msg, msgLength_, 2 + payload.size(), ID); + *(msg + 5) = extensionMessage_->getExtensionMessageID(); + memcpy(msg + 6, payload.data(), payload.size()); return msg; } -size_t BtExtendedMessage::getMessageLength() { - if(!msgLength_) { - msgLength_ = 6+extensionMessage_->getPayload().size(); +size_t BtExtendedMessage::getMessageLength() +{ + if (!msgLength_) { + msgLength_ = 6 + extensionMessage_->getPayload().size(); } return msgLength_; } @@ -87,7 +89,8 @@ bool BtExtendedMessage::sendPredicate() const return getPeer()->isExtendedMessagingEnabled(); } -std::string BtExtendedMessage::toString() const { +std::string BtExtendedMessage::toString() const +{ std::string s = NAME; s += " "; s += extensionMessage_->toString(); @@ -102,13 +105,13 @@ BtExtendedMessage::create(ExtensionMessageFactory* factory, bittorrent::assertPayloadLengthGreater(1, dataLength, NAME); bittorrent::assertID(ID, data, NAME); assert(factory); - return make_unique - (factory->createMessage(data+1, dataLength-1)); + return make_unique( + factory->createMessage(data + 1, dataLength - 1)); } void BtExtendedMessage::doReceivedAction() { - if(extensionMessage_) { + if (extensionMessage_) { extensionMessage_->doReceivedAction(); } } diff --git a/src/BtExtendedMessage.h b/src/BtExtendedMessage.h index e1df8aec..dcd0d198 100644 --- a/src/BtExtendedMessage.h +++ b/src/BtExtendedMessage.h @@ -41,25 +41,23 @@ namespace aria2 { class ExtensionMessage; class ExtensionMessageFactory; -class BtExtendedMessage:public SimpleBtMessage -{ +class BtExtendedMessage : public SimpleBtMessage { private: std::unique_ptr extensionMessage_; size_t msgLength_; + public: BtExtendedMessage(std::unique_ptr extensionMessage = - std::unique_ptr{}); + std::unique_ptr{}); static const uint8_t ID = 20; static const char NAME[]; - static std::unique_ptr create - (ExtensionMessageFactory* factory, - const std::shared_ptr& peer, - const unsigned char* data, - size_t dataLength); + static std::unique_ptr + create(ExtensionMessageFactory* factory, const std::shared_ptr& peer, + const unsigned char* data, size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; diff --git a/src/BtFileAllocationEntry.cc b/src/BtFileAllocationEntry.cc index 44553354..dc9cc04f 100644 --- a/src/BtFileAllocationEntry.cc +++ b/src/BtFileAllocationEntry.cc @@ -50,34 +50,41 @@ namespace aria2 { -BtFileAllocationEntry::BtFileAllocationEntry(RequestGroup* requestGroup): - FileAllocationEntry(requestGroup, nullptr) {} +BtFileAllocationEntry::BtFileAllocationEntry(RequestGroup* requestGroup) + : FileAllocationEntry(requestGroup, nullptr) +{ +} BtFileAllocationEntry::~BtFileAllocationEntry() {} -void BtFileAllocationEntry::prepareForNextAction -(std::vector>& commands, DownloadEngine* e) +void BtFileAllocationEntry::prepareForNextAction( + std::vector>& commands, DownloadEngine* e) { - BtSetup().setup(commands, getRequestGroup(), e, - getRequestGroup()->getOption().get()); - if(getRequestGroup()->getOption()->getAsBool(PREF_ENABLE_MMAP)) { + auto& option = getRequestGroup()->getOption(); + + BtSetup().setup(commands, getRequestGroup(), e, option.get()); + if (option->getAsBool(PREF_ENABLE_MMAP) && + option->get(PREF_FILE_ALLOCATION) != V_NONE && + getRequestGroup()->getPieceStorage()->getDiskAdaptor()->size() <= + option->getAsLLInt(PREF_MAX_MMAP_LIMIT)) { getRequestGroup()->getPieceStorage()->getDiskAdaptor()->enableMmap(); } - if(!getRequestGroup()->downloadFinished()) { + if (!getRequestGroup()->downloadFinished()) { // For DownloadContext::resetDownloadStartTime(), see also // RequestGroup::createInitialCommand() getRequestGroup()->getDownloadContext()->resetDownloadStartTime(); - const std::vector >& fileEntries = - getRequestGroup()->getDownloadContext()->getFileEntries(); - if(isUriSuppliedForRequsetFileEntry - (std::begin(fileEntries), std::end(fileEntries))) { + const std::vector>& fileEntries = + getRequestGroup()->getDownloadContext()->getFileEntries(); + if (isUriSuppliedForRequsetFileEntry(std::begin(fileEntries), + std::end(fileEntries))) { getRequestGroup()->createNextCommandWithAdj(commands, e, 0); } - } else { + } + else { #ifdef __MINGW32__ const std::shared_ptr& diskAdaptor = - getRequestGroup()->getPieceStorage()->getDiskAdaptor(); - if(!diskAdaptor->isReadOnlyEnabled()) { + getRequestGroup()->getPieceStorage()->getDiskAdaptor(); + if (!diskAdaptor->isReadOnlyEnabled()) { // On Windows, if aria2 opens files with GENERIC_WRITE access // right, some programs cannot open them aria2 is seeding. To // avoid this situation, re-open the files with read-only diff --git a/src/BtFileAllocationEntry.h b/src/BtFileAllocationEntry.h index b1a2e902..5348ab01 100644 --- a/src/BtFileAllocationEntry.h +++ b/src/BtFileAllocationEntry.h @@ -45,9 +45,9 @@ public: virtual ~BtFileAllocationEntry(); - virtual void prepareForNextAction - (std::vector>& commands, DownloadEngine* e) - CXX11_OVERRIDE; + virtual void + prepareForNextAction(std::vector>& commands, + DownloadEngine* e) CXX11_OVERRIDE; }; } // namespace aria2 diff --git a/src/BtHandshakeMessage.cc b/src/BtHandshakeMessage.cc index 2462d37b..c7ebfef1 100644 --- a/src/BtHandshakeMessage.cc +++ b/src/BtHandshakeMessage.cc @@ -45,23 +45,21 @@ namespace aria2 { const char BtHandshakeMessage::NAME[] = "handshake"; const unsigned char* BtHandshakeMessage::BT_PSTR = - reinterpret_cast("BitTorrent protocol"); + reinterpret_cast("BitTorrent protocol"); -BtHandshakeMessage::BtHandshakeMessage():SimpleBtMessage(ID, NAME) -{ - init(); -} +BtHandshakeMessage::BtHandshakeMessage() : SimpleBtMessage(ID, NAME) { init(); } BtHandshakeMessage::BtHandshakeMessage(const unsigned char* infoHash, - const unsigned char* peerId): - SimpleBtMessage(ID, NAME) + const unsigned char* peerId) + : SimpleBtMessage(ID, NAME) { init(); memcpy(infoHash_, infoHash, INFO_HASH_LENGTH); memcpy(peerId_, peerId, PEER_ID_LENGTH); } -void BtHandshakeMessage::init() { +void BtHandshakeMessage::init() +{ pstrlen_ = 19; pstr_ = new unsigned char[PSTR_LENGTH]; reserved_ = new unsigned char[RESERVED_LENGTH]; @@ -91,37 +89,33 @@ unsigned char* BtHandshakeMessage::createMessage() { auto msg = new unsigned char[MESSAGE_LENGTH]; msg[0] = pstrlen_; - memcpy(msg+1, pstr_, PSTR_LENGTH); - memcpy(msg+20, reserved_, RESERVED_LENGTH); - memcpy(msg+28, infoHash_, INFO_HASH_LENGTH); - memcpy(msg+48, peerId_, PEER_ID_LENGTH); + memcpy(msg + 1, pstr_, PSTR_LENGTH); + memcpy(msg + 20, reserved_, RESERVED_LENGTH); + memcpy(msg + 28, infoHash_, INFO_HASH_LENGTH); + memcpy(msg + 48, peerId_, PEER_ID_LENGTH); return msg; } -size_t BtHandshakeMessage::getMessageLength() { - return MESSAGE_LENGTH; -} +size_t BtHandshakeMessage::getMessageLength() { return MESSAGE_LENGTH; } -std::string BtHandshakeMessage::toString() const { - return fmt("%s peerId=%s, reserved=%s", - NAME, +std::string BtHandshakeMessage::toString() const +{ + return fmt("%s peerId=%s, reserved=%s", NAME, util::percentEncode(peerId_, PEER_ID_LENGTH).c_str(), util::toHex(reserved_, RESERVED_LENGTH).c_str()); } -bool BtHandshakeMessage::isFastExtensionSupported() const { - return reserved_[7]&0x04u; +bool BtHandshakeMessage::isFastExtensionSupported() const +{ + return reserved_[7] & 0x04u; } bool BtHandshakeMessage::isExtendedMessagingEnabled() const { - return reserved_[5]&0x10u; + return reserved_[5] & 0x10u; } -bool BtHandshakeMessage::isDHTEnabled() const -{ - return reserved_[7]&0x01u; -} +bool BtHandshakeMessage::isDHTEnabled() const { return reserved_[7] & 0x01u; } void BtHandshakeMessage::setInfoHash(const unsigned char* infoHash) { diff --git a/src/BtHandshakeMessage.h b/src/BtHandshakeMessage.h index 03ea2b8b..51893b57 100644 --- a/src/BtHandshakeMessage.h +++ b/src/BtHandshakeMessage.h @@ -45,6 +45,7 @@ public: static const unsigned char* BT_PSTR; static const size_t RESERVED_LENGTH = 8; static const size_t MESSAGE_LENGTH = 68; + private: uint8_t pstrlen_; unsigned char* pstr_; @@ -52,29 +53,32 @@ private: unsigned char* infoHash_; unsigned char* peerId_; void init(); + public: BtHandshakeMessage(); /** * infoHash must be 20 byte length. * peerId must be 20 byte length. */ - BtHandshakeMessage(const unsigned char* infoHash, const unsigned char* peerId); + BtHandshakeMessage(const unsigned char* infoHash, + const unsigned char* peerId); - static std::unique_ptr - create(const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); - virtual ~BtHandshakeMessage() { - delete [] pstr_; - delete [] reserved_; - delete [] infoHash_; - delete [] peerId_; + virtual ~BtHandshakeMessage() + { + delete[] pstr_; + delete[] reserved_; + delete[] infoHash_; + delete[] peerId_; } static const uint8_t ID = INT8_MAX; static const char NAME[]; - virtual void doReceivedAction() CXX11_OVERRIDE {}; + virtual void doReceivedAction() CXX11_OVERRIDE{}; virtual unsigned char* createMessage() CXX11_OVERRIDE; @@ -90,34 +94,25 @@ public: void setDHTEnabled(bool enabled) { - if(enabled) { + if (enabled) { reserved_[7] |= 0x01u; - } else { + } + else { reserved_[7] &= ~0x01u; } } - uint8_t getPstrlen() const { - return pstrlen_; - } + uint8_t getPstrlen() const { return pstrlen_; } - const unsigned char* getPstr() const { - return pstr_; - } + const unsigned char* getPstr() const { return pstr_; } - const unsigned char* getReserved() const { - return reserved_; - } + const unsigned char* getReserved() const { return reserved_; } - const unsigned char* getInfoHash() const { - return infoHash_; - } + const unsigned char* getInfoHash() const { return infoHash_; } void setInfoHash(const unsigned char* infoHash); - const unsigned char* getPeerId() const { - return peerId_; - } + const unsigned char* getPeerId() const { return peerId_; } void setPeerId(const unsigned char* peerId); }; diff --git a/src/BtHandshakeMessageValidator.cc b/src/BtHandshakeMessageValidator.cc index 212e2193..e0e16ca4 100644 --- a/src/BtHandshakeMessageValidator.cc +++ b/src/BtHandshakeMessageValidator.cc @@ -43,9 +43,9 @@ namespace aria2 { -BtHandshakeMessageValidator::BtHandshakeMessageValidator -(const BtHandshakeMessage* message, const unsigned char* infoHash) - : message_(message) +BtHandshakeMessageValidator::BtHandshakeMessageValidator( + const BtHandshakeMessage* message, const unsigned char* infoHash) + : message_(message) { memcpy(infoHash_, infoHash, sizeof(infoHash_)); } @@ -54,22 +54,20 @@ BtHandshakeMessageValidator::~BtHandshakeMessageValidator() {} void BtHandshakeMessageValidator::validate() { - if(message_->getPstrlen() != 19) { - throw DL_ABORT_EX(fmt("invalid handshake pstrlen=%u", - message_->getPstrlen())); + if (message_->getPstrlen() != 19) { + throw DL_ABORT_EX( + fmt("invalid handshake pstrlen=%u", message_->getPstrlen())); } - if(memcmp(BtHandshakeMessage::BT_PSTR, message_->getPstr(), 19) != 0) { - throw DL_ABORT_EX - (fmt("invalid handshake pstr=%s", - util::percentEncode - (message_->getPstr(), 19).c_str())); + if (memcmp(BtHandshakeMessage::BT_PSTR, message_->getPstr(), 19) != 0) { + throw DL_ABORT_EX( + fmt("invalid handshake pstr=%s", + util::percentEncode(message_->getPstr(), 19).c_str())); } - if(memcmp(infoHash_, message_->getInfoHash(), sizeof(infoHash_)) != 0) { - throw DL_ABORT_EX - (fmt("invalid handshake info hash: expected:%s, actual:%s", - util::toHex(infoHash_, sizeof(infoHash_)).c_str(), - util::toHex(message_->getInfoHash(), - INFO_HASH_LENGTH).c_str())); + if (memcmp(infoHash_, message_->getInfoHash(), sizeof(infoHash_)) != 0) { + throw DL_ABORT_EX( + fmt("invalid handshake info hash: expected:%s, actual:%s", + util::toHex(infoHash_, sizeof(infoHash_)).c_str(), + util::toHex(message_->getInfoHash(), INFO_HASH_LENGTH).c_str())); } } diff --git a/src/BtHandshakeMessageValidator.h b/src/BtHandshakeMessageValidator.h index 992aec04..4182a4b5 100644 --- a/src/BtHandshakeMessageValidator.h +++ b/src/BtHandshakeMessageValidator.h @@ -49,6 +49,7 @@ class BtHandshakeMessageValidator : public BtMessageValidator { private: const BtHandshakeMessage* message_; unsigned char infoHash_[INFO_HASH_LENGTH]; + public: BtHandshakeMessageValidator(const BtHandshakeMessage* message, const unsigned char* infoHash); diff --git a/src/BtHaveAllMessage.cc b/src/BtHaveAllMessage.cc index 9bf23472..35e47807 100644 --- a/src/BtHaveAllMessage.cc +++ b/src/BtHaveAllMessage.cc @@ -43,30 +43,29 @@ namespace aria2 { const char BtHaveAllMessage::NAME[] = "have all"; -BtHaveAllMessage::BtHaveAllMessage():ZeroBtMessage(ID, NAME) {} +BtHaveAllMessage::BtHaveAllMessage() : ZeroBtMessage(ID, NAME) {} -std::unique_ptr BtHaveAllMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtHaveAllMessage::create(const unsigned char* data, size_t dataLength) { return ZeroBtMessage::create(data, dataLength); } void BtHaveAllMessage::doReceivedAction() { - if(!getPeer()->isFastExtensionEnabled()) { - throw DL_ABORT_EX - (fmt("%s received while fast extension is disabled", - toString().c_str())); + if (!getPeer()->isFastExtensionEnabled()) { + throw DL_ABORT_EX(fmt("%s received while fast extension is disabled", + toString().c_str())); } - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } getPieceStorage()->subtractPieceStats(getPeer()->getBitfield(), getPeer()->getBitfieldLength()); getPeer()->setAllBitfield(); - getPieceStorage()->addPieceStats - (getPeer()->getBitfield(), getPeer()->getBitfieldLength()); - if(getPeer()->isSeeder() && getPieceStorage()->downloadFinished()) { + getPieceStorage()->addPieceStats(getPeer()->getBitfield(), + getPeer()->getBitfieldLength()); + if (getPeer()->isSeeder() && getPieceStorage()->downloadFinished()) { throw DL_ABORT_EX(MSG_GOOD_BYE_SEEDER); } } diff --git a/src/BtHaveAllMessage.h b/src/BtHaveAllMessage.h index efa31dd6..d5c17205 100644 --- a/src/BtHaveAllMessage.h +++ b/src/BtHaveAllMessage.h @@ -47,8 +47,8 @@ public: static const char NAME[]; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; }; diff --git a/src/BtHaveMessage.cc b/src/BtHaveMessage.cc index 22b3c27a..246526f8 100644 --- a/src/BtHaveMessage.cc +++ b/src/BtHaveMessage.cc @@ -42,24 +42,24 @@ namespace aria2 { const char BtHaveMessage::NAME[] = "have"; -BtHaveMessage::BtHaveMessage(size_t index):IndexBtMessage(ID, NAME, index) {} +BtHaveMessage::BtHaveMessage(size_t index) : IndexBtMessage(ID, NAME, index) {} -std::unique_ptr BtHaveMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr BtHaveMessage::create(const unsigned char* data, + size_t dataLength) { return IndexBtMessage::create(data, dataLength); } void BtHaveMessage::doReceivedAction() { - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } size_t index = getIndex(); - if(!getPeer()->hasPiece(index)) { + if (!getPeer()->hasPiece(index)) { getPeer()->updateBitfield(index, 1); getPieceStorage()->addPieceStats(index); - if(getPeer()->isSeeder() && getPieceStorage()->downloadFinished()) { + if (getPeer()->isSeeder() && getPieceStorage()->downloadFinished()) { throw DL_ABORT_EX(MSG_GOOD_BYE_SEEDER); } } diff --git a/src/BtHaveMessage.h b/src/BtHaveMessage.h index 45ca574d..6c6cceef 100644 --- a/src/BtHaveMessage.h +++ b/src/BtHaveMessage.h @@ -47,8 +47,8 @@ public: static const char NAME[]; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; }; diff --git a/src/BtHaveNoneMessage.cc b/src/BtHaveNoneMessage.cc index 6f1e5460..21cbb61b 100644 --- a/src/BtHaveNoneMessage.cc +++ b/src/BtHaveNoneMessage.cc @@ -41,20 +41,19 @@ namespace aria2 { const char BtHaveNoneMessage::NAME[] = "have none"; -BtHaveNoneMessage::BtHaveNoneMessage():ZeroBtMessage(ID, NAME) {} +BtHaveNoneMessage::BtHaveNoneMessage() : ZeroBtMessage(ID, NAME) {} -std::unique_ptr BtHaveNoneMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtHaveNoneMessage::create(const unsigned char* data, size_t dataLength) { return ZeroBtMessage::create(data, dataLength); } void BtHaveNoneMessage::doReceivedAction() { - if(!getPeer()->isFastExtensionEnabled()) { - throw DL_ABORT_EX - (fmt("%s received while fast extension is disabled", - toString().c_str())); + if (!getPeer()->isFastExtensionEnabled()) { + throw DL_ABORT_EX(fmt("%s received while fast extension is disabled", + toString().c_str())); } } diff --git a/src/BtHaveNoneMessage.h b/src/BtHaveNoneMessage.h index f68cd2d5..3ef74e39 100644 --- a/src/BtHaveNoneMessage.h +++ b/src/BtHaveNoneMessage.h @@ -47,8 +47,8 @@ public: static const char NAME[]; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; }; diff --git a/src/BtInteractive.h b/src/BtInteractive.h index a6881dfd..33f55586 100644 --- a/src/BtInteractive.h +++ b/src/BtInteractive.h @@ -41,7 +41,6 @@ namespace aria2 { - class BtHandshakeMessage; class BtInteractive { @@ -50,8 +49,8 @@ public: virtual void initiateHandshake() = 0; - virtual std::unique_ptr receiveHandshake - (bool quickReply = false) = 0; + virtual std::unique_ptr + receiveHandshake(bool quickReply = false) = 0; virtual std::unique_ptr receiveAndSendHandshake() = 0; diff --git a/src/BtInterestedMessage.cc b/src/BtInterestedMessage.cc index 2ef30600..c3c9fec2 100644 --- a/src/BtInterestedMessage.cc +++ b/src/BtInterestedMessage.cc @@ -42,25 +42,25 @@ namespace aria2 { const char BtInterestedMessage::NAME[] = "interested"; BtInterestedMessage::BtInterestedMessage() - : ZeroBtMessage(ID, NAME), - peerStorage_(nullptr) -{} + : ZeroBtMessage(ID, NAME), peerStorage_(nullptr) +{ +} BtInterestedMessage::~BtInterestedMessage() {} -std::unique_ptr BtInterestedMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtInterestedMessage::create(const unsigned char* data, size_t dataLength) { return ZeroBtMessage::create(data, dataLength); } void BtInterestedMessage::doReceivedAction() { - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } getPeer()->peerInterested(true); - if(!getPeer()->amChoking()) { + if (!getPeer()->amChoking()) { peerStorage_->executeChoke(); } } @@ -72,11 +72,10 @@ bool BtInterestedMessage::sendPredicate() const namespace { struct ThisProgressUpdate : public ProgressUpdate { - ThisProgressUpdate(std::shared_ptr peer) - : peer(std::move(peer)) {} + ThisProgressUpdate(std::shared_ptr peer) : peer(std::move(peer)) {} virtual void update(size_t length, bool complete) CXX11_OVERRIDE { - if(complete) { + if (complete) { peer->amInterested(true); } } diff --git a/src/BtInterestedMessage.h b/src/BtInterestedMessage.h index a11303a7..31d898e7 100644 --- a/src/BtInterestedMessage.h +++ b/src/BtInterestedMessage.h @@ -45,6 +45,7 @@ class BtInterestedMessage; class BtInterestedMessage : public ZeroBtMessage { private: PeerStorage* peerStorage_; + public: BtInterestedMessage(); virtual ~BtInterestedMessage(); @@ -53,8 +54,8 @@ public: static const char NAME[]; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; diff --git a/src/BtKeepAliveMessage.cc b/src/BtKeepAliveMessage.cc index 998426b6..c9fe7937 100644 --- a/src/BtKeepAliveMessage.cc +++ b/src/BtKeepAliveMessage.cc @@ -50,9 +50,6 @@ unsigned char* BtKeepAliveMessage::createMessage() return msg; } -size_t BtKeepAliveMessage::getMessageLength() -{ - return MESSAGE_LENGTH; -} +size_t BtKeepAliveMessage::getMessageLength() { return MESSAGE_LENGTH; } } // namespace aria2 diff --git a/src/BtKeepAliveMessage.h b/src/BtKeepAliveMessage.h index 8ee940ea..23c0e73a 100644 --- a/src/BtKeepAliveMessage.h +++ b/src/BtKeepAliveMessage.h @@ -42,8 +42,9 @@ namespace aria2 { class BtKeepAliveMessage : public SimpleBtMessage { private: static const size_t MESSAGE_LENGTH = 4; + public: - BtKeepAliveMessage():SimpleBtMessage(ID, NAME) {} + BtKeepAliveMessage() : SimpleBtMessage(ID, NAME) {} static const uint8_t ID = 99; @@ -55,10 +56,7 @@ public: virtual size_t getMessageLength() CXX11_OVERRIDE; - virtual std::string toString() const CXX11_OVERRIDE - { - return NAME; - } + virtual std::string toString() const CXX11_OVERRIDE { return NAME; } }; } // namespace aria2 diff --git a/src/BtLeecherStateChoke.cc b/src/BtLeecherStateChoke.cc index a7ddd58f..72d0be9f 100644 --- a/src/BtLeecherStateChoke.cc +++ b/src/BtLeecherStateChoke.cc @@ -46,27 +46,28 @@ namespace aria2 { BtLeecherStateChoke::BtLeecherStateChoke() - : round_(0), - lastRound_(Timer::zero()) -{} + : round_(0), lastRound_(Timer::zero()) +{ +} BtLeecherStateChoke::~BtLeecherStateChoke() {} BtLeecherStateChoke::PeerEntry::PeerEntry(const std::shared_ptr& peer) - : peer_(peer), - downloadSpeed_(peer->calculateDownloadSpeed()), - // peer must be interested to us and sent block in the last 30 seconds - regularUnchoker_( - peer->peerInterested() && - peer->getLastDownloadUpdate().difference(global::wallclock()) < 30_s) + : peer_(peer), + downloadSpeed_(peer->calculateDownloadSpeed()), + // peer must be interested to us and sent block in the last 30 seconds + regularUnchoker_( + peer->peerInterested() && + peer->getLastDownloadUpdate().difference(global::wallclock()) < 30_s) { } BtLeecherStateChoke::PeerEntry::PeerEntry(const PeerEntry& c) - : peer_(c.peer_), - downloadSpeed_(c.downloadSpeed_), - regularUnchoker_(c.regularUnchoker_) -{} + : peer_(c.peer_), + downloadSpeed_(c.downloadSpeed_), + regularUnchoker_(c.regularUnchoker_) +{ +} void BtLeecherStateChoke::PeerEntry::swap(PeerEntry& c) { @@ -76,10 +77,10 @@ void BtLeecherStateChoke::PeerEntry::swap(PeerEntry& c) swap(regularUnchoker_, c.regularUnchoker_); } -BtLeecherStateChoke::PeerEntry& BtLeecherStateChoke::PeerEntry::operator= -(const PeerEntry& c) +BtLeecherStateChoke::PeerEntry& BtLeecherStateChoke::PeerEntry:: +operator=(const PeerEntry& c) { - if(this != &c) { + if (this != &c) { peer_ = c.peer_; downloadSpeed_ = c.downloadSpeed_; regularUnchoker_ = c.regularUnchoker_; @@ -129,29 +130,27 @@ bool BtLeecherStateChoke::PeerEntry::operator<(const PeerEntry& peerEntry) const return downloadSpeed_ > peerEntry.downloadSpeed_; } -void swap -(BtLeecherStateChoke::PeerEntry& a, - BtLeecherStateChoke::PeerEntry& b) +void swap(BtLeecherStateChoke::PeerEntry& a, BtLeecherStateChoke::PeerEntry& b) { a.swap(b); } -bool BtLeecherStateChoke::PeerFilter::operator() - (const PeerEntry& peerEntry) const +bool BtLeecherStateChoke::PeerFilter:: +operator()(const PeerEntry& peerEntry) const { return peerEntry.getPeer()->amChoking() == amChoking_ && - peerEntry.getPeer()->peerInterested() == peerInterested_; + peerEntry.getPeer()->peerInterested() == peerInterested_; } -void BtLeecherStateChoke::plannedOptimisticUnchoke -(std::vector& peerEntries) +void BtLeecherStateChoke::plannedOptimisticUnchoke( + std::vector& peerEntries) { std::for_each(std::begin(peerEntries), std::end(peerEntries), std::mem_fn(&PeerEntry::disableOptUnchoking)); auto i = std::partition(std::begin(peerEntries), std::end(peerEntries), PeerFilter(true, true)); - if(i != std::begin(peerEntries)) { + if (i != std::begin(peerEntries)) { std::shuffle(std::begin(peerEntries), i, *SimpleRandomizer::getInstance()); (*std::begin(peerEntries)).enableOptUnchoking(); A2_LOG_INFO( @@ -172,25 +171,26 @@ void BtLeecherStateChoke::regularUnchoke(std::vector& peerEntries) bool fastOptUnchoker = false; auto peerIter = std::begin(peerEntries); - for(;peerIter != rest && count; ++peerIter, --count) { + for (; peerIter != rest && count; ++peerIter, --count) { peerIter->disableChokingRequired(); A2_LOG_INFO(fmt("RU: %s, dlspd=%d", (*peerIter).getPeer()->getIPAddress().c_str(), (*peerIter).getDownloadSpeed())); - if(peerIter->getPeer()->optUnchoking()) { + if (peerIter->getPeer()->optUnchoking()) { fastOptUnchoker = true; peerIter->disableOptUnchoking(); } } - if(fastOptUnchoker) { + if (fastOptUnchoker) { std::shuffle(peerIter, std::end(peerEntries), *SimpleRandomizer::getInstance()); for (auto& p : peerEntries) { - if(p.getPeer()->peerInterested()) { + if (p.getPeer()->peerInterested()) { p.enableOptUnchoking(); A2_LOG_INFO(fmt("OU: %s", p.getPeer()->getIPAddress().c_str())); break; - } else { + } + else { p.disableChokingRequired(); A2_LOG_INFO(fmt("OU: %s", p.getPeer()->getIPAddress().c_str())); } @@ -205,26 +205,23 @@ void BtLeecherStateChoke::executeChoke(const PeerSet& peerSet) std::vector peerEntries; for (const auto& p : peerSet) { - if(p->isActive() && !p->snubbing()) { + if (p->isActive() && !p->snubbing()) { p->chokingRequired(true); peerEntries.push_back(PeerEntry(p)); } } // planned optimistic unchoke - if(round_ == 0) { + if (round_ == 0) { plannedOptimisticUnchoke(peerEntries); } regularUnchoke(peerEntries); - if(++round_ == 3) { + if (++round_ == 3) { round_ = 0; } } -const Timer& BtLeecherStateChoke::getLastRound() const -{ - return lastRound_; -} +const Timer& BtLeecherStateChoke::getLastRound() const { return lastRound_; } } // namespace aria2 diff --git a/src/BtLeecherStateChoke.h b/src/BtLeecherStateChoke.h index cfe0cfc0..aefc388a 100644 --- a/src/BtLeecherStateChoke.h +++ b/src/BtLeecherStateChoke.h @@ -58,6 +58,7 @@ private: std::shared_ptr peer_; int downloadSpeed_; bool regularUnchoker_; + public: PeerEntry(const std::shared_ptr& peer); PeerEntry(const PeerEntry& c); @@ -92,13 +93,16 @@ private: private: bool amChoking_; bool peerInterested_; + public: - PeerFilter(bool amChoking, bool peerInterested): - amChoking_(amChoking), - peerInterested_(peerInterested) {} + PeerFilter(bool amChoking, bool peerInterested) + : amChoking_(amChoking), peerInterested_(peerInterested) + { + } bool operator()(const PeerEntry& peerEntry) const; }; + public: BtLeecherStateChoke(); @@ -111,9 +115,7 @@ public: friend void swap(PeerEntry& a, PeerEntry& b); }; -void swap -(BtLeecherStateChoke::PeerEntry& a, - BtLeecherStateChoke::PeerEntry& b); +void swap(BtLeecherStateChoke::PeerEntry& a, BtLeecherStateChoke::PeerEntry& b); } // namespace aria2 diff --git a/src/BtMessage.h b/src/BtMessage.h index 5770dc13..7b60a5a3 100644 --- a/src/BtMessage.h +++ b/src/BtMessage.h @@ -50,8 +50,9 @@ class BtEvent; class BtMessage { private: uint8_t id_; + public: - BtMessage(uint8_t id):id_(id) {} + BtMessage(uint8_t id) : id_(id) {} virtual ~BtMessage() {} @@ -67,18 +68,17 @@ public: virtual void validate() = 0; - virtual void onAbortOutstandingRequestEvent - (const BtAbortOutstandingRequestEvent& event) = 0; + virtual void onAbortOutstandingRequestEvent( + const BtAbortOutstandingRequestEvent& event) = 0; - virtual void onCancelSendingPieceEvent - (const BtCancelSendingPieceEvent& event) = 0; + virtual void + onCancelSendingPieceEvent(const BtCancelSendingPieceEvent& event) = 0; virtual void onChokingEvent(const BtChokingEvent& event) = 0; virtual void onQueued() = 0; virtual std::string toString() const = 0; - }; } // namespace aria2 diff --git a/src/BtMessageDispatcher.h b/src/BtMessageDispatcher.h index 6f587630..7f4b986a 100644 --- a/src/BtMessageDispatcher.h +++ b/src/BtMessageDispatcher.h @@ -55,12 +55,14 @@ public: virtual void sendMessages() = 0; - virtual void doCancelSendingPieceAction - (size_t index, int32_t begin, int32_t length) = 0; + virtual void doCancelSendingPieceAction(size_t index, int32_t begin, + int32_t length) = 0; - virtual void doCancelSendingPieceAction(const std::shared_ptr& piece) = 0; + virtual void + doCancelSendingPieceAction(const std::shared_ptr& piece) = 0; - virtual void doAbortOutstandingRequestAction(const std::shared_ptr& piece) = 0; + virtual void + doAbortOutstandingRequestAction(const std::shared_ptr& piece) = 0; virtual void doChokedAction() = 0; @@ -76,8 +78,8 @@ public: virtual bool isOutstandingRequest(size_t index, size_t blockIndex) = 0; - virtual const RequestSlot* getOutstandingRequest - (size_t index, int32_t begin, int32_t length) = 0; + virtual const RequestSlot* getOutstandingRequest(size_t index, int32_t begin, + int32_t length) = 0; virtual void removeOutstandingRequest(const RequestSlot* slot) = 0; diff --git a/src/BtMessageFactory.h b/src/BtMessageFactory.h index fb9e41fd..42940be7 100644 --- a/src/BtMessageFactory.h +++ b/src/BtMessageFactory.h @@ -66,8 +66,8 @@ class BtMessageFactory { public: virtual ~BtMessageFactory() {} - virtual std::unique_ptr - createBtMessage(const unsigned char* msg, size_t msgLength) = 0; + virtual std::unique_ptr createBtMessage(const unsigned char* msg, + size_t msgLength) = 0; virtual std::unique_ptr createHandshakeMessage(const unsigned char* msg, size_t msgLength) = 0; diff --git a/src/BtMessageReceiver.h b/src/BtMessageReceiver.h index 6651d2d2..ea72dc7c 100644 --- a/src/BtMessageReceiver.h +++ b/src/BtMessageReceiver.h @@ -48,8 +48,8 @@ class BtMessageReceiver { public: virtual ~BtMessageReceiver() {} - virtual std::unique_ptr receiveHandshake - (bool quickReply = false) = 0; + virtual std::unique_ptr + receiveHandshake(bool quickReply = false) = 0; virtual std::unique_ptr receiveAndSendHandshake() = 0; diff --git a/src/BtNotInterestedMessage.cc b/src/BtNotInterestedMessage.cc index c79a27de..45c39de1 100644 --- a/src/BtNotInterestedMessage.cc +++ b/src/BtNotInterestedMessage.cc @@ -42,25 +42,25 @@ namespace aria2 { const char BtNotInterestedMessage::NAME[] = "not interested"; BtNotInterestedMessage::BtNotInterestedMessage() - : ZeroBtMessage(ID, NAME), - peerStorage_(nullptr) -{} + : ZeroBtMessage(ID, NAME), peerStorage_(nullptr) +{ +} BtNotInterestedMessage::~BtNotInterestedMessage() {} -std::unique_ptr BtNotInterestedMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtNotInterestedMessage::create(const unsigned char* data, size_t dataLength) { return ZeroBtMessage::create(data, dataLength); } void BtNotInterestedMessage::doReceivedAction() { - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } getPeer()->peerInterested(false); - if(!getPeer()->amChoking()) { + if (!getPeer()->amChoking()) { peerStorage_->executeChoke(); } } @@ -72,11 +72,10 @@ bool BtNotInterestedMessage::sendPredicate() const namespace { struct ThisProgressUpdate : public ProgressUpdate { - ThisProgressUpdate(std::shared_ptr peer) - : peer(std::move(peer)) {} + ThisProgressUpdate(std::shared_ptr peer) : peer(std::move(peer)) {} virtual void update(size_t length, bool complete) CXX11_OVERRIDE { - if(complete) { + if (complete) { peer->amInterested(false); } } diff --git a/src/BtNotInterestedMessage.h b/src/BtNotInterestedMessage.h index 9461b726..ae958bf5 100644 --- a/src/BtNotInterestedMessage.h +++ b/src/BtNotInterestedMessage.h @@ -45,6 +45,7 @@ class BtNotInterestedMessage; class BtNotInterestedMessage : public ZeroBtMessage { private: PeerStorage* peerStorage_; + public: BtNotInterestedMessage(); virtual ~BtNotInterestedMessage(); @@ -53,8 +54,8 @@ public: static const char NAME[]; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr + create(const unsigned char* data, size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; diff --git a/src/BtPieceMessage.cc b/src/BtPieceMessage.cc index 010e31c5..354f97d5 100644 --- a/src/BtPieceMessage.cc +++ b/src/BtPieceMessage.cc @@ -66,93 +66,88 @@ namespace aria2 { const char BtPieceMessage::NAME[] = "piece"; -BtPieceMessage::BtPieceMessage -(size_t index, int32_t begin, int32_t blockLength) - : AbstractBtMessage(ID, NAME), - index_(index), - begin_(begin), - blockLength_(blockLength), - data_(nullptr), - downloadContext_(nullptr), - peerStorage_(nullptr) +BtPieceMessage::BtPieceMessage(size_t index, int32_t begin, int32_t blockLength) + : AbstractBtMessage(ID, NAME), + index_(index), + begin_(begin), + blockLength_(blockLength), + data_(nullptr), + downloadContext_(nullptr), + peerStorage_(nullptr) { setUploading(true); } -BtPieceMessage::~BtPieceMessage() -{} +BtPieceMessage::~BtPieceMessage() {} -void BtPieceMessage::setMsgPayload(const unsigned char* data) -{ - data_ = data; -} +void BtPieceMessage::setMsgPayload(const unsigned char* data) { data_ = data; } -std::unique_ptr BtPieceMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtPieceMessage::create(const unsigned char* data, size_t dataLength) { bittorrent::assertPayloadLengthGreater(9, dataLength, NAME); bittorrent::assertID(ID, data, NAME); return make_unique(bittorrent::getIntParam(data, 1), bittorrent::getIntParam(data, 5), - dataLength-9); + dataLength - 9); } void BtPieceMessage::doReceivedAction() { - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } - auto slot = getBtMessageDispatcher()->getOutstandingRequest - (index_, begin_, blockLength_); - getPeer()->updateDownloadLength(blockLength_); - downloadContext_->updateDownloadLength(blockLength_); - if(slot) { + auto slot = getBtMessageDispatcher()->getOutstandingRequest(index_, begin_, + blockLength_); + getPeer()->updateDownload(blockLength_); + downloadContext_->updateDownload(blockLength_); + if (slot) { getPeer()->snubbing(false); std::shared_ptr piece = getPieceStorage()->getPiece(index_); int64_t offset = - static_cast(index_)*downloadContext_->getPieceLength()+begin_; - A2_LOG_DEBUG(fmt(MSG_PIECE_RECEIVED, - getCuid(), - static_cast(index_), - begin_, - blockLength_, + static_cast(index_) * downloadContext_->getPieceLength() + + begin_; + A2_LOG_DEBUG(fmt(MSG_PIECE_RECEIVED, getCuid(), + static_cast(index_), begin_, blockLength_, static_cast(offset), static_cast(slot->getBlockIndex()))); - if(piece->hasBlock(slot->getBlockIndex())) { + if (piece->hasBlock(slot->getBlockIndex())) { A2_LOG_DEBUG("Already have this block."); return; } - if(piece->getWrDiskCacheEntry()) { + if (piece->getWrDiskCacheEntry()) { // Write Disk Cache enabled. Unfortunately, it incurs extra data // copy. auto dataCopy = new unsigned char[blockLength_]; - memcpy(dataCopy, data_+9, blockLength_); - piece->updateWrCache(getPieceStorage()->getWrDiskCache(), - dataCopy, 0, blockLength_, blockLength_, offset); - } else { - getPieceStorage()->getDiskAdaptor()->writeData(data_+9, blockLength_, + memcpy(dataCopy, data_ + 9, blockLength_); + piece->updateWrCache(getPieceStorage()->getWrDiskCache(), dataCopy, 0, + blockLength_, blockLength_, offset); + } + else { + getPieceStorage()->getDiskAdaptor()->writeData(data_ + 9, blockLength_, offset); } piece->completeBlock(slot->getBlockIndex()); - A2_LOG_DEBUG(fmt(MSG_PIECE_BITFIELD, getCuid(), - util::toHex(piece->getBitfield(), - piece->getBitfieldLength()).c_str())); - piece->updateHash(begin_, data_+9, blockLength_); + A2_LOG_DEBUG(fmt( + MSG_PIECE_BITFIELD, getCuid(), + util::toHex(piece->getBitfield(), piece->getBitfieldLength()).c_str())); + piece->updateHash(begin_, data_ + 9, blockLength_); getBtMessageDispatcher()->removeOutstandingRequest(slot); - if(piece->pieceComplete()) { - if(checkPieceHash(piece)) { + if (piece->pieceComplete()) { + if (checkPieceHash(piece)) { onNewPiece(piece); - } else { + } + else { onWrongPiece(piece); peerStorage_->addBadPeer(getPeer()->getIPAddress()); throw DL_ABORT_EX("Bad piece hash."); } } - } else { - A2_LOG_DEBUG(fmt("CUID#%" PRId64 " - RequestSlot not found, index=%lu, begin=%d", - getCuid(), - static_cast(index_), - begin_)); + } + else { + A2_LOG_DEBUG(fmt("CUID#%" PRId64 + " - RequestSlot not found, index=%lu, begin=%d", + getCuid(), static_cast(index_), begin_)); } } @@ -168,7 +163,7 @@ void BtPieceMessage::createMessageHeader(unsigned char* msgHeader) const * total: 13bytes */ bittorrent::createPeerMessageString(msgHeader, MESSAGE_HEADER_LENGTH, - 9+blockLength_, ID); + 9 + blockLength_, ID); bittorrent::setIntParam(&msgHeader[5], index_); bittorrent::setIntParam(&msgHeader[9], begin_); } @@ -180,17 +175,22 @@ size_t BtPieceMessage::getMessageHeaderLength() namespace { struct PieceSendUpdate : public ProgressUpdate { - PieceSendUpdate(std::shared_ptr peer, size_t headerLength) - : peer(std::move(peer)), headerLength(headerLength) {} + PieceSendUpdate(DownloadContext* dctx, std::shared_ptr peer, + size_t headerLength) + : dctx(dctx), peer(std::move(peer)), headerLength(headerLength) + { + } virtual void update(size_t length, bool complete) CXX11_OVERRIDE { - if(headerLength > 0) { + if (headerLength > 0) { size_t m = std::min(headerLength, length); headerLength -= m; length -= m; } peer->updateUploadLength(length); + dctx->updateUploadLength(length); } + DownloadContext* dctx; std::shared_ptr peer; size_t headerLength; }; @@ -198,62 +198,63 @@ struct PieceSendUpdate : public ProgressUpdate { void BtPieceMessage::send() { - if(isInvalidate()) { + if (isInvalidate()) { return; } - A2_LOG_INFO(fmt(MSG_SEND_PEER_MESSAGE, - getCuid(), - getPeer()->getIPAddress().c_str(), - getPeer()->getPort(), + A2_LOG_INFO(fmt(MSG_SEND_PEER_MESSAGE, getCuid(), + getPeer()->getIPAddress().c_str(), getPeer()->getPort(), toString().c_str())); int64_t pieceDataOffset = - static_cast(index_)*downloadContext_->getPieceLength()+begin_; + static_cast(index_) * downloadContext_->getPieceLength() + + begin_; pushPieceData(pieceDataOffset, blockLength_); } void BtPieceMessage::pushPieceData(int64_t offset, int32_t length) const { assert(length <= static_cast(16_k)); - auto buf = make_unique(length+MESSAGE_HEADER_LENGTH); + auto buf = make_unique(length + MESSAGE_HEADER_LENGTH); createMessageHeader(buf.get()); ssize_t r; - r = getPieceStorage()->getDiskAdaptor()->readData - (buf.get()+MESSAGE_HEADER_LENGTH, length, offset); - if(r == length) { - getPeerConnection()->pushBytes(buf.release(), length+MESSAGE_HEADER_LENGTH, - make_unique - (getPeer(), MESSAGE_HEADER_LENGTH)); - // To avoid upload rate overflow, we update the length here at - // once. - downloadContext_->updateUploadLength(length); - } else { + r = getPieceStorage()->getDiskAdaptor()->readData( + buf.get() + MESSAGE_HEADER_LENGTH, length, offset); + if (r == length) { + const auto& peer = getPeer(); + getPeerConnection()->pushBytes( + buf.release(), length + MESSAGE_HEADER_LENGTH, + make_unique(downloadContext_, peer, + MESSAGE_HEADER_LENGTH)); + peer->updateUploadSpeed(length); + downloadContext_->updateUploadSpeed(length); + } + else { throw DL_ABORT_EX(EX_DATA_READ); } } std::string BtPieceMessage::toString() const { - return fmt("%s index=%lu, begin=%d, length=%d", - NAME, - static_cast(index_), - begin_, blockLength_); + return fmt("%s index=%lu, begin=%d, length=%d", NAME, + static_cast(index_), begin_, blockLength_); } bool BtPieceMessage::checkPieceHash(const std::shared_ptr& piece) { - if(!getPieceStorage()->isEndGame() && piece->isHashCalculated()) { + if (!getPieceStorage()->isEndGame() && piece->isHashCalculated()) { A2_LOG_DEBUG(fmt("Hash is available!! index=%lu", static_cast(piece->getIndex()))); - return - piece->getDigest() == downloadContext_->getPieceHash(piece->getIndex()); - } else { + return piece->getDigest() == + downloadContext_->getPieceHash(piece->getIndex()); + } + else { A2_LOG_DEBUG(fmt("Calculating hash index=%lu", static_cast(piece->getIndex()))); try { return piece->getDigestWithWrCache(downloadContext_->getPieceLength(), - getPieceStorage()->getDiskAdaptor()) - == downloadContext_->getPieceHash(piece->getIndex()); - } catch(RecoverableException& e) { + getPieceStorage()->getDiskAdaptor()) == + downloadContext_->getPieceHash(piece->getIndex()); + } + catch (RecoverableException& e) { piece->clearAllBlock(getPieceStorage()->getWrDiskCache()); throw; } @@ -262,20 +263,19 @@ bool BtPieceMessage::checkPieceHash(const std::shared_ptr& piece) void BtPieceMessage::onNewPiece(const std::shared_ptr& piece) { - if(piece->getWrDiskCacheEntry()) { + if (piece->getWrDiskCacheEntry()) { // We flush cached data whenever an whole piece is retrieved. - piece->flushWrCache(getPieceStorage()->getWrDiskCache()); - if(piece->getWrDiskCacheEntry()->getError() != + piece->flushWrCache(getPieceStorage()->getWrDiskCache()); + if (piece->getWrDiskCacheEntry()->getError() != WrDiskCacheEntry::CACHE_ERR_SUCCESS) { - piece->clearAllBlock(getPieceStorage()->getWrDiskCache()); - throw DOWNLOAD_FAILURE_EXCEPTION2 - (fmt("Write disk cache flush failure index=%lu", + piece->clearAllBlock(getPieceStorage()->getWrDiskCache()); + throw DOWNLOAD_FAILURE_EXCEPTION2( + fmt("Write disk cache flush failure index=%lu", static_cast(piece->getIndex())), piece->getWrDiskCacheEntry()->getErrorCode()); - } + } } - A2_LOG_INFO(fmt(MSG_GOT_NEW_PIECE, - getCuid(), + A2_LOG_INFO(fmt(MSG_GOT_NEW_PIECE, getCuid(), static_cast(piece->getIndex()))); getPieceStorage()->completePiece(piece); getPieceStorage()->advertisePiece(getCuid(), piece->getIndex()); @@ -283,8 +283,7 @@ void BtPieceMessage::onNewPiece(const std::shared_ptr& piece) void BtPieceMessage::onWrongPiece(const std::shared_ptr& piece) { - A2_LOG_INFO(fmt(MSG_GOT_WRONG_PIECE, - getCuid(), + A2_LOG_INFO(fmt(MSG_GOT_WRONG_PIECE, getCuid(), static_cast(piece->getIndex()))); piece->clearAllBlock(getPieceStorage()->getWrDiskCache()); piece->destroyHashContext(); @@ -293,38 +292,29 @@ void BtPieceMessage::onWrongPiece(const std::shared_ptr& piece) void BtPieceMessage::onChokingEvent(const BtChokingEvent& event) { - if(!isInvalidate() && - !getPeer()->isInAmAllowedIndexSet(index_)) { - A2_LOG_DEBUG(fmt(MSG_REJECT_PIECE_CHOKED, - getCuid(), - static_cast(index_), - begin_, - blockLength_)); - if(getPeer()->isFastExtensionEnabled()) { - getBtMessageDispatcher()->addMessageToQueue - (getBtMessageFactory()->createRejectMessage - (index_, begin_, blockLength_)); + if (!isInvalidate() && !getPeer()->isInAmAllowedIndexSet(index_)) { + A2_LOG_DEBUG(fmt(MSG_REJECT_PIECE_CHOKED, getCuid(), + static_cast(index_), begin_, blockLength_)); + if (getPeer()->isFastExtensionEnabled()) { + getBtMessageDispatcher()->addMessageToQueue( + getBtMessageFactory()->createRejectMessage(index_, begin_, + blockLength_)); } setInvalidate(true); } } -void BtPieceMessage::onCancelSendingPieceEvent -(const BtCancelSendingPieceEvent& event) +void BtPieceMessage::onCancelSendingPieceEvent( + const BtCancelSendingPieceEvent& event) { - if(!isInvalidate() && - index_ == event.getIndex() && - begin_ == event.getBegin() && - blockLength_ == event.getLength()) { - A2_LOG_DEBUG(fmt(MSG_REJECT_PIECE_CANCEL, - getCuid(), - static_cast(index_), - begin_, - blockLength_)); - if(getPeer()->isFastExtensionEnabled()) { - getBtMessageDispatcher()->addMessageToQueue - (getBtMessageFactory()->createRejectMessage - (index_, begin_, blockLength_)); + if (!isInvalidate() && index_ == event.getIndex() && + begin_ == event.getBegin() && blockLength_ == event.getLength()) { + A2_LOG_DEBUG(fmt(MSG_REJECT_PIECE_CANCEL, getCuid(), + static_cast(index_), begin_, blockLength_)); + if (getPeer()->isFastExtensionEnabled()) { + getBtMessageDispatcher()->addMessageToQueue( + getBtMessageFactory()->createRejectMessage(index_, begin_, + blockLength_)); } setInvalidate(true); } diff --git a/src/BtPieceMessage.h b/src/BtPieceMessage.h index 6ff8470d..58d73f29 100644 --- a/src/BtPieceMessage.h +++ b/src/BtPieceMessage.h @@ -61,6 +61,7 @@ private: void onWrongPiece(const std::shared_ptr& piece); void pushPieceData(int64_t offset, int32_t length) const; + public: BtPieceMessage(size_t index = 0, int32_t begin = 0, int32_t blockLength = 0); @@ -78,7 +79,7 @@ public: void setBegin(int32_t begin) { begin_ = begin; } - const unsigned char* getBlock() const { return data_+9; } + const unsigned char* getBlock() const { return data_ + 9; } int32_t getBlockLength() const { return blockLength_; } @@ -92,8 +93,8 @@ public: void setPeerStorage(PeerStorage* peerStorage); - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; @@ -107,8 +108,8 @@ public: virtual void onChokingEvent(const BtChokingEvent& event) CXX11_OVERRIDE; - virtual void onCancelSendingPieceEvent - (const BtCancelSendingPieceEvent& event) CXX11_OVERRIDE; + virtual void onCancelSendingPieceEvent(const BtCancelSendingPieceEvent& event) + CXX11_OVERRIDE; }; } // namespace aria2 diff --git a/src/BtPieceMessageValidator.cc b/src/BtPieceMessageValidator.cc index 4b5ef38b..f8bb736d 100644 --- a/src/BtPieceMessageValidator.cc +++ b/src/BtPieceMessageValidator.cc @@ -38,12 +38,12 @@ namespace aria2 { -BtPieceMessageValidator::BtPieceMessageValidator -(const BtPieceMessage* message, size_t numPiece, int32_t pieceLength) - : message_(message), - numPiece_(numPiece), - pieceLength_(pieceLength) -{} +BtPieceMessageValidator::BtPieceMessageValidator(const BtPieceMessage* message, + size_t numPiece, + int32_t pieceLength) + : message_(message), numPiece_(numPiece), pieceLength_(pieceLength) +{ +} BtPieceMessageValidator::~BtPieceMessageValidator() {} diff --git a/src/BtPieceMessageValidator.h b/src/BtPieceMessageValidator.h index 89c9d9b1..b1e57e0b 100644 --- a/src/BtPieceMessageValidator.h +++ b/src/BtPieceMessageValidator.h @@ -46,9 +46,9 @@ private: const BtPieceMessage* message_; size_t numPiece_; int32_t pieceLength_; + public: - BtPieceMessageValidator(const BtPieceMessage* message, - size_t numPiece, + BtPieceMessageValidator(const BtPieceMessage* message, size_t numPiece, int32_t pieceLength); ~BtPieceMessageValidator(); diff --git a/src/BtPortMessage.cc b/src/BtPortMessage.cc index 1382a5d0..99b0d699 100644 --- a/src/BtPortMessage.cc +++ b/src/BtPortMessage.cc @@ -53,16 +53,17 @@ namespace aria2 { const char BtPortMessage::NAME[] = "port"; BtPortMessage::BtPortMessage(uint16_t port) - : SimpleBtMessage(ID, NAME), - port_(port), - localNode_(nullptr), - routingTable_(nullptr), - taskQueue_(nullptr), - taskFactory_(nullptr) -{} + : SimpleBtMessage(ID, NAME), + port_(port), + localNode_(nullptr), + routingTable_(nullptr), + taskQueue_(nullptr), + taskFactory_(nullptr) +{ +} -std::unique_ptr BtPortMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr BtPortMessage::create(const unsigned char* data, + size_t dataLength) { bittorrent::assertPayloadLengthEqual(3, dataLength, NAME); bittorrent::assertID(ID, data, NAME); @@ -72,8 +73,8 @@ std::unique_ptr BtPortMessage::create void BtPortMessage::doReceivedAction() { - if(taskFactory_ && taskQueue_) { - if(port_ == 0) { + if (taskFactory_ && taskQueue_) { + if (port_ == 0) { A2_LOG_DEBUG("Ignored port 0."); return; } @@ -86,15 +87,16 @@ void BtPortMessage::doReceivedAction() std::shared_ptr task = taskFactory_->createPingTask(node); taskQueue_->addImmediateTask(task); } - if(routingTable_->getNumBucket() == 1) { + if (routingTable_->getNumBucket() == 1) { // initiate bootstrap A2_LOG_INFO("Dispatch node_lookup since too few buckets."); - taskQueue_->addImmediateTask - (taskFactory_->createNodeLookupTask(localNode_->getID())); + taskQueue_->addImmediateTask( + taskFactory_->createNodeLookupTask(localNode_->getID())); } - } else { - A2_LOG_INFO - ("DHT port message received while localhost didn't declare support it."); + } + else { + A2_LOG_INFO( + "DHT port message received while localhost didn't declare support it."); } } @@ -112,18 +114,14 @@ unsigned char* BtPortMessage::createMessage() return msg; } -size_t BtPortMessage::getMessageLength() { - return MESSAGE_LENGTH; -} +size_t BtPortMessage::getMessageLength() { return MESSAGE_LENGTH; } -std::string BtPortMessage::toString() const { +std::string BtPortMessage::toString() const +{ return fmt("%s port=%u", NAME, port_); } -void BtPortMessage::setLocalNode(DHTNode* localNode) -{ - localNode_ = localNode; -} +void BtPortMessage::setLocalNode(DHTNode* localNode) { localNode_ = localNode; } void BtPortMessage::setRoutingTable(DHTRoutingTable* routingTable) { diff --git a/src/BtPortMessage.h b/src/BtPortMessage.h index 0846e125..453d74cb 100644 --- a/src/BtPortMessage.h +++ b/src/BtPortMessage.h @@ -56,6 +56,7 @@ private: DHTTaskQueue* taskQueue_; DHTTaskFactory* taskFactory_; + public: BtPortMessage(uint16_t port); @@ -65,8 +66,8 @@ public: uint16_t getPort() const { return port_; } - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; diff --git a/src/BtPostDownloadHandler.cc b/src/BtPostDownloadHandler.cc index 60a911b9..493b69c9 100644 --- a/src/BtPostDownloadHandler.cc +++ b/src/BtPostDownloadHandler.cc @@ -58,63 +58,66 @@ namespace aria2 { BtPostDownloadHandler::BtPostDownloadHandler() { - setCriteria(make_unique - (getBtContentTypes(), getBtExtensions())); + setCriteria(make_unique(getBtContentTypes(), + getBtExtensions())); } -void BtPostDownloadHandler::getNextRequestGroups -(std::vector >& groups, - RequestGroup* requestGroup) const +void BtPostDownloadHandler::getNextRequestGroups( + std::vector>& groups, + RequestGroup* requestGroup) const { A2_LOG_INFO(fmt("Generating RequestGroups for Torrent file %s", requestGroup->getFirstFilePath().c_str())); std::unique_ptr torrent; - if(requestGroup->inMemoryDownload()) { - auto& dw = static_cast - (requestGroup->getPieceStorage()->getDiskAdaptor().get()) - ->getDiskWriter(); + if (requestGroup->inMemoryDownload()) { + auto& dw = static_cast( + requestGroup->getPieceStorage()->getDiskAdaptor().get()) + ->getDiskWriter(); auto bdw = static_cast(dw.get()); int error = bdw->finalize(); - if(error == 0) { + if (error == 0) { torrent = bdw->getResult(); } - } else { + } + else { std::string content; try { requestGroup->getPieceStorage()->getDiskAdaptor()->openExistingFile(); - content = util::toString(requestGroup->getPieceStorage() - ->getDiskAdaptor()); + content = + util::toString(requestGroup->getPieceStorage()->getDiskAdaptor()); requestGroup->getPieceStorage()->getDiskAdaptor()->closeFile(); - } catch(Exception& e) { + } + catch (Exception& e) { requestGroup->getPieceStorage()->getDiskAdaptor()->closeFile(); throw; } ssize_t error; - torrent = bittorrent::ValueBaseBencodeParser().parseFinal - (content.c_str(), content.size(), error); + torrent = bittorrent::ValueBaseBencodeParser().parseFinal( + content.c_str(), content.size(), error); } - if(!torrent) { + if (!torrent) { throw DL_ABORT_EX2("Could not parse BitTorrent metainfo", error_code::BENCODE_PARSE_ERROR); } std::vector> newRgs; createRequestGroupForBitTorrent(newRgs, requestGroup->getOption(), - std::vector(), - "", + std::vector(), "", torrent.get()); requestGroup->followedBy(std::begin(newRgs), std::end(newRgs)); - auto mi = - createMetadataInfoFromFirstFileEntry(requestGroup->getGroupId(), - requestGroup->getDownloadContext()); - if(mi) { + for (auto& rg : newRgs) { + rg->following(requestGroup->getGID()); + } + auto mi = createMetadataInfoFromFirstFileEntry( + requestGroup->getGroupId(), requestGroup->getDownloadContext()); + if (mi) { setMetadataInfo(std::begin(newRgs), std::end(newRgs), mi); } auto rgman = requestGroup->getRequestGroupMan(); - if(rgman && rgman->getKeepRunning() && - requestGroup->getOption()->getAsBool(PREF_PAUSE_METADATA)) { - for(auto& rg : newRgs) { + if (rgman && rgman->getKeepRunning() && + requestGroup->getOption()->getAsBool(PREF_PAUSE_METADATA)) { + for (auto& rg : newRgs) { rg->setPauseRequested(true); } } diff --git a/src/BtPostDownloadHandler.h b/src/BtPostDownloadHandler.h index 6e99b956..5eefb6af 100644 --- a/src/BtPostDownloadHandler.h +++ b/src/BtPostDownloadHandler.h @@ -39,13 +39,12 @@ namespace aria2 { -class BtPostDownloadHandler:public PostDownloadHandler -{ +class BtPostDownloadHandler : public PostDownloadHandler { public: BtPostDownloadHandler(); virtual void - getNextRequestGroups(std::vector >& groups, + getNextRequestGroups(std::vector>& groups, RequestGroup* requestGroup) const CXX11_OVERRIDE; }; diff --git a/src/BtRegistry.cc b/src/BtRegistry.cc index 84dfd9a8..f2d33b73 100644 --- a/src/BtRegistry.cc +++ b/src/BtRegistry.cc @@ -47,18 +47,16 @@ namespace aria2 { -BtRegistry::BtRegistry() - : tcpPort_{0}, - udpPort_{0} -{} +BtRegistry::BtRegistry() : tcpPort_{0}, udpPort_{0} {} const std::shared_ptr& BtRegistry::getDownloadContext(a2_gid_t gid) const { auto res = get(gid); - if(res) { + if (res) { return res->downloadContext; - } else { + } + else { return getNull(); } } @@ -66,9 +64,9 @@ BtRegistry::getDownloadContext(a2_gid_t gid) const const std::shared_ptr& BtRegistry::getDownloadContext(const std::string& infoHash) const { - for(auto& kv : pool_) { - if(bittorrent::getTorrentAttrs(kv.second->downloadContext)->infoHash == - infoHash) { + for (auto& kv : pool_) { + if (bittorrent::getTorrentAttrs(kv.second->downloadContext)->infoHash == + infoHash) { return kv.second->downloadContext; } } @@ -83,49 +81,45 @@ void BtRegistry::put(a2_gid_t gid, std::unique_ptr obj) BtObject* BtRegistry::get(a2_gid_t gid) const { auto i = pool_.find(gid); - if(i == std::end(pool_)) { + if (i == std::end(pool_)) { return nullptr; - } else { + } + else { return (*i).second.get(); } } -bool BtRegistry::remove(a2_gid_t gid) -{ - return pool_.erase(gid); -} +bool BtRegistry::remove(a2_gid_t gid) { return pool_.erase(gid); } -void BtRegistry::removeAll() -{ - pool_.clear(); -} +void BtRegistry::removeAll() { pool_.clear(); } -void BtRegistry::setLpdMessageReceiver -(const std::shared_ptr& receiver) +void BtRegistry::setLpdMessageReceiver( + const std::shared_ptr& receiver) { lpdMessageReceiver_ = receiver; } -void BtRegistry::setUDPTrackerClient -(const std::shared_ptr& tracker) +void BtRegistry::setUDPTrackerClient( + const std::shared_ptr& tracker) { udpTrackerClient_ = tracker; } -BtObject::BtObject -(const std::shared_ptr& downloadContext, - const std::shared_ptr& pieceStorage, - const std::shared_ptr& peerStorage, - const std::shared_ptr& btAnnounce, - const std::shared_ptr& btRuntime, - const std::shared_ptr& btProgressInfoFile) - : downloadContext{downloadContext}, - pieceStorage{pieceStorage}, - peerStorage{peerStorage}, - btAnnounce{btAnnounce}, - btRuntime{btRuntime}, - btProgressInfoFile{btProgressInfoFile} -{} +BtObject::BtObject( + const std::shared_ptr& downloadContext, + const std::shared_ptr& pieceStorage, + const std::shared_ptr& peerStorage, + const std::shared_ptr& btAnnounce, + const std::shared_ptr& btRuntime, + const std::shared_ptr& btProgressInfoFile) + : downloadContext{downloadContext}, + pieceStorage{pieceStorage}, + peerStorage{peerStorage}, + btAnnounce{btAnnounce}, + btRuntime{btRuntime}, + btProgressInfoFile{btProgressInfoFile} +{ +} BtObject::BtObject() {} diff --git a/src/BtRegistry.h b/src/BtRegistry.h index dc4cab90..d5659764 100644 --- a/src/BtRegistry.h +++ b/src/BtRegistry.h @@ -80,6 +80,7 @@ private: uint16_t udpPort_; std::shared_ptr lpdMessageReceiver_; std::shared_ptr udpTrackerClient_; + public: BtRegistry(); @@ -93,10 +94,10 @@ public: BtObject* get(a2_gid_t gid) const; - template + template OutputIterator getAllDownloadContext(OutputIterator dest) { - for(auto& kv : pool_) { + for (auto& kv : pool_) { *dest++ = kv.second->downloadContext; } return dest; @@ -106,25 +107,14 @@ public: bool remove(a2_gid_t gid); - void setTcpPort(uint16_t port) - { - tcpPort_ = port; - } - uint16_t getTcpPort() const - { - return tcpPort_; - } + void setTcpPort(uint16_t port) { tcpPort_ = port; } + uint16_t getTcpPort() const { return tcpPort_; } - void setUdpPort(uint16_t port) - { - udpPort_ = port; - } - uint16_t getUdpPort() const - { - return udpPort_; - } + void setUdpPort(uint16_t port) { udpPort_ = port; } + uint16_t getUdpPort() const { return udpPort_; } - void setLpdMessageReceiver(const std::shared_ptr& receiver); + void + setLpdMessageReceiver(const std::shared_ptr& receiver); const std::shared_ptr& getLpdMessageReceiver() const { return lpdMessageReceiver_; diff --git a/src/BtRejectMessage.cc b/src/BtRejectMessage.cc index d26440ea..d9ebba30 100644 --- a/src/BtRejectMessage.cc +++ b/src/BtRejectMessage.cc @@ -43,36 +43,37 @@ namespace aria2 { const char BtRejectMessage::NAME[] = "reject"; -BtRejectMessage::BtRejectMessage -(size_t index, int32_t begin, int32_t length): - RangeBtMessage(ID, NAME, index, begin, length) {} +BtRejectMessage::BtRejectMessage(size_t index, int32_t begin, int32_t length) + : RangeBtMessage(ID, NAME, index, begin, length) +{ +} -std::unique_ptr BtRejectMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtRejectMessage::create(const unsigned char* data, size_t dataLength) { return RangeBtMessage::create(data, dataLength); } void BtRejectMessage::doReceivedAction() { - if(!getPeer()->isFastExtensionEnabled()) { - throw DL_ABORT_EX - (fmt("%s received while fast extension is disabled.", - toString().c_str())); + if (!getPeer()->isFastExtensionEnabled()) { + throw DL_ABORT_EX(fmt("%s received while fast extension is disabled.", + toString().c_str())); } - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } // TODO Current implementation does not close a connection even if // a request for this reject message has never sent. - auto slot = getBtMessageDispatcher()->getOutstandingRequest - (getIndex(), getBegin(), getLength()); - if(slot) { + auto slot = getBtMessageDispatcher()->getOutstandingRequest( + getIndex(), getBegin(), getLength()); + if (slot) { getBtMessageDispatcher()->removeOutstandingRequest(slot); - } else { - //throw DL_ABORT_EX("reject received, but it is not in the request slots."); } - + else { + // throw DL_ABORT_EX("reject received, but it is not in the request + // slots."); + } } } // namespace aria2 diff --git a/src/BtRejectMessage.h b/src/BtRejectMessage.h index 55fc8971..1e4ff271 100644 --- a/src/BtRejectMessage.h +++ b/src/BtRejectMessage.h @@ -47,8 +47,8 @@ public: static const char NAME[]; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; }; diff --git a/src/BtRequestFactory.h b/src/BtRequestFactory.h index 6f2da075..224db62d 100644 --- a/src/BtRequestFactory.h +++ b/src/BtRequestFactory.h @@ -69,15 +69,14 @@ public: * returned is capped by max. If |endGame| is true, returns * requests in end game mode. */ - virtual std::vector> createRequestMessages - (size_t max, bool endGame) = 0; + virtual std::vector> + createRequestMessages(size_t max, bool endGame) = 0; /** * Returns the list of index of pieces added using addTargetPiece() * into indexes. */ virtual std::vector getTargetPieceIndexes() const = 0; - }; } // namespace aria2 diff --git a/src/BtRequestMessage.cc b/src/BtRequestMessage.cc index 19ed7743..aa2752b0 100644 --- a/src/BtRequestMessage.cc +++ b/src/BtRequestMessage.cc @@ -45,49 +45,51 @@ namespace aria2 { const char BtRequestMessage::NAME[] = "request"; -BtRequestMessage::BtRequestMessage -(size_t index, int32_t begin, int32_t length, size_t blockIndex): - RangeBtMessage(ID, NAME, index, begin, length), - blockIndex_(blockIndex) {} +BtRequestMessage::BtRequestMessage(size_t index, int32_t begin, int32_t length, + size_t blockIndex) + : RangeBtMessage(ID, NAME, index, begin, length), blockIndex_(blockIndex) +{ +} -std::unique_ptr BtRequestMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtRequestMessage::create(const unsigned char* data, size_t dataLength) { return RangeBtMessage::create(data, dataLength); } void BtRequestMessage::doReceivedAction() { - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } - if(getPieceStorage()->hasPiece(getIndex()) && - (!getPeer()->amChoking() || - (getPeer()->amChoking() && - getPeer()->isInAmAllowedIndexSet(getIndex())))) { - getBtMessageDispatcher()->addMessageToQueue - (getBtMessageFactory()->createPieceMessage - (getIndex(), getBegin(), getLength())); - } else { - if(getPeer()->isFastExtensionEnabled()) { - getBtMessageDispatcher()->addMessageToQueue - (getBtMessageFactory()->createRejectMessage - (getIndex(), getBegin(), getLength())); + if (getPieceStorage()->hasPiece(getIndex()) && + (!getPeer()->amChoking() || + (getPeer()->amChoking() && + getPeer()->isInAmAllowedIndexSet(getIndex())))) { + getBtMessageDispatcher()->addMessageToQueue( + getBtMessageFactory()->createPieceMessage(getIndex(), getBegin(), + getLength())); + } + else { + if (getPeer()->isFastExtensionEnabled()) { + getBtMessageDispatcher()->addMessageToQueue( + getBtMessageFactory()->createRejectMessage(getIndex(), getBegin(), + getLength())); } } } void BtRequestMessage::onQueued() { - getBtMessageDispatcher()->addOutstandingRequest - (make_unique(getIndex(), getBegin(), getLength(), blockIndex_, - getPieceStorage()->getPiece(getIndex()))); + getBtMessageDispatcher()->addOutstandingRequest( + make_unique(getIndex(), getBegin(), getLength(), blockIndex_, + getPieceStorage()->getPiece(getIndex()))); } -void BtRequestMessage::onAbortOutstandingRequestEvent -(const BtAbortOutstandingRequestEvent& event) +void BtRequestMessage::onAbortOutstandingRequestEvent( + const BtAbortOutstandingRequestEvent& event) { - if(getIndex() == event.getPiece()->getIndex() && !isInvalidate()) { + if (getIndex() == event.getPiece()->getIndex() && !isInvalidate()) { setInvalidate(true); } } diff --git a/src/BtRequestMessage.h b/src/BtRequestMessage.h index 180ff274..17664bcd 100644 --- a/src/BtRequestMessage.h +++ b/src/BtRequestMessage.h @@ -42,10 +42,9 @@ namespace aria2 { class BtRequestMessage : public RangeBtMessage { private: size_t blockIndex_; + public: - BtRequestMessage(size_t index = 0, - int32_t begin = 0, - int32_t length = 0, + BtRequestMessage(size_t index = 0, int32_t begin = 0, int32_t length = 0, size_t blockIndex = 0); static const uint8_t ID = 6; @@ -55,15 +54,15 @@ public: size_t getBlockIndex() const { return blockIndex_; } void setBlockIndex(size_t blockIndex) { blockIndex_ = blockIndex; } - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; virtual void onQueued() CXX11_OVERRIDE; - virtual void onAbortOutstandingRequestEvent - (const BtAbortOutstandingRequestEvent& event) CXX11_OVERRIDE; + virtual void onAbortOutstandingRequestEvent( + const BtAbortOutstandingRequestEvent& event) CXX11_OVERRIDE; }; } // namespace aria2 diff --git a/src/BtRuntime.cc b/src/BtRuntime.cc index 6007789c..1031151a 100644 --- a/src/BtRuntime.cc +++ b/src/BtRuntime.cc @@ -38,21 +38,22 @@ namespace aria2 { BtRuntime::BtRuntime() - : uploadLengthAtStartup_(0), - halt_(false), - connections_(0), - ready_(false), - maxPeers_(DEFAULT_MAX_PEERS), - minPeers_(DEFAULT_MIN_PEERS) -{} + : uploadLengthAtStartup_(0), + halt_(false), + connections_(0), + ready_(false), + maxPeers_(DEFAULT_MAX_PEERS), + minPeers_(DEFAULT_MIN_PEERS) +{ +} BtRuntime::~BtRuntime() {} void BtRuntime::setMaxPeers(int maxPeers) { maxPeers_ = maxPeers; - minPeers_ = maxPeers*0.8; - if(minPeers_ == 0 && maxPeers != 0) { + minPeers_ = maxPeers * 0.8; + if (minPeers_ == 0 && maxPeers != 0) { minPeers_ = maxPeers; } } diff --git a/src/BtRuntime.h b/src/BtRuntime.h index 2403e765..edf93d6a 100644 --- a/src/BtRuntime.h +++ b/src/BtRuntime.h @@ -51,24 +51,22 @@ private: // Minimum number of peers. This value is used for getting more peers from // tracker. 0 means always the number of peers is under minimum. int minPeers_; + public: BtRuntime(); ~BtRuntime(); - int64_t getUploadLengthAtStartup() const { - return uploadLengthAtStartup_; - } + int64_t getUploadLengthAtStartup() const { return uploadLengthAtStartup_; } - void setUploadLengthAtStartup(int64_t length) { + void setUploadLengthAtStartup(int64_t length) + { uploadLengthAtStartup_ = length; } bool isHalt() const { return halt_; } - void setHalt(bool halt) { - halt_ = halt; - } + void setHalt(bool halt) { halt_ = halt; } int getConnections() const { return connections_; } @@ -97,10 +95,7 @@ public: void setMaxPeers(int maxPeers); - int getMaxPeers() const - { - return maxPeers_; - } + int getMaxPeers() const { return maxPeers_; } static const int DEFAULT_MAX_PEERS = 55; static const int DEFAULT_MIN_PEERS = 40; diff --git a/src/BtSeederStateChoke.cc b/src/BtSeederStateChoke.cc index c192f896..5662b6ac 100644 --- a/src/BtSeederStateChoke.cc +++ b/src/BtSeederStateChoke.cc @@ -45,10 +45,9 @@ namespace aria2 { -BtSeederStateChoke::BtSeederStateChoke() - : round_(0), - lastRound_(Timer::zero()) -{} +BtSeederStateChoke::BtSeederStateChoke() : round_(0), lastRound_(Timer::zero()) +{ +} BtSeederStateChoke::~BtSeederStateChoke() {} @@ -56,22 +55,24 @@ namespace { constexpr auto TIME_FRAME = 20_s; } // namespace -BtSeederStateChoke::PeerEntry::PeerEntry -(const std::shared_ptr& peer): - peer_(peer), - outstandingUpload_(peer->countOutstandingUpload()), - lastAmUnchoking_(peer->getLastAmUnchoking()), - recentUnchoking_(lastAmUnchoking_.difference(global::wallclock()) < TIME_FRAME), - uploadSpeed_(peer->calculateUploadSpeed()) -{} +BtSeederStateChoke::PeerEntry::PeerEntry(const std::shared_ptr& peer) + : peer_(peer), + outstandingUpload_(peer->countOutstandingUpload()), + lastAmUnchoking_(peer->getLastAmUnchoking()), + recentUnchoking_(lastAmUnchoking_.difference(global::wallclock()) < + TIME_FRAME), + uploadSpeed_(peer->calculateUploadSpeed()) +{ +} BtSeederStateChoke::PeerEntry::PeerEntry(const PeerEntry& c) - : peer_(c.peer_), - outstandingUpload_(c.outstandingUpload_), - lastAmUnchoking_(c.lastAmUnchoking_), - recentUnchoking_(c.recentUnchoking_), - uploadSpeed_(c.uploadSpeed_) -{} + : peer_(c.peer_), + outstandingUpload_(c.outstandingUpload_), + lastAmUnchoking_(c.lastAmUnchoking_), + recentUnchoking_(c.recentUnchoking_), + uploadSpeed_(c.uploadSpeed_) +{ +} BtSeederStateChoke::PeerEntry::~PeerEntry() {} @@ -85,10 +86,10 @@ void BtSeederStateChoke::PeerEntry::swap(PeerEntry& c) swap(uploadSpeed_, c.uploadSpeed_); } -BtSeederStateChoke::PeerEntry& BtSeederStateChoke::PeerEntry::operator= -(const PeerEntry& c) +BtSeederStateChoke::PeerEntry& BtSeederStateChoke::PeerEntry:: +operator=(const PeerEntry& c) { - if(this != &c) { + if (this != &c) { peer_ = c.peer_; outstandingUpload_ = c.outstandingUpload_; lastAmUnchoking_ = c.lastAmUnchoking_; @@ -98,20 +99,22 @@ BtSeederStateChoke::PeerEntry& BtSeederStateChoke::PeerEntry::operator= return *this; } -bool -BtSeederStateChoke::PeerEntry::operator<(const PeerEntry& rhs) const +bool BtSeederStateChoke::PeerEntry::operator<(const PeerEntry& rhs) const { - if(this->outstandingUpload_ && !rhs.outstandingUpload_) { + if (this->outstandingUpload_ && !rhs.outstandingUpload_) { return true; - } else if(!this->outstandingUpload_ && rhs.outstandingUpload_) { + } + else if (!this->outstandingUpload_ && rhs.outstandingUpload_) { return false; } - if(this->recentUnchoking_ && - (this->lastAmUnchoking_ > rhs.lastAmUnchoking_)) { + if (this->recentUnchoking_ && + (this->lastAmUnchoking_ > rhs.lastAmUnchoking_)) { return true; - } else if(rhs.recentUnchoking_) { + } + else if (rhs.recentUnchoking_) { return false; - } else { + } + else { return this->uploadSpeed_ > rhs.uploadSpeed_; } } @@ -121,25 +124,24 @@ void BtSeederStateChoke::PeerEntry::disableOptUnchoking() peer_->optUnchoking(false); } -void BtSeederStateChoke::unchoke -(std::vector& peers) +void BtSeederStateChoke::unchoke( + std::vector& peers) { int count = (round_ == 2) ? 4 : 3; std::sort(std::begin(peers), std::end(peers)); auto r = std::begin(peers); - for(; r != std::end(peers) && count; ++r, --count) { + for (; r != std::end(peers) && count; ++r, --count) { (*r).getPeer()->chokingRequired(false); - A2_LOG_INFO(fmt("RU: %s, ulspd=%d", - (*r).getPeer()->getIPAddress().c_str(), + A2_LOG_INFO(fmt("RU: %s, ulspd=%d", (*r).getPeer()->getIPAddress().c_str(), (*r).getUploadSpeed())); } - if(round_ < 2) { + if (round_ < 2) { std::for_each(std::begin(peers), std::end(peers), std::mem_fn(&PeerEntry::disableOptUnchoking)); - if(r != std::end(peers)) { + if (r != std::end(peers)) { std::shuffle(r, std::end(peers), *SimpleRandomizer::getInstance()); (*r).getPeer()->optUnchoking(true); A2_LOG_INFO(fmt("POU: %s", (*r).getPeer()->getIPAddress().c_str())); @@ -153,8 +155,8 @@ void BtSeederStateChoke::executeChoke(const PeerSet& peerSet) lastRound_ = global::wallclock(); std::vector peerEntries; - for(const auto& p : peerSet) { - if(p->isActive() && p->peerInterested()) { + for (const auto& p : peerSet) { + if (p->isActive() && p->peerInterested()) { p->chokingRequired(true); peerEntries.push_back(PeerEntry(p)); } @@ -162,14 +164,12 @@ void BtSeederStateChoke::executeChoke(const PeerSet& peerSet) unchoke(peerEntries); - if(++round_ == 3) { + if (++round_ == 3) { round_ = 0; } } -void swap -(BtSeederStateChoke::PeerEntry& a, - BtSeederStateChoke::PeerEntry& b) +void swap(BtSeederStateChoke::PeerEntry& a, BtSeederStateChoke::PeerEntry& b) { a.swap(b); } diff --git a/src/BtSeederStateChoke.h b/src/BtSeederStateChoke.h index d333b7c6..cc560158 100644 --- a/src/BtSeederStateChoke.h +++ b/src/BtSeederStateChoke.h @@ -80,6 +80,7 @@ private: }; void unchoke(std::vector& peers); + public: BtSeederStateChoke(); @@ -92,9 +93,7 @@ public: friend void swap(PeerEntry& a, PeerEntry& b); }; -void swap -(BtSeederStateChoke::PeerEntry& a, - BtSeederStateChoke::PeerEntry& b); +void swap(BtSeederStateChoke::PeerEntry& a, BtSeederStateChoke::PeerEntry& b); } // namespace aria2 diff --git a/src/BtSetup.cc b/src/BtSetup.cc index 4cf4a6b5..e541fd7e 100644 --- a/src/BtSetup.cc +++ b/src/BtSetup.cc @@ -91,15 +91,14 @@ namespace aria2 { BtSetup::BtSetup() {} void BtSetup::setup(std::vector>& commands, - RequestGroup* requestGroup, - DownloadEngine* e, + RequestGroup* requestGroup, DownloadEngine* e, const Option* option) { - if(!requestGroup->getDownloadContext()->hasAttribute(CTX_ATTR_BT)){ + if (!requestGroup->getDownloadContext()->hasAttribute(CTX_ATTR_BT)) { return; } auto torrentAttrs = - bittorrent::getTorrentAttrs(requestGroup->getDownloadContext()); + bittorrent::getTorrentAttrs(requestGroup->getDownloadContext()); bool metadataGetMode = torrentAttrs->metadata.empty(); auto& btReg = e->getBtRegistry(); auto btObject = btReg->get(requestGroup->getGID()); @@ -117,7 +116,7 @@ void BtSetup::setup(std::vector>& commands, commands.push_back(std::move(c)); } - if(!metadataGetMode) { + if (!metadataGetMode) { auto c = make_unique(e->newCUID(), e); c->setPeerStorage(peerStorage); c->setBtRuntime(btRuntime); @@ -135,19 +134,19 @@ void BtSetup::setup(std::vector>& commands, commands.push_back(std::move(c)); } - if(metadataGetMode || !torrentAttrs->privateTorrent) { - if(DHTRegistry::isInitialized()) { - auto command = make_unique - (e->newCUID(), requestGroup, e); + if (metadataGetMode || !torrentAttrs->privateTorrent) { + if (DHTRegistry::isInitialized()) { + auto command = + make_unique(e->newCUID(), requestGroup, e); command->setTaskQueue(DHTRegistry::getData().taskQueue.get()); command->setTaskFactory(DHTRegistry::getData().taskFactory.get()); command->setBtRuntime(btRuntime); command->setPeerStorage(peerStorage); commands.push_back(std::move(command)); } - if(DHTRegistry::isInitialized6()) { - auto command = make_unique - (e->newCUID(), requestGroup, e); + if (DHTRegistry::isInitialized6()) { + auto command = + make_unique(e->newCUID(), requestGroup, e); command->setTaskQueue(DHTRegistry::getData6().taskQueue.get()); command->setTaskFactory(DHTRegistry::getData6().taskFactory.get()); command->setBtRuntime(btRuntime); @@ -155,126 +154,129 @@ void BtSetup::setup(std::vector>& commands, commands.push_back(std::move(command)); } } - if(!metadataGetMode) { + if (!metadataGetMode) { auto unionCri = make_unique(); - if(option->defined(PREF_SEED_TIME)) { + if (option->defined(PREF_SEED_TIME)) { unionCri->addSeedCriteria(make_unique( std::chrono::seconds(option->getAsInt(PREF_SEED_TIME) * 60))); } { double ratio = option->getAsDouble(PREF_SEED_RATIO); - if(ratio > 0.0) { - auto cri = make_unique - (option->getAsDouble(PREF_SEED_RATIO), - requestGroup->getDownloadContext()); + if (ratio > 0.0) { + auto cri = make_unique( + option->getAsDouble(PREF_SEED_RATIO), + requestGroup->getDownloadContext()); cri->setPieceStorage(pieceStorage); cri->setBtRuntime(btRuntime); unionCri->addSeedCriteria(std::move(cri)); } } - if(!unionCri->getSeedCriterion().empty()) { - auto c = make_unique - (e->newCUID(), requestGroup, e, std::move(unionCri)); + if (!unionCri->getSeedCriterion().empty()) { + auto c = make_unique(e->newCUID(), requestGroup, e, + std::move(unionCri)); c->setPieceStorage(pieceStorage); c->setBtRuntime(btRuntime); commands.push_back(std::move(c)); } } - if(btReg->getTcpPort() == 0) { - static int families[] = { AF_INET, AF_INET6 }; - size_t familiesLength = e->getOption()->getAsBool(PREF_DISABLE_IPV6)?1:2; - for(size_t i = 0; i < familiesLength; ++i) { - auto command = make_unique - (e->newCUID(), e, families[i]); + if (btReg->getTcpPort() == 0) { + static int families[] = {AF_INET, AF_INET6}; + size_t familiesLength = + e->getOption()->getAsBool(PREF_DISABLE_IPV6) ? 1 : 2; + for (size_t i = 0; i < familiesLength; ++i) { + auto command = + make_unique(e->newCUID(), e, families[i]); bool ret; uint16_t port; - if(btReg->getTcpPort()) { + if (btReg->getTcpPort()) { SegList sgl; int usedPort = btReg->getTcpPort(); - sgl.add(usedPort, usedPort+1); + sgl.add(usedPort, usedPort + 1); ret = command->bindPort(port, sgl); - } else { - auto sgl = util::parseIntSegments - (e->getOption()->get(PREF_LISTEN_PORT)); + } + else { + auto sgl = + util::parseIntSegments(e->getOption()->get(PREF_LISTEN_PORT)); sgl.normalize(); ret = command->bindPort(port, sgl); } - if(ret) { + if (ret) { btReg->setTcpPort(port); // Add command to DownloadEngine directly. e->addCommand(std::move(command)); } } - if(btReg->getTcpPort() == 0) { + if (btReg->getTcpPort() == 0) { throw DL_ABORT_EX(_("Errors occurred while binding port.\n")); } } btAnnounce->setTcpPort(btReg->getTcpPort()); - if(option->getAsBool(PREF_BT_ENABLE_LPD) && - btReg->getTcpPort() && - (metadataGetMode || !torrentAttrs->privateTorrent)) { - if(!btReg->getLpdMessageReceiver()) { + if (option->getAsBool(PREF_BT_ENABLE_LPD) && btReg->getTcpPort() && + (metadataGetMode || !torrentAttrs->privateTorrent)) { + if (!btReg->getLpdMessageReceiver()) { A2_LOG_INFO("Initializing LpdMessageReceiver."); - auto receiver = std::make_shared - (LPD_MULTICAST_ADDR, LPD_MULTICAST_PORT); + auto receiver = std::make_shared(LPD_MULTICAST_ADDR, + LPD_MULTICAST_PORT); bool initialized = false; const std::string& lpdInterface = - e->getOption()->get(PREF_BT_LPD_INTERFACE); - if(lpdInterface.empty()) { - if(receiver->init("")) { + e->getOption()->get(PREF_BT_LPD_INTERFACE); + if (lpdInterface.empty()) { + if (receiver->init("")) { initialized = true; } - } else { - std::vector > ifAddrs; - getInterfaceAddress(ifAddrs, lpdInterface, AF_INET, AI_NUMERICHOST); - for (const auto& i : ifAddrs) { + } + else { + auto ifAddrs = SocketCore::getInterfaceAddress(lpdInterface, AF_INET, + AI_NUMERICHOST); + for (const auto& soaddr : ifAddrs) { char host[NI_MAXHOST]; - if(inetNtop(AF_INET, &i.first.in.sin_addr, host, - sizeof(host)) == 0 && - receiver->init(host)) { + if (inetNtop(AF_INET, &soaddr.su.in.sin_addr, host, sizeof(host)) == + 0 && + receiver->init(host)) { initialized = true; break; } } } - if(initialized) { + if (initialized) { btReg->setLpdMessageReceiver(receiver); A2_LOG_INFO(fmt("LpdMessageReceiver initialized. multicastAddr=%s:%u," " localAddr=%s", LPD_MULTICAST_ADDR, LPD_MULTICAST_PORT, receiver->getLocalAddress().c_str())); - e->addCommand(make_unique - (e->newCUID(), receiver, e)); - } else { + e->addCommand( + make_unique(e->newCUID(), receiver, e)); + } + else { A2_LOG_INFO("LpdMessageReceiver not initialized."); } } - if(btReg->getLpdMessageReceiver()) { + if (btReg->getLpdMessageReceiver()) { const unsigned char* infoHash = - bittorrent::getInfoHash(requestGroup->getDownloadContext()); + bittorrent::getInfoHash(requestGroup->getDownloadContext()); A2_LOG_INFO("Initializing LpdMessageDispatcher."); - auto dispatcher = std::make_shared - (std::string(&infoHash[0], &infoHash[INFO_HASH_LENGTH]), - btReg->getTcpPort(), - LPD_MULTICAST_ADDR, LPD_MULTICAST_PORT); - if(dispatcher->init(btReg->getLpdMessageReceiver()->getLocalAddress(), - /*ttl*/1, /*loop*/1)) { + auto dispatcher = std::make_shared( + std::string(&infoHash[0], &infoHash[INFO_HASH_LENGTH]), + btReg->getTcpPort(), LPD_MULTICAST_ADDR, LPD_MULTICAST_PORT); + if (dispatcher->init(btReg->getLpdMessageReceiver()->getLocalAddress(), + /*ttl*/ 1, /*loop*/ 1)) { A2_LOG_INFO("LpdMessageDispatcher initialized."); - auto cmd = make_unique - (e->newCUID(), dispatcher, e); + auto cmd = + make_unique(e->newCUID(), dispatcher, e); cmd->setBtRuntime(btRuntime); e->addCommand(std::move(cmd)); - } else { + } + else { A2_LOG_INFO("LpdMessageDispatcher not initialized."); } } } auto btStopTimeout = option->getAsInt(PREF_BT_STOP_TIMEOUT); - if(btStopTimeout > 0) { - auto stopDownloadCommand = make_unique - (e->newCUID(), requestGroup, e, std::chrono::seconds(btStopTimeout)); + if (btStopTimeout > 0) { + auto stopDownloadCommand = make_unique( + e->newCUID(), requestGroup, e, std::chrono::seconds(btStopTimeout)); stopDownloadCommand->setBtRuntime(btRuntime); stopDownloadCommand->setPieceStorage(pieceStorage); commands.push_back(std::move(stopDownloadCommand)); diff --git a/src/BtSetup.h b/src/BtSetup.h index 865545ce..be6833a0 100644 --- a/src/BtSetup.h +++ b/src/BtSetup.h @@ -52,8 +52,7 @@ public: BtSetup(); void setup(std::vector>& commands, - RequestGroup* requestGroup, - DownloadEngine* e, + RequestGroup* requestGroup, DownloadEngine* e, const Option* option); }; diff --git a/src/BtStopDownloadCommand.cc b/src/BtStopDownloadCommand.cc index 74b3b89d..fb009f26 100644 --- a/src/BtStopDownloadCommand.cc +++ b/src/BtStopDownloadCommand.cc @@ -46,22 +46,22 @@ namespace aria2 { -BtStopDownloadCommand::BtStopDownloadCommand -(cuid_t cuid, - RequestGroup* requestGroup, - DownloadEngine* e, - std::chrono::seconds timeout) - : TimeBasedCommand(cuid, e, 1_s), - requestGroup_(requestGroup), - timeout_(std::move(timeout)) -{} +BtStopDownloadCommand::BtStopDownloadCommand(cuid_t cuid, + RequestGroup* requestGroup, + DownloadEngine* e, + std::chrono::seconds timeout) + : TimeBasedCommand(cuid, e, 1_s), + requestGroup_(requestGroup), + timeout_(std::move(timeout)) +{ +} void BtStopDownloadCommand::preProcess() { - if(btRuntime_->isHalt() || pieceStorage_->downloadFinished()) { + if (btRuntime_->isHalt() || pieceStorage_->downloadFinished()) { enableExit(); } - if(checkPoint_.difference(global::wallclock()) >= timeout_) { + if (checkPoint_.difference(global::wallclock()) >= timeout_) { A2_LOG_NOTICE(fmt(_("GID#%s Stop downloading torrent due to" " --bt-stop-timeout option."), GroupId::toHex(requestGroup_->getGID()).c_str())); @@ -74,7 +74,7 @@ void BtStopDownloadCommand::preProcess() void BtStopDownloadCommand::process() { NetStat& stat = requestGroup_->getDownloadContext()->getNetStat(); - if(stat.calculateDownloadSpeed() > 0) { + if (stat.calculateDownloadSpeed() > 0) { checkPoint_ = global::wallclock(); } } diff --git a/src/BtStopDownloadCommand.h b/src/BtStopDownloadCommand.h index ae592a92..70d0fcc4 100644 --- a/src/BtStopDownloadCommand.h +++ b/src/BtStopDownloadCommand.h @@ -47,7 +47,7 @@ class BtRuntime; // Stop downloading torrent if in consecutive timeout_ seconds, // download speed is zero and the number of seeder is 0. -class BtStopDownloadCommand:public TimeBasedCommand { +class BtStopDownloadCommand : public TimeBasedCommand { private: RequestGroup* requestGroup_; @@ -58,12 +58,10 @@ private: std::shared_ptr btRuntime_; std::shared_ptr pieceStorage_; + public: - BtStopDownloadCommand - (cuid_t cuid, - RequestGroup* requestGroup, - DownloadEngine* e, - std::chrono::seconds timeout); + BtStopDownloadCommand(cuid_t cuid, RequestGroup* requestGroup, + DownloadEngine* e, std::chrono::seconds timeout); virtual void preProcess() CXX11_OVERRIDE; diff --git a/src/BtSuggestPieceMessage.cc b/src/BtSuggestPieceMessage.cc index a12b7be7..ef58cd53 100644 --- a/src/BtSuggestPieceMessage.cc +++ b/src/BtSuggestPieceMessage.cc @@ -37,13 +37,14 @@ namespace aria2 { BtSuggestPieceMessage::BtSuggestPieceMessage(size_t index) - : IndexBtMessage{ID, NAME, index} -{} + : IndexBtMessage{ID, NAME, index} +{ +} const char BtSuggestPieceMessage::NAME[] = "suggest piece"; -std::unique_ptr BtSuggestPieceMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtSuggestPieceMessage::create(const unsigned char* data, size_t dataLength) { return IndexBtMessage::create(data, dataLength); } diff --git a/src/BtSuggestPieceMessage.h b/src/BtSuggestPieceMessage.h index 61df93cd..40cc92bf 100644 --- a/src/BtSuggestPieceMessage.h +++ b/src/BtSuggestPieceMessage.h @@ -47,10 +47,11 @@ public: static const char NAME[]; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr + create(const unsigned char* data, size_t dataLength); - virtual void doReceivedAction() CXX11_OVERRIDE { + virtual void doReceivedAction() CXX11_OVERRIDE + { // TODO Current implementation ignores this message. } }; diff --git a/src/BtUnchokeMessage.cc b/src/BtUnchokeMessage.cc index e76d053c..cc9e203a 100644 --- a/src/BtUnchokeMessage.cc +++ b/src/BtUnchokeMessage.cc @@ -40,34 +40,30 @@ namespace aria2 { const char BtUnchokeMessage::NAME[] = "unchoke"; -BtUnchokeMessage::BtUnchokeMessage():ZeroBtMessage(ID, NAME) {} +BtUnchokeMessage::BtUnchokeMessage() : ZeroBtMessage(ID, NAME) {} -std::unique_ptr BtUnchokeMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr +BtUnchokeMessage::create(const unsigned char* data, size_t dataLength) { return ZeroBtMessage::create(data, dataLength); } void BtUnchokeMessage::doReceivedAction() { - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } getPeer()->peerChoking(false); } -bool BtUnchokeMessage::sendPredicate() const -{ - return getPeer()->amChoking(); -} +bool BtUnchokeMessage::sendPredicate() const { return getPeer()->amChoking(); } namespace { struct ThisProgressUpdate : public ProgressUpdate { - ThisProgressUpdate(std::shared_ptr peer) - : peer(std::move(peer)) {} + ThisProgressUpdate(std::shared_ptr peer) : peer(std::move(peer)) {} virtual void update(size_t length, bool complete) CXX11_OVERRIDE { - if(complete) { + if (complete) { peer->amChoking(false); } } diff --git a/src/BtUnchokeMessage.h b/src/BtUnchokeMessage.h index 5435911e..bd9e6109 100644 --- a/src/BtUnchokeMessage.h +++ b/src/BtUnchokeMessage.h @@ -42,6 +42,7 @@ namespace aria2 { class BtUnchokeMessage : public ZeroBtMessage { private: static const size_t MESSAGE_LENGTH = 5; + public: BtUnchokeMessage(); @@ -49,8 +50,8 @@ public: static const char NAME[]; - static std::unique_ptr create - (const unsigned char* data, size_t dataLength); + static std::unique_ptr create(const unsigned char* data, + size_t dataLength); virtual void doReceivedAction() CXX11_OVERRIDE; diff --git a/src/BufferedFile.cc b/src/BufferedFile.cc index ee35006a..3618f439 100644 --- a/src/BufferedFile.cc +++ b/src/BufferedFile.cc @@ -44,26 +44,26 @@ namespace aria2 { BufferedFile::BufferedFile(const char* filename, const char* mode) - : + : #ifdef __MINGW32__ - fp_(strcmp(DEV_STDIN, filename) == 0 ? - stdin : a2fopen(utf8ToWChar(filename).c_str(), - utf8ToWChar(mode).c_str())), -#else // !__MINGW32__ - fp_(a2fopen(filename, mode)), + fp_(strcmp(DEV_STDIN, filename) == 0 + ? stdin + : a2fopen(utf8ToWChar(filename).c_str(), + utf8ToWChar(mode).c_str())), +#else // !__MINGW32__ + fp_(a2fopen(filename, mode)), #endif // !__MINGW32__ - supportsColor_(fp_ ? isatty(fileno(fp_)) : false) -{} + supportsColor_(fp_ ? isatty(fileno(fp_)) : false) +{ +} BufferedFile::BufferedFile(FILE* fp) - : fp_(fp), supportsColor_(fp_ ? isatty(fileno(fp_)) : false) -{} - -BufferedFile::~BufferedFile() + : fp_(fp), supportsColor_(fp_ ? isatty(fileno(fp_)) : false) { - close(); } +BufferedFile::~BufferedFile() { close(); } + size_t BufferedFile::onRead(void* ptr, size_t count) { return fread(ptr, 1, count, fp_); @@ -74,10 +74,7 @@ size_t BufferedFile::onWrite(const void* ptr, size_t count) return fwrite(ptr, 1, count, fp_); } -char* BufferedFile::onGets(char* s, int size) -{ - return fgets(s, size, fp_); -} +char* BufferedFile::onGets(char* s, int size) { return fgets(s, size, fp_); } int BufferedFile::onClose() { @@ -94,29 +91,14 @@ int BufferedFile::onVprintf(const char* format, va_list va) return vfprintf(fp_, format, va); } -int BufferedFile::onFlush() -{ - return fflush(fp_); -} +int BufferedFile::onFlush() { return fflush(fp_); } -bool BufferedFile::onSupportsColor() -{ - return supportsColor_; -} +bool BufferedFile::onSupportsColor() { return supportsColor_; } -bool BufferedFile::isError() const -{ - return ferror(fp_); -} +bool BufferedFile::isError() const { return ferror(fp_); } -bool BufferedFile::isEOF() const -{ - return feof(fp_); -} +bool BufferedFile::isEOF() const { return feof(fp_); } -bool BufferedFile::isOpen() const -{ - return fp_; -} +bool BufferedFile::isOpen() const { return fp_; } } // namespace aria2 diff --git a/src/BufferedFile.h b/src/BufferedFile.h index 10966b2e..03a57ac6 100644 --- a/src/BufferedFile.h +++ b/src/BufferedFile.h @@ -42,11 +42,12 @@ namespace aria2 { // IOFILE implementation using standard I/O functions. -class BufferedFile:public IOFile { +class BufferedFile : public IOFile { public: BufferedFile(const char* filename, const char* mode); BufferedFile(FILE* fp); virtual ~BufferedFile(); + protected: // wrapper for fread. Using 1 for 2nd argument of fread. virtual size_t onRead(void* ptr, size_t count) CXX11_OVERRIDE; @@ -63,6 +64,7 @@ protected: virtual bool isError() const CXX11_OVERRIDE; virtual bool isEOF() const CXX11_OVERRIDE; virtual bool isOpen() const CXX11_OVERRIDE; + private: // Don't allow copying; BufferedFile(const BufferedFile&); diff --git a/src/ByteArrayDiskWriter.cc b/src/ByteArrayDiskWriter.cc index 8f638dff..0ad91ac6 100644 --- a/src/ByteArrayDiskWriter.cc +++ b/src/ByteArrayDiskWriter.cc @@ -40,44 +40,37 @@ namespace aria2 { ByteArrayDiskWriter::ByteArrayDiskWriter(size_t maxLength) - : maxLength_(maxLength) -{} + : maxLength_(maxLength) +{ +} ByteArrayDiskWriter::~ByteArrayDiskWriter() {} -void ByteArrayDiskWriter::clear() -{ - buf_.str(A2STR::NIL); -} +void ByteArrayDiskWriter::clear() { buf_.str(A2STR::NIL); } -void ByteArrayDiskWriter::initAndOpenFile(int64_t totalLength) -{ - clear(); -} +void ByteArrayDiskWriter::initAndOpenFile(int64_t totalLength) { clear(); } void ByteArrayDiskWriter::openFile(int64_t totalLength) {} void ByteArrayDiskWriter::closeFile() {} -void ByteArrayDiskWriter::openExistingFile(int64_t totalLength) -{ - openFile(); -} +void ByteArrayDiskWriter::openExistingFile(int64_t totalLength) { openFile(); } void ByteArrayDiskWriter::writeData(const unsigned char* data, size_t dataLength, int64_t offset) { - if(offset+dataLength > maxLength_) { + if (offset + dataLength > maxLength_) { throw DL_ABORT_EX(fmt("Maximum length(%lu) exceeded.", static_cast(maxLength_))); } int64_t length = size(); - if(length < offset) { + if (length < offset) { buf_.seekp(length, std::ios::beg); - for(int64_t i = length; i < offset; ++i) { + for (int64_t i = length; i < offset; ++i) { buf_.put('\0'); } - } else { + } + else { buf_.seekp(offset, std::ios::beg); } buf_.write(reinterpret_cast(data), dataLength); @@ -99,14 +92,8 @@ int64_t ByteArrayDiskWriter::size() return buf_.tellg(); } -void ByteArrayDiskWriter::setString(const std::string& s) -{ - buf_.str(s); -} +void ByteArrayDiskWriter::setString(const std::string& s) { buf_.str(s); } -std::string ByteArrayDiskWriter::getString() const -{ - return buf_.str(); -} +std::string ByteArrayDiskWriter::getString() const { return buf_.str(); } } // namespace aria2 diff --git a/src/ByteArrayDiskWriter.h b/src/ByteArrayDiskWriter.h index b5ca7140..a52cb8c8 100644 --- a/src/ByteArrayDiskWriter.h +++ b/src/ByteArrayDiskWriter.h @@ -47,6 +47,7 @@ private: std::stringstream buf_; size_t maxLength_; void clear(); + public: ByteArrayDiskWriter(size_t maxLength = 5_m); virtual ~ByteArrayDiskWriter(); @@ -59,10 +60,10 @@ public: virtual void openExistingFile(int64_t totalLength = 0) CXX11_OVERRIDE; - virtual void writeData(const unsigned char* data, size_t len, int64_t offset) - CXX11_OVERRIDE; - virtual ssize_t readData(unsigned char* data, size_t len, int64_t offset) - CXX11_OVERRIDE; + virtual void writeData(const unsigned char* data, size_t len, + int64_t offset) CXX11_OVERRIDE; + virtual ssize_t readData(unsigned char* data, size_t len, + int64_t offset) CXX11_OVERRIDE; virtual int64_t size() CXX11_OVERRIDE; diff --git a/src/ByteArrayDiskWriterFactory.h b/src/ByteArrayDiskWriterFactory.h index 63860dd7..3c801ee8 100644 --- a/src/ByteArrayDiskWriterFactory.h +++ b/src/ByteArrayDiskWriterFactory.h @@ -40,8 +40,7 @@ namespace aria2 { -typedef AnonDiskWriterFactory -ByteArrayDiskWriterFactory; +typedef AnonDiskWriterFactory ByteArrayDiskWriterFactory; } // namespace aria2 diff --git a/src/CUIDCounter.cc b/src/CUIDCounter.cc index 3ae6b88d..5fbba205 100644 --- a/src/CUIDCounter.cc +++ b/src/CUIDCounter.cc @@ -36,13 +36,13 @@ namespace aria2 { -CUIDCounter::CUIDCounter():count_(0) {} +CUIDCounter::CUIDCounter() : count_(0) {} CUIDCounter::~CUIDCounter() {} cuid_t CUIDCounter::newID() { - if(count_ == INT64_MAX) { + if (count_ == INT64_MAX) { count_ = 0; } return ++count_; diff --git a/src/CUIDCounter.h b/src/CUIDCounter.h index eb118f64..088ad560 100644 --- a/src/CUIDCounter.h +++ b/src/CUIDCounter.h @@ -43,6 +43,7 @@ namespace aria2 { class CUIDCounter { private: cuid_t count_; + public: CUIDCounter(); ~CUIDCounter(); diff --git a/src/CheckIntegrityCommand.cc b/src/CheckIntegrityCommand.cc index 4e0557fb..c6c401d5 100644 --- a/src/CheckIntegrityCommand.cc +++ b/src/CheckIntegrityCommand.cc @@ -48,12 +48,13 @@ namespace aria2 { -CheckIntegrityCommand::CheckIntegrityCommand -(cuid_t cuid, RequestGroup* requestGroup, DownloadEngine* e, - CheckIntegrityEntry* entry) - : RealtimeCommand{cuid, requestGroup, e}, - entry_{entry} -{} +CheckIntegrityCommand::CheckIntegrityCommand(cuid_t cuid, + RequestGroup* requestGroup, + DownloadEngine* e, + CheckIntegrityEntry* entry) + : RealtimeCommand{cuid, requestGroup, e}, entry_{entry} +{ +} CheckIntegrityCommand::~CheckIntegrityCommand() { @@ -62,33 +63,35 @@ CheckIntegrityCommand::~CheckIntegrityCommand() bool CheckIntegrityCommand::executeInternal() { - if(getRequestGroup()->isHaltRequested()) { + if (getRequestGroup()->isHaltRequested()) { return true; } entry_->validateChunk(); - if(entry_->finished()) { + if (entry_->finished()) { // Enable control file saving here. See also // RequestGroup::processCheckIntegrityEntry() to know why this is // needed. getRequestGroup()->enableSaveControlFile(); - if(getRequestGroup()->downloadFinished()) { - A2_LOG_NOTICE - (fmt(MSG_VERIFICATION_SUCCESSFUL, - getRequestGroup()->getDownloadContext()->getBasePath().c_str())); + if (getRequestGroup()->downloadFinished()) { + A2_LOG_NOTICE( + fmt(MSG_VERIFICATION_SUCCESSFUL, + getRequestGroup()->getDownloadContext()->getBasePath().c_str())); std::vector> commands; entry_->onDownloadFinished(commands, getDownloadEngine()); getDownloadEngine()->addCommand(std::move(commands)); - } else { - A2_LOG_ERROR - (fmt(MSG_VERIFICATION_FAILED, - getRequestGroup()->getDownloadContext()->getBasePath().c_str())); + } + else { + A2_LOG_ERROR( + fmt(MSG_VERIFICATION_FAILED, + getRequestGroup()->getDownloadContext()->getBasePath().c_str())); std::vector> commands; entry_->onDownloadIncomplete(commands, getDownloadEngine()); getDownloadEngine()->addCommand(std::move(commands)); } getDownloadEngine()->setNoWait(true); return true; - } else { + } + else { getDownloadEngine()->addCommand(std::unique_ptr(this)); return false; } @@ -96,13 +99,10 @@ bool CheckIntegrityCommand::executeInternal() bool CheckIntegrityCommand::handleException(Exception& e) { - A2_LOG_ERROR_EX(fmt(MSG_FILE_VALIDATION_FAILURE, - getCuid()), - e); - A2_LOG_ERROR - (fmt(MSG_DOWNLOAD_NOT_COMPLETE, - getCuid(), - getRequestGroup()->getDownloadContext()->getBasePath().c_str())); + A2_LOG_ERROR_EX(fmt(MSG_FILE_VALIDATION_FAILURE, getCuid()), e); + A2_LOG_ERROR( + fmt(MSG_DOWNLOAD_NOT_COMPLETE, getCuid(), + getRequestGroup()->getDownloadContext()->getBasePath().c_str())); return true; } diff --git a/src/CheckIntegrityCommand.h b/src/CheckIntegrityCommand.h index 060548e5..19ff25f2 100644 --- a/src/CheckIntegrityCommand.h +++ b/src/CheckIntegrityCommand.h @@ -46,11 +46,10 @@ class CheckIntegrityEntry; class CheckIntegrityCommand : public RealtimeCommand { private: CheckIntegrityEntry* entry_; + public: - CheckIntegrityCommand(cuid_t cuid, - RequestGroup* requestGroup, - DownloadEngine* e, - CheckIntegrityEntry* entry); + CheckIntegrityCommand(cuid_t cuid, RequestGroup* requestGroup, + DownloadEngine* e, CheckIntegrityEntry* entry); virtual ~CheckIntegrityCommand(); diff --git a/src/CheckIntegrityDispatcherCommand.cc b/src/CheckIntegrityDispatcherCommand.cc index 9c512611..41609069 100644 --- a/src/CheckIntegrityDispatcherCommand.cc +++ b/src/CheckIntegrityDispatcherCommand.cc @@ -43,23 +43,22 @@ namespace aria2 { -CheckIntegrityDispatcherCommand::CheckIntegrityDispatcherCommand -(cuid_t cuid, - CheckIntegrityMan* fileAllocMan, - DownloadEngine* e) - : SequentialDispatcherCommand{cuid, fileAllocMan, e} +CheckIntegrityDispatcherCommand::CheckIntegrityDispatcherCommand( + cuid_t cuid, CheckIntegrityMan* fileAllocMan, DownloadEngine* e) + : SequentialDispatcherCommand{cuid, fileAllocMan, e} { setStatusRealtime(); } -std::unique_ptr CheckIntegrityDispatcherCommand::createCommand -(CheckIntegrityEntry* entry) +std::unique_ptr +CheckIntegrityDispatcherCommand::createCommand(CheckIntegrityEntry* entry) { cuid_t newCUID = getDownloadEngine()->newCUID(); A2_LOG_INFO(fmt("CUID#%" PRId64 " - Dispatching CheckIntegrityCommand " - "CUID#%" PRId64 ".", getCuid(), newCUID)); - return make_unique - (newCUID, entry->getRequestGroup(), getDownloadEngine(), entry); + "CUID#%" PRId64 ".", + getCuid(), newCUID)); + return make_unique(newCUID, entry->getRequestGroup(), + getDownloadEngine(), entry); } } // namespace aria2 diff --git a/src/CheckIntegrityDispatcherCommand.h b/src/CheckIntegrityDispatcherCommand.h index 92ef37d4..0d27bec6 100644 --- a/src/CheckIntegrityDispatcherCommand.h +++ b/src/CheckIntegrityDispatcherCommand.h @@ -42,16 +42,15 @@ namespace aria2 { class CheckIntegrityEntry; -class CheckIntegrityDispatcherCommand : - public SequentialDispatcherCommand { +class CheckIntegrityDispatcherCommand + : public SequentialDispatcherCommand { public: - CheckIntegrityDispatcherCommand - (cuid_t cuid, - CheckIntegrityMan* checkMan, - DownloadEngine* e); + CheckIntegrityDispatcherCommand(cuid_t cuid, CheckIntegrityMan* checkMan, + DownloadEngine* e); + protected: - virtual std::unique_ptr createCommand(CheckIntegrityEntry* entry) - CXX11_OVERRIDE; + virtual std::unique_ptr + createCommand(CheckIntegrityEntry* entry) CXX11_OVERRIDE; }; } // namespace aria2 diff --git a/src/CheckIntegrityEntry.cc b/src/CheckIntegrityEntry.cc index 3f23a7fa..9a634050 100644 --- a/src/CheckIntegrityEntry.cc +++ b/src/CheckIntegrityEntry.cc @@ -46,58 +46,55 @@ namespace aria2 { CheckIntegrityEntry::CheckIntegrityEntry(RequestGroup* requestGroup, std::unique_ptr nextCommand) - : RequestGroupEntry{requestGroup, std::move(nextCommand)} -{} + : RequestGroupEntry{requestGroup, std::move(nextCommand)} +{ +} CheckIntegrityEntry::~CheckIntegrityEntry() {} -void CheckIntegrityEntry::validateChunk() -{ - validator_->validateChunk(); -} +void CheckIntegrityEntry::validateChunk() { validator_->validateChunk(); } int64_t CheckIntegrityEntry::getTotalLength() { - if(!validator_) { + if (!validator_) { return 0; - } else { + } + else { return validator_->getTotalLength(); } } int64_t CheckIntegrityEntry::getCurrentLength() { - if(!validator_) { + if (!validator_) { return 0; - } else { + } + else { return validator_->getCurrentOffset(); } } -bool CheckIntegrityEntry::finished() -{ - return validator_->finished(); -} +bool CheckIntegrityEntry::finished() { return validator_->finished(); } void CheckIntegrityEntry::cutTrailingGarbage() { getRequestGroup()->getPieceStorage()->getDiskAdaptor()->cutTrailingGarbage(); } -void CheckIntegrityEntry::proceedFileAllocation -(std::vector>& commands, - std::unique_ptr entry, - DownloadEngine* e) +void CheckIntegrityEntry::proceedFileAllocation( + std::vector>& commands, + std::unique_ptr entry, DownloadEngine* e) { - if(getRequestGroup()->needsFileAllocation()) { + if (getRequestGroup()->needsFileAllocation()) { e->getFileAllocationMan()->pushEntry(std::move(entry)); - } else { + } + else { entry->prepareForNextAction(commands, e); } } -void CheckIntegrityEntry::setValidator -(std::unique_ptr validator) +void CheckIntegrityEntry::setValidator( + std::unique_ptr validator) { validator_ = std::move(validator); } diff --git a/src/CheckIntegrityEntry.h b/src/CheckIntegrityEntry.h index 4978cf47..99c28b2a 100644 --- a/src/CheckIntegrityEntry.h +++ b/src/CheckIntegrityEntry.h @@ -52,16 +52,18 @@ class CheckIntegrityEntry : public RequestGroupEntry, public ProgressAwareEntry { private: std::unique_ptr validator_; + protected: void setValidator(std::unique_ptr validator); void proceedFileAllocation(std::vector>& commands, std::unique_ptr entry, DownloadEngine* e); + public: - CheckIntegrityEntry(RequestGroup* requestGroup, - std::unique_ptr nextCommand = - std::unique_ptr()); + CheckIntegrityEntry( + RequestGroup* requestGroup, + std::unique_ptr nextCommand = std::unique_ptr()); virtual ~CheckIntegrityEntry(); @@ -77,13 +79,13 @@ public: virtual void initValidator() = 0; - virtual void onDownloadFinished - (std::vector>& commands, - DownloadEngine* e) = 0; + virtual void + onDownloadFinished(std::vector>& commands, + DownloadEngine* e) = 0; - virtual void onDownloadIncomplete - (std::vector>& commands, - DownloadEngine* e) = 0; + virtual void + onDownloadIncomplete(std::vector>& commands, + DownloadEngine* e) = 0; void cutTrailingGarbage(); }; diff --git a/src/Checksum.cc b/src/Checksum.cc index 2d4862e1..035146df 100644 --- a/src/Checksum.cc +++ b/src/Checksum.cc @@ -38,25 +38,17 @@ namespace aria2 { Checksum::Checksum(std::string hashType, std::string digest) - : hashType_(std::move(hashType)), - digest_(std::move(digest)) -{} + : hashType_(std::move(hashType)), digest_(std::move(digest)) +{ +} -Checksum::Checksum() - : hashType_("sha-1") -{} +Checksum::Checksum() : hashType_("sha-1") {} Checksum::~Checksum() {} -bool Checksum::isEmpty() const -{ - return digest_.empty(); -} +bool Checksum::isEmpty() const { return digest_.empty(); } -void Checksum::setDigest(std::string digest) -{ - digest_ = std::move(digest); -} +void Checksum::setDigest(std::string digest) { digest_ = std::move(digest); } void Checksum::setHashType(std::string hashType) { @@ -66,19 +58,16 @@ void Checksum::setHashType(std::string hashType) void Checksum::swap(Checksum& other) { using std::swap; - if(this != &other) { + if (this != &other) { swap(hashType_, other.hashType_); swap(digest_, other.digest_); } } -void swap(Checksum& a, Checksum& b) -{ - a.swap(b); -} +void swap(Checksum& a, Checksum& b) { a.swap(b); } -bool HashTypeStronger::operator() - (const Checksum& lhs, const Checksum& rhs) const +bool HashTypeStronger::operator()(const Checksum& lhs, + const Checksum& rhs) const { return MessageDigest::isStronger(lhs.getHashType(), rhs.getHashType()); } diff --git a/src/Checksum.h b/src/Checksum.h index 686f44a9..2d5bc381 100644 --- a/src/Checksum.h +++ b/src/Checksum.h @@ -45,6 +45,7 @@ class Checksum { private: std::string hashType_; std::string digest_; + public: // digest_ is raw byte array of hash value, not ascii hexadecimal notation. Checksum(std::string hashType, std::string digest); @@ -54,16 +55,10 @@ public: bool isEmpty() const; void setDigest(std::string md); - const std::string& getDigest() const - { - return digest_; - } + const std::string& getDigest() const { return digest_; } void setHashType(std::string type); - const std::string& getHashType() const - { - return hashType_; - } + const std::string& getHashType() const { return hashType_; } void swap(Checksum& other); }; diff --git a/src/ChecksumCheckIntegrityEntry.cc b/src/ChecksumCheckIntegrityEntry.cc index f1c47e07..9e138155 100644 --- a/src/ChecksumCheckIntegrityEntry.cc +++ b/src/ChecksumCheckIntegrityEntry.cc @@ -44,43 +44,42 @@ namespace aria2 { -ChecksumCheckIntegrityEntry::ChecksumCheckIntegrityEntry -(RequestGroup* requestGroup, std::unique_ptr nextCommand) - : CheckIntegrityEntry{requestGroup, std::move(nextCommand)}, - redownload_{false} -{} +ChecksumCheckIntegrityEntry::ChecksumCheckIntegrityEntry( + RequestGroup* requestGroup, std::unique_ptr nextCommand) + : CheckIntegrityEntry{requestGroup, std::move(nextCommand)}, + redownload_{false} +{ +} ChecksumCheckIntegrityEntry::~ChecksumCheckIntegrityEntry() {} bool ChecksumCheckIntegrityEntry::isValidationReady() { const std::shared_ptr& dctx = - getRequestGroup()->getDownloadContext(); + getRequestGroup()->getDownloadContext(); return dctx->isChecksumVerificationAvailable(); } void ChecksumCheckIntegrityEntry::initValidator() { - auto validator = make_unique - (getRequestGroup()->getDownloadContext(), - getRequestGroup()->getPieceStorage()); + auto validator = make_unique( + getRequestGroup()->getDownloadContext(), + getRequestGroup()->getPieceStorage()); validator->init(); setValidator(std::move(validator)); } -void -ChecksumCheckIntegrityEntry::onDownloadFinished -(std::vector>& commands, DownloadEngine* e) -{} - -void -ChecksumCheckIntegrityEntry::onDownloadIncomplete -(std::vector>& commands, DownloadEngine* e) +void ChecksumCheckIntegrityEntry::onDownloadFinished( + std::vector>& commands, DownloadEngine* e) { - if(redownload_) { - proceedFileAllocation(commands, - make_unique - (getRequestGroup(), popNextCommand()), +} + +void ChecksumCheckIntegrityEntry::onDownloadIncomplete( + std::vector>& commands, DownloadEngine* e) +{ + if (redownload_) { + proceedFileAllocation(commands, make_unique( + getRequestGroup(), popNextCommand()), e); return; } diff --git a/src/ChecksumCheckIntegrityEntry.h b/src/ChecksumCheckIntegrityEntry.h index f043bb6f..8930487a 100644 --- a/src/ChecksumCheckIntegrityEntry.h +++ b/src/ChecksumCheckIntegrityEntry.h @@ -39,14 +39,14 @@ namespace aria2 { -class ChecksumCheckIntegrityEntry:public CheckIntegrityEntry -{ +class ChecksumCheckIntegrityEntry : public CheckIntegrityEntry { private: bool redownload_; + public: - ChecksumCheckIntegrityEntry(RequestGroup* requestGroup, - std::unique_ptr nextCommand = - std::unique_ptr()); + ChecksumCheckIntegrityEntry( + RequestGroup* requestGroup, + std::unique_ptr nextCommand = std::unique_ptr()); virtual ~ChecksumCheckIntegrityEntry(); @@ -54,18 +54,15 @@ public: virtual void initValidator() CXX11_OVERRIDE; - virtual void onDownloadFinished - (std::vector>& commands, - DownloadEngine* e) CXX11_OVERRIDE; + virtual void + onDownloadFinished(std::vector>& commands, + DownloadEngine* e) CXX11_OVERRIDE; - virtual void onDownloadIncomplete - (std::vector>& commands, - DownloadEngine* e) CXX11_OVERRIDE; + virtual void + onDownloadIncomplete(std::vector>& commands, + DownloadEngine* e) CXX11_OVERRIDE; - void setRedownload(bool redownload) - { - redownload_ = redownload; - } + void setRedownload(bool redownload) { redownload_ = redownload; } }; } // namespace aria2 diff --git a/src/ChunkChecksum.cc b/src/ChunkChecksum.cc index 3a081778..1f55a74b 100644 --- a/src/ChunkChecksum.cc +++ b/src/ChunkChecksum.cc @@ -37,20 +37,19 @@ namespace aria2 { -ChunkChecksum::ChunkChecksum():pieceLength_(0) {} +ChunkChecksum::ChunkChecksum() : pieceLength_(0) {} -ChunkChecksum::ChunkChecksum -(std::string hashType, - std::vector pieceHashes, - int32_t pieceLength) - : hashType_(std::move(hashType)), - pieceHashes_(std::move(pieceHashes)), - pieceLength_(pieceLength) -{} +ChunkChecksum::ChunkChecksum(std::string hashType, + std::vector pieceHashes, + int32_t pieceLength) + : hashType_(std::move(hashType)), + pieceHashes_(std::move(pieceHashes)), + pieceLength_(pieceLength) +{ +} -bool ChunkChecksum::validateChunk -(const std::string& actualDigest, - size_t index) const +bool ChunkChecksum::validateChunk(const std::string& actualDigest, + size_t index) const { const std::string& digest = getPieceHash(index); return !digest.empty() && actualDigest == digest; @@ -58,19 +57,17 @@ bool ChunkChecksum::validateChunk int64_t ChunkChecksum::getEstimatedDataLength() const { - return static_cast(pieceLength_)*pieceHashes_.size(); + return static_cast(pieceLength_) * pieceHashes_.size(); } -size_t ChunkChecksum::countPieceHash() const -{ - return pieceHashes_.size(); -} +size_t ChunkChecksum::countPieceHash() const { return pieceHashes_.size(); } const std::string& ChunkChecksum::getPieceHash(size_t index) const { - if(index < pieceHashes_.size()) { + if (index < pieceHashes_.size()) { return pieceHashes_[index]; - } else { + } + else { return A2STR::NIL; } } diff --git a/src/ChunkChecksum.h b/src/ChunkChecksum.h index 14acac85..dfa5bff2 100644 --- a/src/ChunkChecksum.h +++ b/src/ChunkChecksum.h @@ -47,16 +47,14 @@ private: std::string hashType_; std::vector pieceHashes_; int32_t pieceLength_; + public: ChunkChecksum(); - ChunkChecksum - (std::string hashType, - std::vector pieceHashes, - int32_t pieceLength); + ChunkChecksum(std::string hashType, std::vector pieceHashes, + int32_t pieceLength); - bool validateChunk(const std::string& actualDigest, - size_t index) const; + bool validateChunk(const std::string& actualDigest, size_t index) const; int64_t getEstimatedDataLength() const; @@ -71,20 +69,11 @@ public: } void setHashType(std::string hashType); - const std::string& getHashType() const - { - return hashType_; - } + const std::string& getHashType() const { return hashType_; } - int32_t getPieceLength() const - { - return pieceLength_; - } + int32_t getPieceLength() const { return pieceLength_; } - void setPieceLength(int32_t length) - { - pieceLength_ = length; - } + void setPieceLength(int32_t length) { pieceLength_ = length; } }; } // namespace aria2 diff --git a/src/ChunkedDecodingStreamFilter.cc b/src/ChunkedDecodingStreamFilter.cc index 6c98bd5f..9101ceab 100644 --- a/src/ChunkedDecodingStreamFilter.cc +++ b/src/ChunkedDecodingStreamFilter.cc @@ -43,8 +43,8 @@ namespace aria2 { -const std::string ChunkedDecodingStreamFilter::NAME -("ChunkedDecodingStreamFilter"); +const std::string + ChunkedDecodingStreamFilter::NAME("ChunkedDecodingStreamFilter"); namespace { enum { @@ -64,128 +64,141 @@ enum { }; } // namespace -ChunkedDecodingStreamFilter::ChunkedDecodingStreamFilter -(std::unique_ptr delegate) - : StreamFilter{std::move(delegate)}, - state_{PREV_CHUNK_SIZE}, - chunkSize_{0}, - chunkRemaining_{0}, - bytesProcessed_{0} -{} +ChunkedDecodingStreamFilter::ChunkedDecodingStreamFilter( + std::unique_ptr delegate) + : StreamFilter{std::move(delegate)}, + state_{PREV_CHUNK_SIZE}, + chunkSize_{0}, + chunkRemaining_{0}, + bytesProcessed_{0} +{ +} ChunkedDecodingStreamFilter::~ChunkedDecodingStreamFilter() {} void ChunkedDecodingStreamFilter::init() {} -ssize_t ChunkedDecodingStreamFilter::transform -(const std::shared_ptr& out, - const std::shared_ptr& segment, - const unsigned char* inbuf, size_t inlen) +ssize_t +ChunkedDecodingStreamFilter::transform(const std::shared_ptr& out, + const std::shared_ptr& segment, + const unsigned char* inbuf, size_t inlen) { ssize_t outlen = 0; size_t i; bytesProcessed_ = 0; - for(i = 0; i < inlen; ++i) { + for (i = 0; i < inlen; ++i) { unsigned char c = inbuf[i]; - switch(state_) { + switch (state_) { case PREV_CHUNK_SIZE: - if(util::isHexDigit(c)) { + if (util::isHexDigit(c)) { chunkSize_ = util::hexCharToUInt(c); state_ = CHUNK_SIZE; - } else { + } + else { throw DL_ABORT_EX("Bad chunk size: not hex string"); } break; case CHUNK_SIZE: - if(util::isHexDigit(c)) { - if(chunkSize_ & 0x7800000000000000LL) { + if (util::isHexDigit(c)) { + if (chunkSize_ & 0x7800000000000000LL) { throw DL_ABORT_EX("Too big chunk size"); } chunkSize_ <<= 4; chunkSize_ += util::hexCharToUInt(c); - } else if(c == ';') { + } + else if (c == ';') { state_ = CHUNK_EXTENSION; - } else if(c == '\r') { + } + else if (c == '\r') { state_ = PREV_CHUNK_SIZE_LF; - } else { + } + else { throw DL_ABORT_EX("Bad chunk size: not hex string"); } break; case CHUNK_EXTENSION: - if(c == '\r') { + if (c == '\r') { state_ = PREV_CHUNK_SIZE_LF; } break; case PREV_CHUNK_SIZE_LF: - if(c == '\n') { + if (c == '\n') { chunkRemaining_ = chunkSize_; - if(chunkSize_ == 0) { + if (chunkSize_ == 0) { state_ = PREV_TRAILER; - } else { + } + else { state_ = CHUNK; } - } else { + } + else { throw DL_ABORT_EX("Bad chunk encoding: " "missing LF at the end of chunk size"); } break; case CHUNK: { - int64_t readlen = std::min(chunkRemaining_, - static_cast(inlen-i)); - outlen += getDelegate()->transform(out, segment, inbuf+i, readlen); + int64_t readlen = + std::min(chunkRemaining_, static_cast(inlen - i)); + outlen += getDelegate()->transform(out, segment, inbuf + i, readlen); chunkRemaining_ -= readlen; - i += readlen-1; - if(chunkRemaining_ == 0) { + i += readlen - 1; + if (chunkRemaining_ == 0) { state_ = PREV_CHUNK_CR; } break; } case PREV_CHUNK_CR: - if(c == '\r') { + if (c == '\r') { state_ = PREV_CHUNK_LF; - } else { + } + else { throw DL_ABORT_EX("Bad chunk encoding: " "missing CR at the end of chunk"); } break; case PREV_CHUNK_LF: - if(c == '\n') { - if(chunkSize_ == 0) { + if (c == '\n') { + if (chunkSize_ == 0) { state_ = PREV_TRAILER; - } else { + } + else { chunkSize_ = chunkRemaining_ = 0; state_ = PREV_CHUNK_SIZE; } - } else { + } + else { throw DL_ABORT_EX("Bad chunk encoding: " "missing LF at the end of chunk"); } break; case PREV_TRAILER: - if(c == '\r') { + if (c == '\r') { // No trailer state_ = PREV_END_LF; - } else { - state_= TRAILER; + } + else { + state_ = TRAILER; } break; case TRAILER: - if(c == '\r') { + if (c == '\r') { state_ = PREV_TRAILER_LF; } break; case PREV_TRAILER_LF: - if(c == '\n') { + if (c == '\n') { state_ = PREV_TRAILER; - } else { + } + else { throw DL_ABORT_EX("Bad chunk encoding: " "missing LF at the end of trailer"); } break; case PREV_END_LF: - if(c == '\n') { + if (c == '\n') { state_ = CHUNKS_COMPLETE; - } else { + } + else { throw DL_ABORT_EX("Bad chunk encoding: " "missing LF at the end of chunks"); } @@ -197,7 +210,7 @@ ssize_t ChunkedDecodingStreamFilter::transform assert(0); } } - fin: +fin: bytesProcessed_ += i; return outlen; } @@ -209,9 +222,6 @@ bool ChunkedDecodingStreamFilter::finished() void ChunkedDecodingStreamFilter::release() {} -const std::string& ChunkedDecodingStreamFilter::getName() const -{ - return NAME; -} +const std::string& ChunkedDecodingStreamFilter::getName() const { return NAME; } } // namespace aria2 diff --git a/src/ChunkedDecodingStreamFilter.h b/src/ChunkedDecodingStreamFilter.h index 10c4abfa..352859f8 100644 --- a/src/ChunkedDecodingStreamFilter.h +++ b/src/ChunkedDecodingStreamFilter.h @@ -45,18 +45,18 @@ private: int64_t chunkSize_; int64_t chunkRemaining_; size_t bytesProcessed_; + public: - ChunkedDecodingStreamFilter - (std::unique_ptr delegate = nullptr); + ChunkedDecodingStreamFilter(std::unique_ptr delegate = nullptr); virtual ~ChunkedDecodingStreamFilter(); virtual void init() CXX11_OVERRIDE; - virtual ssize_t transform - (const std::shared_ptr& out, - const std::shared_ptr& segment, - const unsigned char* inbuf, size_t inlen) CXX11_OVERRIDE; + virtual ssize_t transform(const std::shared_ptr& out, + const std::shared_ptr& segment, + const unsigned char* inbuf, + size_t inlen) CXX11_OVERRIDE; virtual bool finished() CXX11_OVERRIDE; diff --git a/src/ColorizedStream.cc b/src/ColorizedStream.cc index 0f7656c3..b84ec08c 100644 --- a/src/ColorizedStream.cc +++ b/src/ColorizedStream.cc @@ -35,7 +35,6 @@ #include "ColorizedStream.h" - namespace aria2 { namespace colors { @@ -63,7 +62,7 @@ const Color clear("0"); std::string ColorizedStreamBuf::str(bool color) const { std::stringstream rv; - for (const auto& e: elems) { + for (const auto& e : elems) { if (color || e.first != eColor) { rv << e.second; } @@ -77,7 +76,7 @@ std::string ColorizedStreamBuf::str(bool color) const std::string ColorizedStreamBuf::str(bool color, size_t max) const { std::stringstream rv; - for (const auto& e: elems) { + for (const auto& e : elems) { if (e.first == eColor) { if (color) { rv << e.second; diff --git a/src/ColorizedStream.h b/src/ColorizedStream.h index fb5e4b7e..867af87a 100644 --- a/src/ColorizedStream.h +++ b/src/ColorizedStream.h @@ -46,19 +46,14 @@ namespace aria2 { namespace colors { -class Color -{ +class Color { private: std::string str_; public: - explicit Color(const char* str) - : str_(std::string("\033[") + str + "m") - {} + explicit Color(const char* str) : str_(std::string("\033[") + str + "m") {} - const std::string& str() const { - return str_; - } + const std::string& str() const { return str_; } }; extern const Color black; @@ -83,23 +78,14 @@ extern const Color clear; } // namespace colors typedef std::char_traits traits_t; -class ColorizedStreamBuf - : public std::basic_streambuf -{ - enum part_t - { - eColor, - eString - }; +class ColorizedStreamBuf : public std::basic_streambuf { + enum part_t { eColor, eString }; typedef std::pair elem_t; typedef std::deque elems_t; elems_t elems; public: - ColorizedStreamBuf() - { - elems.push_back(std::make_pair(eString, "")); - } + ColorizedStreamBuf() { elems.push_back(std::make_pair(eString, "")); } void setColor(const colors::Color& color) { @@ -113,45 +99,28 @@ public: return std::char_traits::not_eof(c); } - void append(const std::string& str) - { - elems.back().second += str; - } + void append(const std::string& str) { elems.back().second += str; } - void append(const char* str) - { - elems.back().second += str; - } + void append(const char* str) { elems.back().second += str; } std::string str(bool color) const; std::string str(bool color, size_t max) const; }; -class ColorizedStream: public std::basic_ostream -{ +class ColorizedStream : public std::basic_ostream { public: ColorizedStream() - : std::basic_ios(&buf), - std::basic_ostream(&buf) + : std::basic_ios(&buf), + std::basic_ostream(&buf) { init(&buf); } - void setColor(const colors::Color& color) - { - buf.setColor(color); - } - void append(const std::string& str) { - buf.append(str); - } - void append(const char* str) { - buf.append(str); - } + void setColor(const colors::Color& color) { buf.setColor(color); } + void append(const std::string& str) { buf.append(str); } + void append(const char* str) { buf.append(str); } - std::string str(bool colors) const - { - return buf.str(colors); - } + std::string str(bool colors) const { return buf.str(colors); } std::string str(bool colors, size_t max) const { return buf.str(colors, max); @@ -161,22 +130,21 @@ private: ColorizedStreamBuf buf; }; -inline -ColorizedStream& operator<<(ColorizedStream& stream, const std::string& str) +inline ColorizedStream& operator<<(ColorizedStream& stream, + const std::string& str) { stream.append(str); return stream; } -inline -ColorizedStream& operator<<(ColorizedStream& stream, const char* str) +inline ColorizedStream& operator<<(ColorizedStream& stream, const char* str) { stream.append(str); return stream; } -inline -ColorizedStream& operator<<(ColorizedStream& stream, const colors::Color& c) +inline ColorizedStream& operator<<(ColorizedStream& stream, + const colors::Color& c) { stream.setColor(c); return stream; diff --git a/src/Command.cc b/src/Command.cc index b9e236b7..d24471cd 100644 --- a/src/Command.cc +++ b/src/Command.cc @@ -38,17 +38,18 @@ namespace aria2 { Command::Command(cuid_t cuid) - : cuid_(cuid), - status_(STATUS_INACTIVE), - readEvent_(false), - writeEvent_(false), - errorEvent_(false), - hupEvent_(false) -{} + : cuid_(cuid), + status_(STATUS_INACTIVE), + readEvent_(false), + writeEvent_(false), + errorEvent_(false), + hupEvent_(false) +{ +} void Command::transitStatus() { - switch(status_) { + switch (status_) { case STATUS_REALTIME: break; default: @@ -56,30 +57,15 @@ void Command::transitStatus() } } -void Command::setStatus(STATUS status) -{ - status_ = status; -} +void Command::setStatus(STATUS status) { status_ = status; } -void Command::readEventReceived() -{ - readEvent_ = true; -} +void Command::readEventReceived() { readEvent_ = true; } -void Command::writeEventReceived() -{ - writeEvent_ = true; -} +void Command::writeEventReceived() { writeEvent_ = true; } -void Command::errorEventReceived() -{ - errorEvent_ = true; -} +void Command::errorEventReceived() { errorEvent_ = true; } -void Command::hupEventReceived() -{ - hupEvent_ = true; -} +void Command::hupEventReceived() { hupEvent_ = true; } void Command::clearIOEvents() { diff --git a/src/Command.h b/src/Command.h index 07d4de6d..a50cb811 100644 --- a/src/Command.h +++ b/src/Command.h @@ -62,25 +62,13 @@ private: bool hupEvent_; protected: - bool readEventEnabled() const - { - return readEvent_; - } + bool readEventEnabled() const { return readEvent_; } - bool writeEventEnabled() const - { - return writeEvent_; - } + bool writeEventEnabled() const { return writeEvent_; } - bool errorEventEnabled() const - { - return errorEvent_; - } + bool errorEventEnabled() const { return errorEvent_; } - bool hupEventEnabled() const - { - return hupEvent_; - } + bool hupEventEnabled() const { return hupEvent_; } public: Command(cuid_t cuid); diff --git a/src/ConnectCommand.cc b/src/ConnectCommand.cc index f4fd534b..5d1566be 100644 --- a/src/ConnectCommand.cc +++ b/src/ConnectCommand.cc @@ -47,15 +47,13 @@ namespace aria2 { -ConnectCommand::ConnectCommand(cuid_t cuid, - const std::shared_ptr& req, +ConnectCommand::ConnectCommand(cuid_t cuid, const std::shared_ptr& req, const std::shared_ptr& proxyRequest, const std::shared_ptr& fileEntry, - RequestGroup* requestGroup, - DownloadEngine* e, + RequestGroup* requestGroup, DownloadEngine* e, const std::shared_ptr& s) - : AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), - proxyRequest_(proxyRequest) + : AbstractCommand(cuid, req, fileEntry, requestGroup, e, s), + proxyRequest_(proxyRequest) { setTimeout(std::chrono::seconds(getOption()->getAsInt(PREF_CONNECT_TIMEOUT))); disableReadCheckSocket(); @@ -64,19 +62,19 @@ ConnectCommand::ConnectCommand(cuid_t cuid, ConnectCommand::~ConnectCommand() { - if(backupConnectionInfo_) { + if (backupConnectionInfo_) { backupConnectionInfo_->cancel = true; } } -void ConnectCommand::setControlChain -(const std::shared_ptr >& chain) +void ConnectCommand::setControlChain( + const std::shared_ptr>& chain) { chain_ = chain; } -void ConnectCommand::setBackupConnectInfo -(const std::shared_ptr& info) +void ConnectCommand::setBackupConnectInfo( + const std::shared_ptr& info) { backupConnectionInfo_ = info; } @@ -88,13 +86,12 @@ const std::shared_ptr& ConnectCommand::getProxyRequest() const bool ConnectCommand::executeInternal() { - if(backupConnectionInfo_ && !backupConnectionInfo_->ipaddr.empty()) { + if (backupConnectionInfo_ && !backupConnectionInfo_->ipaddr.empty()) { A2_LOG_INFO(fmt("CUID#%" PRId64 " - Use backup connection address %s", getCuid(), backupConnectionInfo_->ipaddr.c_str())); - getDownloadEngine()->markBadIPAddress - (getRequest()->getConnectedHostname(), - getRequest()->getConnectedAddr(), - getRequest()->getConnectedPort()); + getDownloadEngine()->markBadIPAddress(getRequest()->getConnectedHostname(), + getRequest()->getConnectedAddr(), + getRequest()->getConnectedPort()); getRequest()->setConnectedAddrInfo(getRequest()->getConnectedHostname(), backupConnectionInfo_->ipaddr, @@ -102,12 +99,12 @@ bool ConnectCommand::executeInternal() swapSocket(backupConnectionInfo_->socket); backupConnectionInfo_.reset(); } - if(!checkIfConnectionEstablished - (getSocket(), getRequest()->getConnectedHostname(), - getRequest()->getConnectedAddr(), getRequest()->getConnectedPort())) { + if (!checkIfConnectionEstablished( + getSocket(), getRequest()->getConnectedHostname(), + getRequest()->getConnectedAddr(), getRequest()->getConnectedPort())) { return true; } - if(backupConnectionInfo_) { + if (backupConnectionInfo_) { backupConnectionInfo_->cancel = true; backupConnectionInfo_.reset(); } diff --git a/src/ConnectCommand.h b/src/ConnectCommand.h index 29a4cca1..32cfa8e5 100644 --- a/src/ConnectCommand.h +++ b/src/ConnectCommand.h @@ -44,25 +44,25 @@ struct BackupConnectInfo; class ConnectCommand : public AbstractCommand { public: - ConnectCommand(cuid_t cuid, - const std::shared_ptr& req, + ConnectCommand(cuid_t cuid, const std::shared_ptr& req, const std::shared_ptr& proxyRequest, const std::shared_ptr& fileEntry, - RequestGroup* requestGroup, - DownloadEngine* e, + RequestGroup* requestGroup, DownloadEngine* e, const std::shared_ptr& s); virtual ~ConnectCommand(); - void setControlChain - (const std::shared_ptr >& chain); + void + setControlChain(const std::shared_ptr>& chain); void setBackupConnectInfo(const std::shared_ptr& info); const std::shared_ptr& getProxyRequest() const; + protected: virtual bool executeInternal() CXX11_OVERRIDE; virtual bool noCheck() const CXX11_OVERRIDE; + private: std::shared_ptr proxyRequest_; std::shared_ptr backupConnectionInfo_; - std::shared_ptr > chain_; + std::shared_ptr> chain_; }; } // namespace aria2 diff --git a/src/ConsoleStatCalc.cc b/src/ConsoleStatCalc.cc index 0dd4366e..066e814f 100644 --- a/src/ConsoleStatCalc.cc +++ b/src/ConsoleStatCalc.cc @@ -66,9 +66,9 @@ #include "Option.h" #ifdef ENABLE_BITTORRENT -# include "bittorrent_helper.h" -# include "PeerStorage.h" -# include "BtRegistry.h" +#include "bittorrent_helper.h" +#include "PeerStorage.h" +#include "BtRegistry.h" #endif // ENABLE_BITTORRENT namespace aria2 { @@ -79,7 +79,7 @@ std::string SizeFormatter::operator()(int64_t size) const } namespace { -class AbbrevSizeFormatter:public SizeFormatter { +class AbbrevSizeFormatter : public SizeFormatter { protected: virtual std::string format(int64_t size) const CXX11_OVERRIDE { @@ -89,7 +89,7 @@ protected: } // namespace namespace { -class PlainSizeFormatter:public SizeFormatter { +class PlainSizeFormatter : public SizeFormatter { protected: virtual std::string format(int64_t size) const CXX11_OVERRIDE { @@ -105,29 +105,28 @@ void printSizeProgress(ColorizedStream& o, const SizeFormatter& sizeFormatter) { #ifdef ENABLE_BITTORRENT - if(rg->getDownloadContext()->hasAttribute(CTX_ATTR_BT) && - !bittorrent::getTorrentAttrs(rg->getDownloadContext()) - ->metadata.empty() && rg->downloadFinished()) { + if (rg->isSeeder()) { o << "SEED("; - if(rg->getCompletedLength() > 0) { + if (rg->getCompletedLength() > 0) { std::streamsize oldprec = o.precision(); o << std::fixed << std::setprecision(1) - << ((stat.allTimeUploadLength*10)/rg->getCompletedLength())/10.0 - << std::setprecision(oldprec) - << std::resetiosflags(std::ios::fixed); - } else { + << ((stat.allTimeUploadLength * 10) / rg->getCompletedLength()) / 10.0 + << std::setprecision(oldprec) << std::resetiosflags(std::ios::fixed); + } + else { o << "--"; } o << ")"; - } else + } + else #endif // ENABLE_BITTORRENT - { - o << sizeFormatter(rg->getCompletedLength()) << "B/" - << sizeFormatter(rg->getTotalLength()) << "B"; - if(rg->getTotalLength() > 0) { - o << "(" << 100*rg->getCompletedLength()/rg->getTotalLength() << "%)"; - } + { + o << sizeFormatter(rg->getCompletedLength()) << "B/" + << sizeFormatter(rg->getTotalLength()) << "B"; + if (rg->getTotalLength() > 0) { + o << "(" << 100 * rg->getCompletedLength() / rg->getTotalLength() << "%)"; } + } } } // namespace @@ -146,20 +145,19 @@ void printProgressCompact(ColorizedStream& o, const DownloadEngine* e, o << "]"; } - const RequestGroupList& groups = - e->getRequestGroupMan()->getRequestGroups(); + const RequestGroupList& groups = e->getRequestGroupMan()->getRequestGroups(); size_t cnt = 0; const size_t MAX_ITEM = 5; - for(auto i = groups.begin(), - eoi = groups.end(); i != eoi && cnt < MAX_ITEM; ++i, ++cnt) { + for (auto i = groups.begin(), eoi = groups.end(); i != eoi && cnt < MAX_ITEM; + ++i, ++cnt) { const std::shared_ptr& rg = *i; TransferStat stat = rg->calculateStat(); o << "[#" << GroupId::toAbbrevHex(rg->getGID()) << " "; printSizeProgress(o, rg, stat, sizeFormatter); o << "]"; } - if(cnt < groups.size()) { - o << "(+" << groups.size()-cnt << ")"; + if (cnt < groups.size()) { + o << "(+" << groups.size() - cnt << ")"; } } } // namespace @@ -170,30 +168,28 @@ void printProgress(ColorizedStream& o, const std::shared_ptr& rg, { TransferStat stat = rg->calculateStat(); int eta = 0; - if(rg->getTotalLength() > 0 && stat.downloadSpeed > 0) { - eta = (rg->getTotalLength()-rg->getCompletedLength())/stat.downloadSpeed; + if (rg->getTotalLength() > 0 && stat.downloadSpeed > 0) { + eta = + (rg->getTotalLength() - rg->getCompletedLength()) / stat.downloadSpeed; } o << "[#" << GroupId::toAbbrevHex(rg->getGID()) << " "; printSizeProgress(o, rg, stat, sizeFormatter); - o << " CN:" - << rg->getNumConnection(); + o << " CN:" << rg->getNumConnection(); #ifdef ENABLE_BITTORRENT auto btObj = e->getBtRegistry()->get(rg->getGID()); - if(btObj) { + if (btObj) { const PeerSet& peers = btObj->peerStorage->getUsedPeers(); - o << " SD:" - << countSeeder(peers.begin(), peers.end()); + o << " SD:" << countSeeder(peers.begin(), peers.end()); } #endif // ENABLE_BITTORRENT if (!rg->downloadFinished()) { - o << " DL:" << - colors::green << sizeFormatter(stat.downloadSpeed) << "B" << - colors::clear; + o << " DL:" << colors::green << sizeFormatter(stat.downloadSpeed) << "B" + << colors::clear; } if (stat.sessionUploadLength > 0) { - o << " UL:" << - colors::cyan << sizeFormatter(stat.uploadSpeed) << "B" << colors::clear; + o << " UL:" << colors::cyan << sizeFormatter(stat.uploadSpeed) << "B" + << colors::clear; o << "(" << sizeFormatter(stat.allTimeUploadLength) << "B)"; } if (eta > 0) { @@ -204,30 +200,30 @@ void printProgress(ColorizedStream& o, const std::shared_ptr& rg, } // namespace namespace { -class PrintSummary -{ +class PrintSummary { private: size_t cols_; const DownloadEngine* e_; const SizeFormatter& sizeFormatter_; + public: - PrintSummary - (size_t cols, const DownloadEngine* e, - const SizeFormatter& sizeFormatter): - cols_(cols), e_(e), sizeFormatter_(sizeFormatter) {} + PrintSummary(size_t cols, const DownloadEngine* e, + const SizeFormatter& sizeFormatter) + : cols_(cols), e_(e), sizeFormatter_(sizeFormatter) + { + } void operator()(const RequestGroupList::value_type& rg) { const char SEP_CHAR = '-'; ColorizedStream o; printProgress(o, rg, e_, sizeFormatter_); - const std::vector >& fileEntries = - rg->getDownloadContext()->getFileEntries(); + const std::vector>& fileEntries = + rg->getDownloadContext()->getFileEntries(); o << "\nFILE: "; - writeFilePath(fileEntries.begin(), fileEntries.end(), - o, rg->inMemoryDownload()); - o << "\n" - << std::setfill(SEP_CHAR) << std::setw(cols_) << SEP_CHAR << "\n"; + writeFilePath(fileEntries.begin(), fileEntries.end(), o, + rg->inMemoryDownload()); + o << "\n" << std::setfill(SEP_CHAR) << std::setw(cols_) << SEP_CHAR << "\n"; auto str = o.str(false); global::cout()->write(str.c_str()); } @@ -248,17 +244,18 @@ void printProgressSummary(const RequestGroupList& groups, size_t cols, time_t now; struct tm* staticNowtmPtr; char buf[26]; - if(time(&now) != (time_t)-1 && (staticNowtmPtr = localtime(&now)) != nullptr && - asctime_r(staticNowtmPtr, buf) != nullptr) { + if (time(&now) != (time_t)-1 && + (staticNowtmPtr = localtime(&now)) != nullptr && + asctime_r(staticNowtmPtr, buf) != nullptr) { char* lfptr = strchr(buf, '\n'); - if(lfptr) { + if (lfptr) { *lfptr = '\0'; } o << " as of " << buf; } } - o << " *** \n" - << std::setfill(SEP_CHAR) << std::setw(cols) << SEP_CHAR << "\n"; + o << " *** \n" << std::setfill(SEP_CHAR) << std::setw(cols) << SEP_CHAR + << "\n"; global::cout()->write(o.str().c_str()); std::for_each(groups.begin(), groups.end(), PrintSummary(cols, e, sizeFormatter)); @@ -266,30 +263,29 @@ void printProgressSummary(const RequestGroupList& groups, size_t cols, } // namespace ConsoleStatCalc::ConsoleStatCalc(std::chrono::seconds summaryInterval, - bool colorOutput, - bool humanReadable): - summaryInterval_(std::move(summaryInterval)), - readoutVisibility_(true), - truncate_(true), + bool colorOutput, bool humanReadable) + : summaryInterval_(std::move(summaryInterval)), + readoutVisibility_(true), + truncate_(true), #ifdef __MINGW32__ - isTTY_(true), -#else // !__MINGW32__ - isTTY_(isatty(STDOUT_FILENO) == 1), + isTTY_(true), +#else // !__MINGW32__ + isTTY_(isatty(STDOUT_FILENO) == 1), #endif // !__MINGW32__ - colorOutput_(colorOutput) + colorOutput_(colorOutput) { - if(humanReadable) { + if (humanReadable) { sizeFormatter_ = make_unique(); - } else { + } + else { sizeFormatter_ = make_unique(); } } -void -ConsoleStatCalc::calculateStat(const DownloadEngine* e) +void ConsoleStatCalc::calculateStat(const DownloadEngine* e) { - if(cp_.difference(global::wallclock()) + A2_DELTA_MILLIS < - std::chrono::milliseconds(1000)) { + if (cp_.difference(global::wallclock()) + A2_DELTA_MILLIS < + std::chrono::milliseconds(1000)) { return; } cp_ = global::wallclock(); @@ -299,17 +295,18 @@ ConsoleStatCalc::calculateStat(const DownloadEngine* e) // character reached at the last column. unsigned short int cols = 79; - if(isTTY_) { + if (isTTY_) { #ifndef __MINGW32__ #ifdef HAVE_TERMIOS_H struct winsize size; - if(ioctl(STDOUT_FILENO, TIOCGWINSZ, &size) == 0) { - cols = std::max(0, (int)size.ws_col-1); + if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &size) == 0) { + cols = std::max(0, (int)size.ws_col - 1); } #endif // HAVE_TERMIOS_H -#else // __MINGW32__ +#else // __MINGW32__ CONSOLE_SCREEN_BUFFER_INFO info; - if(::GetConsoleScreenBufferInfo(::GetStdHandle(STD_OUTPUT_HANDLE), &info)) { + if (::GetConsoleScreenBufferInfo(::GetStdHandle(STD_OUTPUT_HANDLE), + &info)) { cols = std::max(0, info.dwSize.X - 2); } #endif // !__MINGW32__ @@ -317,10 +314,11 @@ ConsoleStatCalc::calculateStat(const DownloadEngine* e) global::cout()->printf("\r%s\r", line.c_str()); } ColorizedStream o; - if(e->getRequestGroupMan()->countRequestGroup() > 0) { - if((summaryInterval_ > 0_s) && - lastSummaryNotified_.difference(global::wallclock())+ - A2_DELTA_MILLIS >= summaryInterval_) { + if (e->getRequestGroupMan()->countRequestGroup() > 0) { + if ((summaryInterval_ > 0_s) && + lastSummaryNotified_.difference(global::wallclock()) + + A2_DELTA_MILLIS >= + summaryInterval_) { lastSummaryNotified_ = global::wallclock(); printProgressSummary(e->getRequestGroupMan()->getRequestGroups(), cols, e, sizeFormatter); @@ -328,57 +326,60 @@ ConsoleStatCalc::calculateStat(const DownloadEngine* e) global::cout()->flush(); } } - if(!readoutVisibility_) { + if (!readoutVisibility_) { return; } size_t numGroup = e->getRequestGroupMan()->countRequestGroup(); const bool color = global::cout()->supportsColor() && isTTY_ && colorOutput_; - if(numGroup == 1) { + if (numGroup == 1) { const std::shared_ptr& rg = - *e->getRequestGroupMan()->getRequestGroups().begin(); + *e->getRequestGroupMan()->getRequestGroups().begin(); printProgress(o, rg, e, sizeFormatter); - } else if(numGroup > 1) { + } + else if (numGroup > 1) { // For more than 2 RequestGroups, use compact readout form printProgressCompact(o, e, sizeFormatter); } { auto& entry = e->getFileAllocationMan()->getPickedEntry(); - if(entry) { + if (entry) { o << " [FileAlloc:#" << GroupId::toAbbrevHex(entry->getRequestGroup()->getGID()) << " " << sizeFormatter(entry->getCurrentLength()) << "B/" << sizeFormatter(entry->getTotalLength()) << "B("; - if(entry->getTotalLength() > 0) { - o << 100LL*entry->getCurrentLength()/entry->getTotalLength(); - } else { + if (entry->getTotalLength() > 0) { + o << 100LL * entry->getCurrentLength() / entry->getTotalLength(); + } + else { o << "--"; } o << "%)]"; - if(e->getFileAllocationMan()->hasNext()) { + if (e->getFileAllocationMan()->hasNext()) { o << "(+" << e->getFileAllocationMan()->countEntryInQueue() << ")"; } } } { auto& entry = e->getCheckIntegrityMan()->getPickedEntry(); - if(entry) { + if (entry) { o << " [Checksum:#" << GroupId::toAbbrevHex(entry->getRequestGroup()->getGID()) << " " << sizeFormatter(entry->getCurrentLength()) << "B/" << sizeFormatter(entry->getTotalLength()) << "B("; - if(entry->getTotalLength() > 0) { - o << 100LL*entry->getCurrentLength()/entry->getTotalLength(); - } else { + if (entry->getTotalLength() > 0) { + o << 100LL * entry->getCurrentLength() / entry->getTotalLength(); + } + else { o << "--"; } o << "%)]"; - if(e->getCheckIntegrityMan()->hasNext()) { + if (e->getCheckIntegrityMan()->hasNext()) { o << "(+" << e->getCheckIntegrityMan()->countEntryInQueue() << ")"; } } } - if(isTTY_) { + if (isTTY_) { if (truncate_) { auto str = o.str(color, cols); global::cout()->write(str.c_str()); diff --git a/src/ConsoleStatCalc.h b/src/ConsoleStatCalc.h index f3faaaa6..f25e6c60 100644 --- a/src/ConsoleStatCalc.h +++ b/src/ConsoleStatCalc.h @@ -45,17 +45,17 @@ namespace aria2 { -class SizeFormatter:public std::unary_function { +class SizeFormatter : public std::unary_function { protected: virtual std::string format(int64_t size) const = 0; + public: virtual ~SizeFormatter() {} std::string operator()(int64_t size) const; }; -class ConsoleStatCalc:public StatCalc -{ +class ConsoleStatCalc : public StatCalc { private: Timer cp_; @@ -68,6 +68,7 @@ private: bool truncate_; bool isTTY_; bool colorOutput_; + public: ConsoleStatCalc(std::chrono::seconds summaryInterval, bool colorOutput = true, bool humanReadable = true); @@ -81,10 +82,7 @@ public: readoutVisibility_ = visibility; } - void setTruncate(bool truncate) - { - truncate_ = truncate; - } + void setTruncate(bool truncate) { truncate_ = truncate; } }; } // namespace aria2 diff --git a/src/ContentTypeRequestGroupCriteria.cc b/src/ContentTypeRequestGroupCriteria.cc index 68cc7f07..40e311e2 100644 --- a/src/ContentTypeRequestGroupCriteria.cc +++ b/src/ContentTypeRequestGroupCriteria.cc @@ -41,28 +41,30 @@ namespace aria2 { -ContentTypeRequestGroupCriteria::ContentTypeRequestGroupCriteria -(const char** contentTypes, const char** extensions) - : contentTypes_(contentTypes), - extensions_(extensions) -{} +ContentTypeRequestGroupCriteria::ContentTypeRequestGroupCriteria( + const char** contentTypes, const char** extensions) + : contentTypes_(contentTypes), extensions_(extensions) +{ +} ContentTypeRequestGroupCriteria::~ContentTypeRequestGroupCriteria() {} -bool ContentTypeRequestGroupCriteria::match -(const RequestGroup* requestGroup) const +bool ContentTypeRequestGroupCriteria::match( + const RequestGroup* requestGroup) const { - if(requestGroup->getDownloadContext()->getFileEntries().size() != 1) { + if (requestGroup->getDownloadContext()->getFileEntries().size() != 1) { return false; } - for(size_t i = 0; extensions_[i]; ++i) { - if(util::iendsWith(requestGroup->getFirstFilePath(), extensions_[i])) { + for (size_t i = 0; extensions_[i]; ++i) { + if (util::iendsWith(requestGroup->getFirstFilePath(), extensions_[i])) { return true; } } - for(size_t i = 0; contentTypes_[i]; ++i) { - if(util::strieq(requestGroup->getDownloadContext()->getFirstFileEntry()-> - getContentType(), contentTypes_[i])) { + for (size_t i = 0; contentTypes_[i]; ++i) { + if (util::strieq(requestGroup->getDownloadContext() + ->getFirstFileEntry() + ->getContentType(), + contentTypes_[i])) { return true; } } diff --git a/src/ContentTypeRequestGroupCriteria.h b/src/ContentTypeRequestGroupCriteria.h index 371f163d..b5a8bd14 100644 --- a/src/ContentTypeRequestGroupCriteria.h +++ b/src/ContentTypeRequestGroupCriteria.h @@ -41,11 +41,11 @@ namespace aria2 { -class ContentTypeRequestGroupCriteria:public RequestGroupCriteria -{ +class ContentTypeRequestGroupCriteria : public RequestGroupCriteria { private: const char** contentTypes_; const char** extensions_; + public: ContentTypeRequestGroupCriteria(const char** contentTypes, const char** extensions); diff --git a/src/Context.cc b/src/Context.cc index 6a3aac83..7fd52c98 100644 --- a/src/Context.cc +++ b/src/Context.cc @@ -41,7 +41,6 @@ #include #endif // HAVE_SYS_RESOURCE_H - #include #include #include @@ -73,11 +72,11 @@ #include "UriListParser.h" #include "message_digest_helper.h" #ifdef ENABLE_BITTORRENT -# include "bittorrent_helper.h" +#include "bittorrent_helper.h" #endif // ENABLE_BITTORRENT #ifdef ENABLE_METALINK -# include "metalink_helper.h" -# include "MetalinkEntry.h" +#include "metalink_helper.h" +#include "MetalinkEntry.h" #endif // ENABLE_METALINK extern char* optarg; @@ -99,11 +98,10 @@ void showTorrentFile(const std::string& uri) #ifdef ENABLE_METALINK namespace { -void showMetalinkFile -(const std::string& uri, const std::shared_ptr