diff --git a/aria2/AUTHORS b/aria2/AUTHORS new file mode 100644 index 00000000..8e199ba3 --- /dev/null +++ b/aria2/AUTHORS @@ -0,0 +1,80 @@ +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]: + +103yiran +Alexander Amanuel +Alexander Egorenkov +Ali MJ Al-Nasrawy +Anthony Bryan +Artur Petrov +Athmane Madjoudj +Ben Chaney +Char +Cristian Rodríguez +Dan Church +Dan Fandrich +David Macek +Emmanuel Engelhart +FH0 +Florian Gamböck +Fredrik Fornwall +Hernan Martinez +ITriskTI +Igor Khomyakov +Jarda Snajdr +JimmyZ +Juan Francisco Cantero Hurtado +Kcchouette +Kurt Kartaltepe +Michał Górny +Michał Leśniewski +Mingye Wang +Natanael Copa +Nikita Ofitserov +Nils Maier +ORiON- +ReadmeCritic +Richard Nias +Rosen Penev +Ross Smith II +Ryan Steinmetz +Ryo ONODERA +Sarim Khan +Sergey Zolotarev +Sonny Piers +Sébastien Cabaniols +Tatsuhiro Tsujikawa +Torbjörn Lönnemark +Tse Kit Yam +Vasilij Schneidermann +Zoltan Toth-Czifra +a1346054 +amtlib-dot-dll +c3mb0 +carsonzhu +diadistis +eric1932 +geetam +gilberto dos santos alves +gt +klemens +kwkam +luokar +mozillazg +multisnow +nicolov +nkh0472 +oliviercommelarbre +qweaszxcdf +rotor +sleepymac +suzker +tcely +yixinBC + +[1] https://gist.github.com/tatsuhiro-t/deaffeb064652104ad11 diff --git a/aria2/COPYING b/aria2/COPYING new file mode 100644 index 00000000..d159169d --- /dev/null +++ b/aria2/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 2 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, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/aria2/ChangeLog b/aria2/ChangeLog new file mode 100644 index 00000000..ba4c99e6 --- /dev/null +++ b/aria2/ChangeLog @@ -0,0 +1,1181 @@ +commit 02f2d0d8472b3c38c29b4dba8c75ebd5fdd2899a (HEAD, tag: release-1.37.0, origin/master, origin/HEAD, master) +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-15 + + Update bash_completion + +commit 58d06624d2ca8b5a2bf4a6a9fa7ee64612670869 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-15 + + Fix python scripts + +commit 35f1e326ec68c67401e3b4eaff9514454b841d89 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-15 + + Update sphinx_rtd_theme + +commit 936d64d555109423a7610c39b49159a7cdb1fbbd +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-15 + + Bump package version + +commit 2973186e752b2dec086988b611ef4dda3a911c49 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-15 + + Update AUTHORS + +commit 40f45246f447cf1ff1679f13cc7becdac026b8ce +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-15 + + Update NEWS + +commit 0d0d606a85c43dd36623e5b0e097932b3df299e9 +Merge: 706d9492 ec899c30 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-11-15 +Commit: GitHub +CommitDate: 2023-11-15 + + Merge pull request #2135 from aria2/docker-mingw-revert-cares + + Dockerfile.mingw: Downgrade c-ares to 1.19.1 + +commit ec899c30cf495cd0c2a354be022162161a9e732d +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-14 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-14 + + Dockerfile.mingw: Downgrade c-ares to 1.19.1 + + Downgrade c-ares to 1.19.1 in Dockerfile.mingw because it does not + build on x86_64 host. + +commit 706d9492f2ad3d53bec9fdca529204ed77bc99c8 +Merge: 08b48dcc 89551e71 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-11-12 +Commit: GitHub +CommitDate: 2023-11-12 + + Merge pull request #2132 from aria2/docker-bump-cares + + Dockerfile: Bump c-ares to 1.21.0 + +commit 89551e715329bfd93ecac68e90802d03b75479df +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-12 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-12 + + Dockerfile: Bump c-ares to 1.21.0 + +commit 08b48dccb6561f588d83923a248d6abdcd023a91 +Merge: aa036123 8cfaceaf +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-05 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-05 + + Merge branch 'pr1802' + + This resolves conflicts on https://github.com/aria2/aria2/pull/1802 + and does fixups. + +commit 8cfaceaf43f83b14e3038cf0a9e017ef65e9a9db +Author: a1346054 <36859588+a1346054@users.noreply.github.com> +AuthorDate: 2021-08-21 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-05 + + Trim excess whitespace + +commit a6cd75a596a5047bd2c0512e54becd3b86061ffd +Author: a1346054 <36859588+a1346054@users.noreply.github.com> +AuthorDate: 2021-09-12 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-05 + + Fix spelling + +commit aea080969c88c592c47e6986d8e5a15ae3205358 +Author: a1346054 <36859588+a1346054@users.noreply.github.com> +AuthorDate: 2021-08-21 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-05 + + Fix shellcheck warnings + +commit bbef0f04926a4ddc640a409a04e37afcba8cabee +Author: a1346054 <36859588+a1346054@users.noreply.github.com> +AuthorDate: 2021-08-21 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-05 + + Use license file from gnu.org + + Downloaded from: + https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt + +commit aa03612397548e80af965b66832c8c60d83586d3 +Merge: 71f5d1be c7a3b6ac +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-11-05 +Commit: GitHub +CommitDate: 2023-11-05 + + Merge pull request #1982 from h3xx/update-docs + + Various documenation fixes and rewords + +commit 71f5d1be5f1644cd4b4a6a9f266e6c5ae935dfa2 +Merge: d066c72a 7a490fe4 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-11-03 +Commit: GitHub +CommitDate: 2023-11-03 + + Merge pull request #2129 from aria2/fix-non-bt-build-error + + Fix non bt build error + +commit 7a490fe497645b6cc5cc872b197ffb41e278e0f8 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-03 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-03 + + ci: Check build without bittorrent + +commit 94725a037129901fa81fb14e56be529ccbeed9e7 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-03 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-03 + + Fix build error without bittorrent + + Amends #2127 + +commit d066c72a0d5973eff914138b199237ddcec17047 +Merge: d607327e 3330110c +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-11-02 +Commit: GitHub +CommitDate: 2023-11-02 + + Merge pull request #2127 from aria2/cap-infohashlen + + Cap infoHashLength in .aria2 file + +commit 3330110cafebd86b231d860cddea2f36ca8e755c +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-02 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-02 + + Cap infoHashLength in .aria2 file + + Cap infoHashLength in .aria2 file, and save an extra allocation. + +commit d607327ea6dd969c5ccdfa3e4d2693efcddac0b5 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-02 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-02 + + clang-format + +commit df27e60385a3c044d9439b8b0a617d5f39628a10 +Merge: 35a1b0ff 1acfd13c +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-11-02 +Commit: GitHub +CommitDate: 2023-11-02 + + Merge pull request #2126 from aria2/cpp-ext + + Do not require strict C++ mode and update ax_cxx_compile_stdcxx.m4 + +commit 1acfd13c3569e6052d05b6fc66726471429269a2 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-02 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-02 + + Do not require strict C++ mode and update ax_cxx_compile_stdcxx.m4 + +commit 35a1b0ff1d26b25c6b6204c6ce8aea969c658ab8 +Merge: 076dea38 be6d8194 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-11-02 +Commit: GitHub +CommitDate: 2023-11-02 + + Merge pull request #2125 from aria2/bump-compiler + + ci: Bump gcc and clang + +commit be6d81948816087374e34672db54c2f5eb50517c +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-11-02 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-11-02 + + ci: Bump gcc and clang + +commit 076dea3896dba6a8e2acc683818ff60602efa9d4 +Merge: 80d53a9e 8718757e +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-10-09 +Commit: GitHub +CommitDate: 2023-10-09 + + Merge pull request #2117 from egorenar/fix-formatr-string-overflow-in-logger-writeheader + + Logger: Fix format string overflow in writeHeader() + +commit 8718757e6c62aeffd81a2ed9fa88e0c05b6412cf +Author: Alexander Egorenkov +AuthorDate: 2023-10-07 +Commit: Alexander Egorenkov +CommitDate: 2023-10-07 + + Logger: Fix format string overflow in writeHeader() + + This problem occurred on a 32-bit ARM OpenWRT router running Linux 6.1. + The method writeHeader() assumes that the size of struct timeval is 8 bytes + which is not true on this machine, it is 16 bytes large. Therefore, first + cast tv.tv_usec to the unsigned long type. + + ========= + GDB trace + ========= + + (gdb) c + Continuing. + + Program received signal SIGSEGV, Segmentation fault. + 0xb6f4f9b4 in memchr (src=src@entry=0x3b6a, c=c@entry=0x0, n=n@entry=0x7fffffff) at src/string/memchr.c:16 + 16 for (; ((uintptr_t)s & ALIGN) && n && *s != c; s++, n--); + 0xb6f4f98c : 00 00 52 e3 cmp r2, #0 + 0xb6f4f990 : 00 30 a0 e1 mov r3, r0 + 0xb6f4f994 : 05 00 00 1a bne 0xb6f4f9b0 + 0xb6f4f998 : 32 00 00 ea b 0xb6f4fa68 + 0xb6f4f99c : 03 00 13 e3 tst r3, #3 + 0xb6f4f9a0 : 01 20 42 e2 sub r2, r2, #1 + 0xb6f4f9a4 : 36 00 00 0a beq 0xb6f4fa84 + 0xb6f4f9a8 : 00 00 52 e3 cmp r2, #0 + 0xb6f4f9ac : 2d 00 00 0a beq 0xb6f4fa68 + 0xb6f4f9b0 : 03 00 a0 e1 mov r0, r3 + => 0xb6f4f9b4 : 01 c0 d3 e4 ldrb r12, [r3], #1 + 0xb6f4f9b8 : 01 00 5c e1 cmp r12, r1 + 0xb6f4f9bc : f6 ff ff 1a bne 0xb6f4f99c + (gdb) bt + #0 0xb6f4f9b4 in memchr (src=src@entry=0x3b6a, c=c@entry=0x0, n=n@entry=0x7fffffff) at src/string/memchr.c:16 + #1 0xb6f512b4 in strnlen (s=s@entry=0x3b6a , n=n@entry=0x7fffffff) at src/string/strnlen.c:5 + #2 0xb6f19eb4 in printf_core (f=f@entry=0xb67d35b0, fmt=fmt@entry=0x101856 "%s.%06ld [%s] [%s:%d] ", ap=ap@entry=0xbe8f5a1c, nl_arg=nl_arg@entry=0xbe8f5a48, nl_type=, nl_type@entry=0xbe8f5a20) at + src/stdio/vfprintf.c:599 + #3 0xb6f4b86c in vfprintf (f=0xb67d35b0, fmt=0x101856 "%s.%06ld [%s] [%s:%d] ", ap=...) at src/stdio/vfprintf.c:688 + #4 0x0001d92c in aria2::OutputFile::printf (this=, format=0x101856 "%s.%06ld [%s] [%s:%d] ") at OutputFile.h:58 + #5 0x00027910 in aria2::(anonymous namespace)::writeHeader (lineNum=0xba, sourceFile=0x10d842 "HttpServer.cc", level=aria2::Logger::A2_INFO, fp=...) at Logger.cc:136 + #6 aria2::Logger::writeLog (this=0xb67cf78c, level=aria2::Logger::A2_INFO, sourceFile=0x10d842 "HttpServer.cc", lineNum=0xba, msg=0xb6766280 "HTTP Server received request\nPOST /jsonrpc HTTP/1.1\r\nHost: 192.168 + .1.1:6800\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0\r\nAccept: application/json, text/plain, *"..., msg@entry=0x10d842 "HttpServer.cc", trace=trace@entry=0x124806 "") a + t Logger.cc:196 + #7 0x00028bf0 in aria2::Logger::log (this=, level=, sourceFile=, lineNum=, msg=0xb6766280 "HTTP Server received request\nPOST /jsonrpc HTTP/1.1\r\nHost + : 192.168.1.1:6800\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/118.0\r\nAccept: application/json, text/plain, *"...) at Logger.cc:213 + #8 0x00081708 in aria2::HttpServer::receiveRequest (this=0xb6774430) at /home/egorenar/Repositories/openwrt-rel/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/arm-openwrt-linux-muslgnueabi/ + include/c++/12.3.0/bits/basic_string.h:233 + #9 aria2::HttpServerCommand::execute (this=0xb6772620) at HttpServerCommand.cc:194 + #10 0x00076de4 in aria2::(anonymous namespace)::executeCommand (commands=..., statusFilter=aria2::Command::STATUS_ALL) at DownloadEngine.cc:139 + #11 0x0001913c in aria2::DownloadEngine::run (oneshot=0x0, this=0xb67967e0) at DownloadEngine.cc:180 + #12 aria2::MultiUrlRequestInfo::execute (this=0xb67dee6c) at MultiUrlRequestInfo.cc:361 + #13 aria2::main (argv=, argc=) at main.cc:78 + #14 main (argc=, argv=) at main.cc:91 + + (gdb) p tv + $13 = { + tv_sec = 0x652134fd, + tv_usec = 0x3b6a + } + (gdb) call sizeof(tv) + $14 = 0x10 + (gdb) call sizeof(tv.tv_usec) + $15 = 0x8 + (gdb) call sizeof(long) + $16 = 0x4 + (gdb) call sizeof(unsigned long) + $17 = 0x4 + (gdb) call sizeof(time_t) + $18 = 0x8 + + Signed-off-by: Alexander Egorenkov + +commit 80d53a9e80606988bf9e26e0a4a8b92048419b83 +Merge: d53735bf 4fdcd22d +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-18 +Commit: GitHub +CommitDate: 2023-09-18 + + Merge pull request #2108 from aria2/memcpy + + Avoid non-nil argument errors + +commit d53735bf49da4904916055b6591d148c743efef6 +Merge: f05deb0c 5047e4a4 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-18 +Commit: GitHub +CommitDate: 2023-09-18 + + Merge pull request #2107 from aria2/dont-close-stderr-stdout + + Do not close stdout and stderr + +commit 4fdcd22d69262a5fc5edf72926cdbe23530cd954 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-18 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-18 + + Avoid non-nil argument errors + + Use std::copy_n and std::fill_n to avoid a non-nil argument error with + memcpy/memset. + +commit 5047e4a4abd7b43a1c5965db6ef2afbb42063812 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-18 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-18 + + Do not close stdout and stderr + +commit f05deb0cb25437b538b4efbcb4c631ad79c9d26a +Merge: f0015d21 4c250f8a +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-18 +Commit: GitHub +CommitDate: 2023-09-18 + + Merge pull request #2106 from aria2/static-check-fix + + Static check fix + +commit 4c250f8a5ddd73e2bb02d8573bc66432c1dca7b2 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-18 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-18 + + Bail out if pieceLength is 0 + +commit 1fd0e52c41eed159d196c256770cac128ff976f2 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-18 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-18 + + Call the member function of IOFile + +commit c2109a5aca3a68916f6ba0969248e2bc73f49979 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-18 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-18 + + Move instead of copy + +commit f0015d21754ede375360c4fddb005def7ffac50a +Merge: dfc607ae 274e5048 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-18 +Commit: GitHub +CommitDate: 2023-09-18 + + Merge pull request #2105 from aria2/update-sphinx_rtd_theme + + Update sphinx_rtd_theme + +commit dfc607ae742b1de6ff6bd5a8b8d30239f94333e9 +Merge: b18d47c6 376a07df +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-18 +Commit: GitHub +CommitDate: 2023-09-18 + + Merge pull request #2104 from aria2/docker-mingw-update-cp + + Dockerfile.mingw: Update how to get aria2c.exe from a container + +commit b18d47c60ba5aa60b3136dcf278b01bf65de3cae +Merge: e2209a8a 4352a31e +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-18 +Commit: GitHub +CommitDate: 2023-09-18 + + Merge pull request #2103 from aria2/docker-mingw-update-libssh2-flags + + Dockerfile.mingw: Remove deprecated libssh2 configure flags + +commit 274e5048cb3f2a9e00a4a30e50ef1fc6713f9019 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-17 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-17 + + Update sphinx_rtd_theme + +commit 376a07df00dbb62cad2a8d1caebceb705ca2287d +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-17 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-17 + + Dockerfile.mingw: Update how to get aria2c.exe from a container + +commit e2209a8ae1fb9ff388e197c3de5ffe41ae1a96fe +Merge: 506aac6b 6b50ff40 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-17 +Commit: GitHub +CommitDate: 2023-09-17 + + Merge pull request #2102 from aria2/docker-android-add-dpkg-dev + + Dockerfile.android: Add dpkg-dev for dpkg-architecture + +commit 4352a31e6bd293840846149ef471d54d3dcf7dd6 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-17 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-17 + + Dockerfile.mingw: Remove deprecated libssh2 configure flags + +commit 506aac6b4ebfc93de9bafc40e9b782fd84a07ed7 +Merge: 06e3fdbd 8907b835 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-17 +Commit: GitHub +CommitDate: 2023-09-17 + + Merge pull request #2101 from aria2/docker-mingw-parallel-build + + Dockerfile.mingw: Parallel build + +commit 6b50ff403c6e8c313be4c5502059e541a4f4ab0d +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-17 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-17 + + Dockerfile.android: Add dpkg-dev for dpkg-architecture + +commit 8907b8355c3fcd99b7754eae466f411f2ba3df24 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-17 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-17 + + Dockerfile.mingw: Parallel build + +commit 06e3fdbd48ce7e29082a577b5758eb993c526812 +Merge: 80534d86 85142435 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-17 +Commit: GitHub +CommitDate: 2023-09-17 + + Merge pull request #2100 from aria2/release-with-docker + + Make releases with docker + +commit 85142435c60e5ae91fcea4d6a8834bf45bc000b8 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-16 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-17 + + Make releases with docker + + This is slightly different from the current procedure because now + android and mingw binaries are built from source code fetched from the + remote repository. + +commit 80534d869f7395dc8eeaefdb8a1dee25f2136e26 +Merge: 2a809a99 52469aba +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #2099 from aria2/fix-overflow + + Fix overflow + +commit 52469aba85173fab77d0e7a992491f60c8ca703a +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-16 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-16 + + Fix overflow + +commit 2a809a99cd5d9cbd47e43b764a637f5a6d228f2a +Merge: 3a005725 997efc88 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #2098 from aria2/revert-ci-docker-mingw + + Revert "ci: Build mingw image" + +commit 997efc88bb40df7873933de52313c5632e400e38 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-16 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-16 + + Revert "ci: Build mingw image" + + This reverts commit a02ceeb6460eb537d1e48555422b72a8bacde0e4. + +commit 3a0057257c415be236bbbcc94f60fbda0e17865a +Merge: 42b98934 a02ceeb6 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #2097 from aria2/ci-docker-mingw + + ci: Build mingw image + +commit 42b98934632a956163058242a98a7cf19bd65ab0 +Merge: dbbd1bfb 81244a16 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #2096 from aria2/ci-gnutls + + ci: Build with gnutls + +commit a02ceeb6460eb537d1e48555422b72a8bacde0e4 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-16 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-16 + + ci: Build mingw image + +commit 81244a16dd4108d722c984c6fddfca80a64df80c +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-16 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-16 + + ci: Build with gnutls + +commit dbbd1bfbf97548d773e3e7954e6819880ef6bd57 +Merge: dfdbc22b e5d9ad2f +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #2095 from aria2/fix-undefined + + Fix test errors with ubsan + +commit e5d9ad2f0bc007089394ceb2bdf9847887d671bc +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-16 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-16 + + Fix test errors with ubsan + +commit dfdbc22b239311e13facdca926db0aeab9ce28e6 +Merge: ef28a269 66048398 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #2094 from aria2/update-wslay + + Update wslay + +commit 66048398e5da0d931659ae7e8c5e9305a26fac78 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-16 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-16 + + Update wslay + +commit ef28a269aede860f61e737cb7d1bcddcee30a97b +Merge: ea6d4240 8956c58d +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #2093 from aria2/remove-deprecated-unary-binary-fun + + Remove deprecated std::unary_function and std::binary_function + +commit 8956c58d126a4e57e114f69ba6a5961724b7a817 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-16 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-16 + + Remove deprecated std::unary_function and std::binary_function + +commit ea6d4240d04da8b0046fda3333a92d64dd39d536 +Merge: e5bc00d4 13ba7a29 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #2092 from aria2/dockerfile-android + + Add Dockerfile.android + +commit 13ba7a297f0f9fa61b1dd1a99721169b8e41a754 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-16 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-16 + + Add Dockerfile.android + +commit e5bc00d4494ac6da71e76f8c3511d570d0dfe32f +Merge: 8ae5ce5d 11fa3e9f +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #1822 from FH0/master + + android(ndk r23) has timegm + +commit 8ae5ce5df3acfb049874b5ccede455356479be8e +Merge: f7b9d0fd fa2eb95a +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #2091 from aria2/crypto-lib-rand + + Prefer random number generator from crypto libraries + +commit fa2eb95a001392348017a227bdbaa60b50cb5470 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-16 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-16 + + Prefer random number generator from crypto libraries + +commit f7b9d0fdd4071061a8f7795c0ca9d18cef5904a9 +Merge: 385ad3a0 5546d733 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-16 +Commit: GitHub +CommitDate: 2023-09-16 + + Merge pull request #2089 from aria2/update-dockerfile-mingw + + Update Dockerfile.mingw + +commit 5546d733229b07a0ecf4ce8ce50cce6b84ec8639 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-15 + + Update Dockerfile.mingw + +commit 385ad3a04cb0ede7eb634d06120c3bbdda24f571 +Merge: 13c893b3 ae5e5fdf +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-15 +Commit: GitHub +CommitDate: 2023-09-15 + + Merge pull request #2088 from aria2/fix-libssh2-static-link + + Fix static link failure against libssh2 + +commit ae5e5fdf7385164b850bed3ce5237909b6d1f5fd +Author: Tatsuhiro Tsujikawa +AuthorDate: 2023-09-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2023-09-15 + + Fix static link failure against libssh2 + +commit 13c893b34a0ee329887f8621729b86c679d4da81 +Merge: 7e7f549e b850338c +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-15 +Commit: GitHub +CommitDate: 2023-09-15 + + Merge pull request #1804 from nkh0472/patch-1 + + Minor grammar improvements + +commit 7e7f549ef1fb3f63495020857802ebf53e43213f +Merge: b642ee83 56d1e114 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-15 +Commit: GitHub +CommitDate: 2023-09-15 + + Merge pull request #1893 from kelson42/increase-bytearraydiskwriter-max + + Increase ByteArrayDiskWriter maximum size + +commit b642ee838092b82ac938f031746704912a8d3dbc +Merge: f4cbc7bb a787a804 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2023-09-15 +Commit: GitHub +CommitDate: 2023-09-15 + + Merge pull request #2068 from yixinBC/patch-1 + + fix wrong `dht.dat` binary file structure in docs + +commit a787a804955ceabf603c4f821542970641a064c5 +Author: yixinBC +AuthorDate: 2023-06-20 +Commit: GitHub +CommitDate: 2023-06-20 + + fix typo + +commit 40cabe7519d48f8cbac32eabf420d914094c7e1b +Author: yixinBC +AuthorDate: 2023-06-20 +Commit: GitHub +CommitDate: 2023-06-20 + + fix wrong `dht.dat` binary file structure in docs + +commit c7a3b6acb1b7472ce35ccfe76d6b0a47e4a28f6c +Author: Dan Church +AuthorDate: 2022-09-27 +Commit: Dan Church +CommitDate: 2022-09-27 + + Fix grammar, rework layout of `--stream-piece-selector` section + +commit 54af7ad1c5db44f91872aef6942aee0dcc24c320 +Author: Dan Church +AuthorDate: 2022-09-27 +Commit: Dan Church +CommitDate: 2022-09-27 + + Fix misspelled word + +commit 5436b758b7e278e4b657a9dd6cfc12656ce9f085 +Author: Dan Church +AuthorDate: 2022-09-27 +Commit: Dan Church +CommitDate: 2022-09-27 + + Re-word warning about undefined behavior + +commit 356778932509db83f1fb252034bf2f59b45ce727 +Author: Dan Church +AuthorDate: 2022-09-27 +Commit: Dan Church +CommitDate: 2022-09-27 + + Concise-ify note + +commit e5cd19504543b6968decaa806f281ab5f3d0e33f +Author: Dan Church +AuthorDate: 2022-09-27 +Commit: Dan Church +CommitDate: 2022-09-27 + + Change 'meta data' to 'metadata' + +commit f4cbc7bb315b1687679e6ab94648c2685a9e9668 +Merge: 8d5989db 15a96209 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-08-25 +Commit: GitHub +CommitDate: 2022-08-25 + + Merge pull request #1969 from himikof/patch-1 + + Fix Metalink4 parsing with foreign namespaces + +commit 8d5989db22c8c37ed36ee7b2a9583bdea2f11f59 +Merge: 05f3c479 42038422 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-08-25 +Commit: GitHub +CommitDate: 2022-08-25 + + Merge pull request #1970 from himikof/patch-2 + + Fix undefined behavior/crash in GZipEncoder + +commit 42038422f6f43926d4103c27587b5db60ebde747 +Author: Nikita Ofitserov +AuthorDate: 2022-08-24 +Commit: GitHub +CommitDate: 2022-08-24 + + Fix undefined behavior/crash in GZipEncoder + + When the output buffer is full, outbuf[produced] references past the buffer end, leading to UB and a possible assertion failure. + Fixes #1968, #1964 + +commit 15a96209cd0a25fea4398b8c6f6ccd3a488829c9 +Author: Nikita Ofitserov +AuthorDate: 2022-08-23 +Commit: GitHub +CommitDate: 2022-08-23 + + Fix Metalink4 parsing with foreign namespaces + + Rename local checkNsUri helper function to make boolean conditions easily readable, + as the issue was not apparent with the old helper function name. + +commit 05f3c479883b3eed34880fbdbd9ec79c535d369c +Merge: a433352b 182f4f9c +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-08-19 +Commit: GitHub +CommitDate: 2022-08-19 + + Merge pull request #1943 from hmartinez82/FixBuild + + Add missing include to WinTLSSession.h + +commit 182f4f9ca2c2512b930937ce5ebfd7af80a2d991 +Author: Hernan Martinez +AuthorDate: 2022-06-23 +Commit: Hernan Martinez +CommitDate: 2022-06-23 + + Add missing + +commit a433352b675bd6a258ad97c4f339055f08c443ed +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-05-22 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-05-22 + + Move runs-on under strategy + +commit 190ce569e44b0cf95418379afc94890bcdf607fe +Merge: 73cf6d11 e0ef02d2 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-05-22 +Commit: GitHub +CommitDate: 2022-05-22 + + Merge pull request #1929 from aria2/bump-ubuntu + + Bump workflow ubuntu + +commit e0ef02d243f7ef721757433b3e9c044f3cf6aa2c +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-05-22 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-05-22 + + Bump workflow ubuntu + +commit 73cf6d110d9868838776265da51329ff28f5f0b2 +Merge: d4b96e24 2c21331a +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-05-15 +Commit: GitHub +CommitDate: 2022-05-15 + + Merge pull request #1923 from aria2/bump-actions + + Bump actions + +commit d4b96e24ed969943b1b693678c00a22c80916e13 +Merge: 0065c179 31b773de +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-05-15 +Commit: GitHub +CommitDate: 2022-05-15 + + Merge pull request #1924 from aria2/fix-nproc + + Deal with missing nproc on macos + +commit 31b773de54be7f2c33b1c3f6cfcda2274980e504 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-05-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-05-15 + + Deal with missing nproc on macos + +commit 2c21331ab6c946564f70476ac3df2448311be750 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-05-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-05-15 + + Bump macos + +commit 9e412c9dc6543b52bf95a7f6a6109be1b1d8c662 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-05-15 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-05-15 + + Bump actions/checkout to v3 + +commit 0065c179ca9a17de05eb250a18496167e4996547 +Merge: 851a74f5 ba3396f7 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-04-09 +Commit: GitHub +CommitDate: 2022-04-09 + + Merge pull request #1907 from aria2/getentropy + + Better entropy for getRandomBytes + +commit ba3396f7bb210b53fb940f274a0622ad9799545c +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-04-09 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-04-09 + + Better entropy for getRandomBytes + +commit 851a74f53e6128019dbfff7d410e91c9d4d03799 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-04-09 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-04-09 + + Fix configure + +commit 893c096aa681e24e84b1ea848d112cbb7ab70d91 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-04-09 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-04-09 + + Update configure.ac + +commit 55f4bc139a08624b73e543cb9b4fc4d8ba311c11 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-04-09 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-04-09 + + nproc + +commit 998f203288e399d371a91c6ecfb22f9ce2b26105 +Merge: 37a7419f ba36a38a +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-04-08 +Commit: GitHub +CommitDate: 2022-04-08 + + Merge pull request #1905 from aria2/bt-bencode-allow-empty-dict-name + + Allow empty dist name in bencode which is needed for hybrid torrent + +commit ba36a38a6c4be38fe4e09cc95a40b58a48daed79 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-04-08 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-04-08 + + Allow empty dist name in bencode which is needed for hybrid torrent + +commit 37a7419fed8e6035a77c30bef456e36cbfd60245 +Merge: 85733e59 0dcd4e9f +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-04-07 +Commit: GitHub +CommitDate: 2022-04-07 + + Merge pull request #1902 from ITriskTI/patch-1 + + Update aria2c.rst + +commit 0dcd4e9f29c79c4b84f9ac1cb39ebb8ace0fb141 +Author: ITriskTI +AuthorDate: 2022-04-07 +Commit: ITriskTI +CommitDate: 2022-04-07 + + Update aria2c.rst + +commit 85733e59809a04218ebbfbf4ed9e99a8208e2597 +Merge: c651d563 839dd2ca +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-04-03 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-04-03 + + Merge branch 'Frefreak-master' + +commit 839dd2caf77863503d18252a1aff16cd1dde274c +Author: carsonzhu +AuthorDate: 2022-04-02 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-04-03 + + add no-want-digest-header option + +commit c651d563d079f54c47ab8dd87061f662881a2e19 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-04-03 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-04-03 + + Fix a failed test + +commit d8c5f74c1cae336601ece560e4476cc4f4680568 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2022-04-03 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2022-04-03 + + Run workflow on a pull request + +commit aaf090d1a6cd437d1c84f08974ca650540ae76d8 +Merge: fee8e41d de99fc17 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-04-03 +Commit: GitHub +CommitDate: 2022-04-03 + + Merge pull request #1877 from h3xx/fix-doc-typo + + Fix typo in documentation, --help text + +commit fee8e41d85ef66ff8c8a73735da9b71d53ec226d +Merge: c546fa49 6c965892 +Author: Tatsuhiro Tsujikawa <404610+tatsuhiro-t@users.noreply.github.com> +AuthorDate: 2022-04-03 +Commit: GitHub +CommitDate: 2022-04-03 + + Merge pull request #1824 from richardnias/fix-accept-encoding-docs + + Fix header in --http-accept-gzip documentation + +commit 56d1e1146b77e21423c1a3bb02e4080ed84d1fc0 +Author: Emmanuel Engelhart +AuthorDate: 2022-03-05 +Commit: Emmanuel Engelhart +CommitDate: 2022-03-05 + + Increase ByteArrayDiskWriter maximum size + +commit de99fc170e1a40bbf1158c931bb334e6620b994d +Author: Dan Church +AuthorDate: 2022-01-19 +Commit: Dan Church +CommitDate: 2022-01-19 + + Fix typo + +commit c546fa492c752d0594312ee1a2ac8bb4763c40f2 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2021-10-30 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2021-10-30 + + clang-format-12 + +commit 177939d6aca9b2c77d8ce526aa22f220de3fefcc +Author: Tatsuhiro Tsujikawa +AuthorDate: 2021-10-30 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2021-10-30 + + Cosmetic change + +commit c197373db788320c169ae2e83b2e767be84a369e +Author: Tatsuhiro Tsujikawa +AuthorDate: 2021-10-30 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2021-10-30 + + Simplify + +commit 869aae82648cfe9f4a7dac2bd912240a71dfdc70 +Author: Tatsuhiro Tsujikawa +AuthorDate: 2021-10-28 +Commit: Tatsuhiro Tsujikawa +CommitDate: 2021-10-29 + + Build with OpenSSL 3.0.0 + +commit 6c9658924421803c868da3faea47b1c1d9dc082c +Author: Richard Nias +AuthorDate: 2021-09-17 +Commit: Richard Nias +CommitDate: 2021-09-17 + + Fix header in --http-accept-gzip documentation + +commit 11fa3e9fe4234b4f753b53cff3420252748c9a7f +Author: FH0 <32861476+FH0@users.noreply.github.com> +AuthorDate: 2021-09-16 +Commit: GitHub +CommitDate: 2021-09-16 + + android(ndk r23) has timegm + +commit b850338c448fa59c761af1b443fe9611e1d117dc +Author: nkh0472 +AuthorDate: 2021-08-22 +Commit: GitHub +CommitDate: 2021-08-22 + + Minor grammar improvements + + Fix a typo 'Anroid' --> 'Android'; + Minor grammar improvements. diff --git a/aria2/LICENSE.OpenSSL b/aria2/LICENSE.OpenSSL new file mode 100644 index 00000000..bf6b4b94 --- /dev/null +++ b/aria2/LICENSE.OpenSSL @@ -0,0 +1,137 @@ +Certain source files in this program permit linking with the OpenSSL +library (http://www.openssl.org), which otherwise wouldn't be allowed +under the GPL. For purposes of identifying OpenSSL, most source files +giving this permission limit it to versions of OpenSSL having a license +identical to that listed in this file (LICENSE.OpenSSL). It is not +necessary for the copyright years to match between this file and the +OpenSSL version in question. However, note that because this file is +an extension of the license statements of these source files, this file +may not be changed except with permission from all copyright holders +of source files in this program which reference this file. + + + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a dual license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. Actually both licenses are BSD-style + Open Source licenses. In case of any license issues related to OpenSSL + please contact openssl-core@openssl.org. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ diff --git a/aria2/NEWS b/aria2/NEWS new file mode 100644 index 00000000..248747cb --- /dev/null +++ b/aria2/NEWS @@ -0,0 +1,7 @@ +aria2 1.37.0 +============ + +Release Note +------------ + +See https://github.com/aria2/aria2/releases/tag/release-1.37.0 diff --git a/aria2/README.html b/aria2/README.html new file mode 100644 index 00000000..d9ca8a0f --- /dev/null +++ b/aria2/README.html @@ -0,0 +1,904 @@ + + + + + + +aria2 - The ultra fast download utility + + + +
+

aria2 - The ultra fast download utility

+ +
+

Disclaimer

+

This program comes with no warranty. +You must use this program at your own risk.

+
+
+

Introduction

+

aria2 is a utility for downloading files. The supported protocols are +HTTP(S), FTP, SFTP, BitTorrent, and Metalink. aria2 can download a +file from multiple sources/protocols and tries to utilize your maximum +download bandwidth. It supports downloading a file from +HTTP(S)/FTP/SFTP and BitTorrent at the same time, while the data +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 https://aria2.github.io/.

+

See the aria2 Online Manual (Russian translation, Portuguese +translation) to learn +how to use aria2.

+
+
+

Features

+

Here is a list of features:

+
    +
  • Command-line interface
  • +
  • Download files through HTTP(S)/FTP/SFTP/BitTorrent
  • +
  • Segmented downloading
  • +
  • Metalink version 4 (RFC 5854) support(HTTP/FTP/SFTP/BitTorrent)
  • +
  • Metalink version 3.0 support(HTTP/FTP/SFTP/BitTorrent)
  • +
  • Metalink/HTTP (RFC 6249) support
  • +
  • HTTP/1.1 implementation
  • +
  • HTTP Proxy support
  • +
  • HTTP BASIC authentication support
  • +
  • HTTP Proxy authentication support
  • +
  • Well-known environment variables for proxy: http_proxy, +https_proxy, ftp_proxy, all_proxy and no_proxy
  • +
  • HTTP gzip, deflate content encoding support
  • +
  • Verify peer using given trusted CA certificate in HTTPS
  • +
  • Client certificate authentication in HTTPS
  • +
  • Chunked transfer encoding support
  • +
  • Load Cookies from the file using the Firefox3 format, Chromium/Google Chrome +and the Mozilla/Firefox +(1.x/2.x)/Netscape format.
  • +
  • Save Cookies in the Mozilla/Firefox (1.x/2.x)/Netscape format.
  • +
  • Custom HTTP Header support
  • +
  • Persistent Connections support
  • +
  • FTP/SFTP through HTTP Proxy
  • +
  • Download/Upload speed throttling
  • +
  • BitTorrent extensions: Fast extension, DHT, PEX, MSE/PSE, +Multi-Tracker, UDP tracker
  • +
  • BitTorrent WEB-Seeding. +aria2 requests chunk more than piece size to reduce the request +overhead. It also supports pipelined requests with piece size.
  • +
  • BitTorrent Local Peer Discovery
  • +
  • Rename/change the directory structure of BitTorrent downloads +completely
  • +
  • JSON-RPC (over HTTP and WebSocket)/XML-RPC interface
  • +
  • Run as a daemon process
  • +
  • Selective download in multi-file torrent/Metalink
  • +
  • Chunk checksum validation in Metalink
  • +
  • Can disable segmented downloading in Metalink
  • +
  • Netrc support
  • +
  • Configuration file support
  • +
  • Download URIs found in a text file or stdin and the destination +directory and output file name can be specified optionally
  • +
  • Parameterized URI support
  • +
  • IPv6 support with Happy Eyeballs
  • +
  • Disk cache to reduce disk activity
  • +
+
+
+

Versioning and release schedule

+

We use 3 numbers for the aria2 version: MAJOR.MINOR.PATCH. We will ship +MINOR updates on the 15th of every month. We may skip a release if we have +had no changes since the last release. The feature and documentation +freeze happens 10 days before the release day (the 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.

+

The MAJOR version will stay at 1 for the time being.

+
+
+

How to get source code

+

We maintain the source code at Github: +https://github.com/aria2/aria2

+

To get the latest source code, run the following command:

+
+$ git clone https://github.com/aria2/aria2.git
+
+

This will create an aria2 directory in your current directory and source +files are stored there.

+
+
+

Dependency

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
featuresdependency
HTTPSOSX or GnuTLS or OpenSSL or Windows
SFTPlibssh2
BitTorrentNone. Optional: libnettle+libgmp or libgcrypt +or OpenSSL (see note)
Metalinklibxml2 or Expat.
ChecksumNone. Optional: OSX or libnettle or libgcrypt +or OpenSSL or Windows (see note)
gzip, deflate in HTTPzlib
Async DNSC-Ares
Firefox3/Chromium cookielibsqlite3
XML-RPClibxml2 or Expat.
JSON-RPC over WebSocketlibnettle or libgcrypt or OpenSSL
+
+

Note

+

libxml2 has precedence over Expat if both libraries are installed. +If you prefer Expat, run configure with --without-libxml2.

+
+
+

Note

+

On Apple OSX, OS-level SSL/TLS support will be preferred. Hence +neither GnuTLS nor OpenSSL is required on that platform. If you'd +like to disable this behavior, run configure with +--without-appletls.

+

GnuTLS has precedence over OpenSSL if both libraries are installed. +If you prefer OpenSSL, run configure with --without-gnutls +--with-openssl.

+

On Windows, there is SSL implementation available that is based on +the native Windows SSL capabilities (Schannel) and it will be +preferred. Hence neither GnuTLS nor OpenSSL is required on that +platform. If you'd like to disable this behavior, run configure +with --without-wintls.

+
+
+

Note

+

On Apple OSX, the OS-level checksum support will be preferred, +unless aria2 is configured with --without-appletls.

+

libnettle has precedence over libgcrypt if both libraries are +installed. If you prefer libgcrypt, run configure with +--without-libnettle --with-libgcrypt. If OpenSSL is selected over +GnuTLS, neither libnettle nor libgcrypt will be used.

+

If none of the optional dependencies are installed, an internal +implementation that only supports md5 and sha1 will be used.

+

On Windows, there is SSL implementation available that is based on +the native Windows capabilities and it will be preferred, unless +aria2 is configured with --without-wintls.

+
+

A user can have one of the following configurations for SSL and crypto +libraries:

+
    +
  • OpenSSL
  • +
  • GnuTLS + libgcrypt
  • +
  • GnuTLS + libnettle
  • +
  • Apple TLS (OSX only)
  • +
  • Windows TLS (Windows only)
  • +
+

You can disable BitTorrent and Metalink support by providing +--disable-bittorrent and --disable-metalink to the configure +script respectively.

+

To enable async DNS support, you need c-ares.

+ +
+
+

How to build

+

aria2 is primarily written in C++. Initially, it was written based on +C++98/C++03 standard features. We are now migrating aria2 to the C++11 +standard. The current source code requires a C++11 aware compiler. For +well-known compilers, such as g++ and clang, the -std=c++11 or +-std=c++0x flag must be supported.

+

To build aria2 from the source package, you need the following +development packages (package name may vary depending on the +distribution you use):

+
    +
  • libgnutls-dev (Required for HTTPS, BitTorrent, Checksum support)
  • +
  • nettle-dev (Required for BitTorrent, Checksum support)
  • +
  • libgmp-dev (Required for BitTorrent)
  • +
  • libssh2-1-dev (Required for SFTP support)
  • +
  • libc-ares-dev (Required for async DNS support)
  • +
  • libxml2-dev (Required for Metalink support)
  • +
  • zlib1g-dev (Required for gzip, deflate decoding support in HTTP)
  • +
  • libsqlite3-dev (Required for Firefox3/Chromium cookie support)
  • +
  • pkg-config (Required to detect installed libraries)
  • +
+

You can use libgcrypt-dev instead of nettle-dev and libgmp-dev:

+
    +
  • libgpg-error-dev (Required for BitTorrent, Checksum support)
  • +
  • libgcrypt-dev (Required for BitTorrent, Checksum support)
  • +
+

You can use libssl-dev instead of +libgnutls-dev, nettle-dev, libgmp-dev, libgpg-error-dev and libgcrypt-dev:

+
    +
  • libssl-dev (Required for HTTPS, BitTorrent, Checksum support)
  • +
+

You can use libexpat1-dev instead of libxml2-dev:

+
    +
  • libexpat1-dev (Required for Metalink support)
  • +
+

On Fedora you need the following packages: gcc, gcc-c++, kernel-devel, +libgcrypt-devel, libxml2-devel, openssl-devel, gettext-devel, cppunit

+

If you downloaded source code from a git repository, you have to install +the following packages to get autoconf macros:

+
    +
  • libxml2-dev
  • +
  • libcppunit-dev
  • +
  • autoconf
  • +
  • automake
  • +
  • autotools-dev
  • +
  • autopoint
  • +
  • libtool
  • +
+

And run the following command to generate configure script and other files +necessary to build the program:

+
+$ autoreconf -i
+
+

Also, you need Sphinx to build the man page.

+

If you are building aria2 for Mac OS X, take a look at +the makerelease-osx.mk GNU Make makefile.

+

The quickest way to build aria2 is first to run configure script:

+
+$ ./configure
+
+

To build statically linked aria2, use ARIA2_STATIC=yes +command-line option:

+
+$ ./configure ARIA2_STATIC=yes
+
+

After configuration is done, run make to compile the program:

+
+$ make
+
+

See Cross-compiling Windows binary to create a Windows binary. +See Cross-compiling Android binary to create an Android binary.

+

The configure script checks available libraries and enables as many +features as possible except for experimental features not enabled by +default.

+

Since 1.1.0, aria2 checks the certificate of HTTPS servers by default. +If you build with OpenSSL or the recent version of GnuTLS which has +gnutls_certificate_set_x509_system_trust() function and the +library is properly configured to locate the system-wide CA +certificates store, aria2 will automatically load those certificates +at the startup. If it is not the case, I recommend supplying the path +to the CA bundle file. For example, in Debian the path to CA bundle +file is '/etc/ssl/certs/ca-certificates.crt' (in ca-certificates +package). This may vary depending on your distribution. You can give +it to configure script using --with-ca-bundle option:

+
+$ ./configure --with-ca-bundle='/etc/ssl/certs/ca-certificates.crt'
+$ make
+
+

Without --with-ca-bundle option, you will encounter the error when +accessing HTTPS servers because the certificate cannot be verified +without the CA bundle. In such a case, you can specify the CA bundle file +using aria2's --ca-certificate option. If you don't have the CA bundle +file installed, then the last resort is to disable the certificate +validation using --check-certificate=false.

+

Using the native OSX (AppleTLS) and/or Windows (WinTLS) implementation +will automatically use the system certificate store, so +--with-ca-bundle is not necessary and will be ignored when using +these implementations.

+

By default, the bash_completion file named aria2c is installed to +the directory $prefix/share/doc/aria2/bash_completion. To change +the install directory of the file, use --with-bashcompletiondir +option.

+

After a make, the executable is located at src/aria2c.

+

aria2 uses CppUnit for automated unit testing. To run the unit test:

+
+$ make check
+
+
+
+

Cross-compiling Windows binary

+

In this section, we describe how to build a Windows binary using a +mingw-w64 (http://mingw-w64.org/doku.php) cross-compiler on Debian +Linux. The MinGW (http://www.mingw.org/) may not be able to build +aria2.

+

The easiest way to build Windows binary is using Dockerfile.mingw. See +Dockerfile.mingw how to build a binary. If you cannot use Dockerfile, +then continue to read the following paragraphs.

+

Basically, after compiling and installing depended libraries, you can +do cross-compile just passing appropriate --host option and +specifying CPPFLAGS, LDFLAGS, and PKG_CONFIG_LIBDIR +variables to configure. For convenience and to lower our own +development cost, we provide an easier way to configure the build +settings.

+

mingw-config script is a configure script wrapper for mingw-w64. +We use it to create official Windows build. This script assumes +the following libraries have been built for cross-compile:

+
    +
  • c-ares
  • +
  • expat
  • +
  • sqlite3
  • +
  • zlib
  • +
  • libssh2
  • +
  • cppunit
  • +
+

Some environment variables can be adjusted to change build settings:

+
+
HOST
+
cross-compile to build programs to run on HOST. It defaults to +i686-w64-mingw32. To build a 64bit binary, specify +x86_64-w64-mingw32.
+
PREFIX
+
Prefix to the directory where dependent libraries are installed. It +defaults to /usr/local/$HOST. -I$PREFIX/include will be +added to CPPFLAGS. -L$PREFIX/lib will be added to +LDFLAGS. $PREFIX/lib/pkgconfig will be set to +PKG_CONFIG_LIBDIR.
+
+

For example, to build a 64bit binary do this:

+
+$ HOST=x86_64-w64-mingw32 ./mingw-config
+
+

If you want libaria2 dll with --enable-libaria2, then don't use +ARIA2_STATIC=yes and prepare the DLL version of external +libraries.

+
+
+

Cross-compiling Android binary

+

In this section, we describe how to build Android binary using Android +NDK cross-compiler on Debian Linux.

+

At the time of this writing, Android NDK r21e should compile aria2 +without errors.

+

android-config script is a configure script wrapper for Android +build. We use it to create an official Android build. This script +assumes the following libraries have been built for cross-compile:

+
    +
  • c-ares
  • +
  • openssl
  • +
  • expat
  • +
  • zlib
  • +
  • libssh2
  • +
+

When building the above libraries, make sure that disable shared +library and enable only static library. We are going to link those +libraries statically.

+

android-config assumes that $ANDROID_HOME and $NDK +environment variables are defined.

+

We currently use Android NDK r21e. $NDK should point to the +directory to Android NDK. The build tools will be found under +$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/.

+

All the dependent libraries must be installed under +$ANDROID_HOME/usr/local.

+

After android-config, run make to compile sources.

+
+
+

Building documentation

+

Sphinx is used to building the +documentation. aria2 man pages will be build when you run make if +they are not up-to-date. You can also build an HTML version of the aria2 +man page by make html. The HTML version manual is also available +online (Russian +translation, Portuguese +translation).

+
+
+

BitTorrent

+
+

About file names

+

The file name of the downloaded file is determined as follows:

+
+
single-file mode
+
If "name" key is present in .torrent file, the file name is the value +of "name" key. Otherwise, the file name is the base name of .torrent +file appended by ".file". For example, .torrent file is +"test.torrent", then file name is "test.torrent.file". The +directory to store the downloaded file can be specified by -d +option.
+
multi-file mode
+
The complete directory/file structure mentioned in .torrent file +is created. The directory to store the top directory of +downloaded files can be specified by -d option.
+
+

Before download starts, a complete directory structure is created if +needed. By default, aria2 opens at most 100 files mentioned in +.torrent file, and directly writes to and reads from these files. +The number of files to open simultaneously can be controlled by +--bt-max-open-files option.

+
+
+

DHT

+

aria2 supports mainline compatible DHT. By default, the routing table +for IPv4 DHT is saved to $XDG_CACHE_HOME/aria2/dht.dat and the +routing table for IPv6 DHT is saved to +$XDG_CACHE_HOME/aria2/dht6.dat unless files exist at +$HOME/.aria2/dht.dat or $HOME/.aria2/dht6.dat. aria2 uses the +same port number to listen on for both IPv4 and IPv6 DHT.

+
+
+

UDP tracker

+

UDP tracker support is enabled when IPv4 DHT is enabled. The port +number of the UDP tracker is shared with DHT. Use --dht-listen-port +option to change the port number.

+
+
+

Other things should be noted

+
    +
  • -o option is used to change the file name of .torrent file itself, +not a file name of a file in .torrent file. For this purpose, use +--index-out option instead.
  • +
  • The port numbers that aria2 uses by default are 6881-6999 for TCP +and UDP.
  • +
  • aria2 doesn't configure port-forwarding automatically. Please +configure your router or firewall manually.
  • +
  • The maximum number of peers is 55. This limit may be exceeded when +the download rate is low. This download rate can be adjusted using +--bt-request-peer-speed-limit option.
  • +
  • As of release 0.10.0, aria2 stops sending request messages after +selective download completes.
  • +
+
+
+ + +
+

netrc

+

netrc support is enabled by default for HTTP(S)/FTP/SFTP. To disable +netrc support, specify -n command-line option. Your .netrc file +should have correct permissions(600).

+
+
+

WebSocket

+

The WebSocket server embedded in aria2 implements the specification +defined in RFC 6455. The supported protocol version is 13.

+
+
+

libaria2

+

The libaria2 is a C++ library that offers aria2 functionality to the +client code. Currently, libaria2 is not built by default. To enable +libaria2, use --enable-libaria2 configure option. By default, +only the shared library is built. To build a static library, use +--enable-static configure option as well. See libaria2 +documentation to know how to use API.

+
+ +
+ + diff --git a/aria2/README.mingw b/aria2/README.mingw new file mode 100644 index 00000000..df2fba2e --- /dev/null +++ b/aria2/README.mingw @@ -0,0 +1,52 @@ +aria2 Windows build +=================== + +aria2 Windows build is provided in 2 flavors: 32bit version and 64bit +version. The executable was compiled using mingw-w64 cross compiler on +Ubuntu Linux. + +The executable is statically linked, so no extra DLLs are +necessary. The linked libraries are: + +* gmp 6.3.0 +* expat 2.5.0 +* sqlite 3.43.1 +* zlib 1.3 +* c-ares 1.19.1 +* libssh2 1.11.0 + +This build has the following difference from the original release: + +* 32bit version only: ``--disable-ipv6`` is enabled by default. (In + other words, IPv6 support is disabled by default). + +Known Issues +------------ + +* TLSv1.3 does not work. + +* --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 + Ctrl-C just kills aria2 instantly without proper shutdown sequence + and you may lose data. So don't press Ctrl-C twice. + +* --daemon option doesn't work. + +* 32bit version only: When ``--disable-ipv6=false`` is given, + BitTorrent DHT may not work properly. + +* 32bit version only: Most of the IPv6 functionality does not work +even if ``--disable-ipv6=false`` is given. + +References +---------- + +* http://smithii.com/aria2 +* http://kemovitra.blogspot.com/2009/12/download-aria2-163.html diff --git a/aria2/aria2c.exe b/aria2/aria2c.exe new file mode 100644 index 00000000..5004e103 Binary files /dev/null and b/aria2/aria2c.exe differ diff --git a/electron-builder.yml b/electron-builder.yml index fec128a6..c6f97df9 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -3,6 +3,7 @@ productName: Hydra directories: buildResources: build extraResources: + - aria2 - hydra-download-manager - seeds - from: node_modules/ps-list/vendor/fastlist-0.3.0-x64.exe diff --git a/electron.vite.config.1719928703430.mjs b/electron.vite.config.1719928703430.mjs new file mode 100644 index 00000000..aa9802ff --- /dev/null +++ b/electron.vite.config.1719928703430.mjs @@ -0,0 +1,58 @@ +// electron.vite.config.ts +import { resolve } from "path"; +import { + defineConfig, + loadEnv, + swcPlugin, + externalizeDepsPlugin +} from "electron-vite"; +import react from "@vitejs/plugin-react"; +import { sentryVitePlugin } from "@sentry/vite-plugin"; +import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin"; +import svgr from "vite-plugin-svgr"; +var sentryPlugin = sentryVitePlugin({ + authToken: process.env.SENTRY_AUTH_TOKEN, + org: "hydra-launcher", + project: "hydra-launcher" +}); +var electron_vite_config_default = defineConfig(({ mode }) => { + loadEnv(mode); + return { + main: { + build: { + sourcemap: true, + rollupOptions: { + external: ["better-sqlite3"] + } + }, + resolve: { + alias: { + "@main": resolve("src/main"), + "@locales": resolve("src/locales"), + "@resources": resolve("resources"), + "@shared": resolve("src/shared") + } + }, + plugins: [externalizeDepsPlugin(), swcPlugin(), sentryPlugin] + }, + preload: { + plugins: [externalizeDepsPlugin()] + }, + renderer: { + build: { + sourcemap: true + }, + resolve: { + alias: { + "@renderer": resolve("src/renderer/src"), + "@locales": resolve("src/locales"), + "@shared": resolve("src/shared") + } + }, + plugins: [svgr(), react(), vanillaExtractPlugin(), sentryPlugin] + } + }; +}); +export { + electron_vite_config_default as default +}; diff --git a/package.json b/package.json index c029e4db..cde6b26a 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "start": "electron-vite preview", "dev": "electron-vite dev", "build": "npm run typecheck && electron-vite build", - "postinstall": "electron-builder install-app-deps", + "postinstall": "electron-builder install-app-deps && node ./postinstall.cjs", "build:unpack": "npm run build && electron-builder --dir", "build:win": "electron-vite build && electron-builder --win", "build:mac": "electron-vite build && electron-builder --mac", @@ -41,6 +41,7 @@ "@sentry/electron": "^5.1.0", "@vanilla-extract/css": "^1.14.2", "@vanilla-extract/recipes": "^0.5.2", + "aria2": "^4.1.2", "auto-launch": "^5.0.6", "axios": "^1.6.8", "better-sqlite3": "^9.5.0", diff --git a/postinstall.cjs b/postinstall.cjs new file mode 100644 index 00000000..547af988 --- /dev/null +++ b/postinstall.cjs @@ -0,0 +1,50 @@ +const { default: axios } = require("axios"); +const util = require("node:util"); +const fs = require("node:fs"); + +const exec = util.promisify(require("node:child_process").exec); + +const downloadAria2 = async () => { + if (fs.existsSync("aria2")) { + console.log("Aria2 already exists, skipping download..."); + return; + } + + const file = + process.platform === "win32" + ? "aria2-1.37.0-win-64bit-build1.zip" + : "aria2-1.37.0-1-x86_64.pkg.tar.zst"; + + const downloadUrl = + process.platform === "win32" + ? `https://github.com/aria2/aria2/releases/download/release-1.37.0/${file}` + : "https://archlinux.org/packages/extra/x86_64/aria2/download/"; + + console.log(`Downloading ${file}...`); + + const response = await axios.get(downloadUrl, { responseType: "stream" }); + + const stream = response.data.pipe(fs.createWriteStream(file)); + + stream.on("finish", async () => { + console.log(`Downloaded ${file}, extracting...`); + + if (process.platform === "win32") { + await exec(`npx extract-zip ${file}`); + console.log("Extracted. Renaming folder..."); + + fs.renameSync(file.replace(".zip", ""), "aria2"); + } else { + await exec(`tar --zstd -xvf ${file} usr/bin/aria2c`); + console.log("Extracted. Copying binary file..."); + fs.mkdirSync("aria2"); + fs.copyFileSync("usr/bin/aria2c", "aria2/aria2c"); + fs.rmSync("usr", { recursive: true }); + } + + console.log(`Extracted ${file}, removing compressed downloaded file...`); + fs.rmSync(file); + }); +}; + +downloadAria2(); diff --git a/src/main/declaration.d.ts b/src/main/declaration.d.ts new file mode 100644 index 00000000..ac2675a3 --- /dev/null +++ b/src/main/declaration.d.ts @@ -0,0 +1,80 @@ +declare module "aria2" { + export type Aria2Status = + | "active" + | "waiting" + | "paused" + | "error" + | "complete" + | "removed"; + + export interface StatusResponse { + gid: string; + status: Aria2Status; + totalLength: string; + completedLength: string; + uploadLength: string; + bitfield: string; + downloadSpeed: string; + uploadSpeed: string; + infoHash?: string; + numSeeders?: string; + seeder?: boolean; + pieceLength: string; + numPieces: string; + connections: string; + errorCode?: string; + errorMessage?: string; + followedBy?: string[]; + following: string; + belongsTo: string; + dir: string; + files: { + path: string; + length: string; + completedLength: string; + selected: string; + }[]; + bittorrent?: { + announceList: string[][]; + comment: string; + creationDate: string; + mode: "single" | "multi"; + info: { + name: string; + verifiedLength: string; + verifyIntegrityPending: string; + }; + }; + } + + export default class Aria2 { + constructor(options: any); + open: () => Promise; + call( + method: "addUri", + uris: string[], + options: { dir: string } + ): Promise; + call( + method: "tellStatus", + gid: string, + keys?: string[] + ): Promise; + call(method: "pause", gid: string): Promise; + call(method: "forcePause", gid: string): Promise; + call(method: "unpause", gid: string): Promise; + call(method: "remove", gid: string): Promise; + call(method: "forceRemove", gid: string): Promise; + call(method: "pauseAll"): Promise; + call(method: "forcePauseAll"): Promise; + listNotifications: () => [ + "onDownloadStart", + "onDownloadPause", + "onDownloadStop", + "onDownloadComplete", + "onDownloadError", + "onBtDownloadComplete", + ]; + on: (event: string, callback: (params: any) => void) => void; + } +} diff --git a/src/main/services/aria2c.ts b/src/main/services/aria2c.ts new file mode 100644 index 00000000..b8d96735 --- /dev/null +++ b/src/main/services/aria2c.ts @@ -0,0 +1,23 @@ +import path from "node:path"; +import { spawn } from "node:child_process"; +import { app } from "electron"; + +export const startAria2 = () => { + const binaryPath = app.isPackaged + ? path.join(process.resourcesPath, "aria2", "aria2c") + : path.join(__dirname, "..", "..", "aria2", "aria2c"); + + return spawn( + binaryPath, + [ + "--enable-rpc", + "--rpc-listen-all", + "--file-allocation=none", + "--allow-overwrite=true", + "--enable-peer-exchange=false", + "--enable-dht=false", + "--bt-enable-lpd=false", + ], + { stdio: "inherit", windowsHide: true } + ); +}; diff --git a/src/main/services/download/download-manager.ts b/src/main/services/download/download-manager.ts index f7553c9c..6d28eee0 100644 --- a/src/main/services/download/download-manager.ts +++ b/src/main/services/download/download-manager.ts @@ -84,7 +84,7 @@ export class DownloadManager { static async cancelDownload(gameId: number) { if (this.currentDownloader === Downloader.RealDebrid) { - RealDebridDownloader.cancelDownload(); + RealDebridDownloader.cancelDownload(gameId); } else { TorrentDownloader.cancelDownload(gameId); } diff --git a/src/main/services/download/http-download.ts b/src/main/services/download/http-download.ts index 1ce99825..10cf52ae 100644 --- a/src/main/services/download/http-download.ts +++ b/src/main/services/download/http-download.ts @@ -1,123 +1,77 @@ -import path from "node:path"; -import fs from "node:fs"; -import crypto from "node:crypto"; - -import axios, { type AxiosProgressEvent } from "axios"; -import { app } from "electron"; +import type { ChildProcess } from "node:child_process"; import { logger } from "../logger"; +import { sleep } from "@main/helpers"; +import { startAria2 } from "../aria2c"; +import Aria2 from "aria2"; export class HttpDownload { - private abortController: AbortController; - public lastProgressEvent: AxiosProgressEvent; - private trackerFilePath: string; + private static gid: string | null = null; + private static connected = false; + private static aria2c: ChildProcess | null = null; - private trackerProgressEvent: AxiosProgressEvent | null = null; - private downloadPath: string; + private static aria2 = new Aria2({}); - private downloadTrackersPath = path.join( - app.getPath("documents"), - "Hydra", - "Downloads" - ); + private static async connect() { + this.aria2c = startAria2(); - constructor( - private url: string, - private savePath: string - ) { - this.abortController = new AbortController(); + let retries = 0; - const sha256Hasher = crypto.createHash("sha256"); - const hash = sha256Hasher.update(url).digest("hex"); + while (retries < 4 && !this.connected) { + try { + await this.aria2.open(); + logger.log("Connected to aria2"); - this.trackerFilePath = path.join( - this.downloadTrackersPath, - `${hash}.hydradownload` - ); - - const filename = path.win32.basename(this.url); - this.downloadPath = path.join(this.savePath, filename); - } - - private updateTrackerFile() { - if (!fs.existsSync(this.downloadTrackersPath)) { - fs.mkdirSync(this.downloadTrackersPath, { - recursive: true, - }); - } - - fs.writeFileSync( - this.trackerFilePath, - JSON.stringify(this.lastProgressEvent), - { encoding: "utf-8" } - ); - } - - private removeTrackerFile() { - if (fs.existsSync(this.trackerFilePath)) { - fs.rm(this.trackerFilePath, (err) => { - logger.error(err); - }); + this.connected = true; + } catch (err) { + await sleep(100); + logger.log("Failed to connect to aria2, retrying..."); + retries++; + } } } - public async startDownload() { - // Check if there's already a tracker file and download file - if ( - fs.existsSync(this.trackerFilePath) && - fs.existsSync(this.downloadPath) - ) { - this.trackerProgressEvent = JSON.parse( - fs.readFileSync(this.trackerFilePath, { encoding: "utf-8" }) - ); + public static getStatus() { + if (this.connected && this.gid) { + return this.aria2.call("tellStatus", this.gid); } - const response = await axios.get(this.url, { - responseType: "stream", - signal: this.abortController.signal, - headers: { - Range: `bytes=${this.trackerProgressEvent?.loaded ?? 0}-`, - }, - onDownloadProgress: (progressEvent) => { - const total = - this.trackerProgressEvent?.total ?? progressEvent.total ?? 0; - const loaded = - (this.trackerProgressEvent?.loaded ?? 0) + progressEvent.loaded; - - const progress = loaded / total; - - this.lastProgressEvent = { - ...progressEvent, - total, - progress, - loaded, - }; - this.updateTrackerFile(); - - if (progressEvent.progress === 1) { - this.removeTrackerFile(); - } - }, - }); - - response.data.pipe( - fs.createWriteStream(this.downloadPath, { - flags: "a", - }) - ); + return null; } - public async pauseDownload() { - this.abortController.abort(); + public static disconnect() { + if (this.aria2c) { + this.aria2c.kill(); + this.connected = false; + } } - public cancelDownload() { - this.pauseDownload(); + static async cancelDownload(gid: string) { + await this.aria2.call("forceRemove", gid); + if (this.gid === gid) { + this.gid = null; + } + } - fs.rm(this.downloadPath, (err) => { - if (err) logger.error(err); - }); - fs.rm(this.trackerFilePath, (err) => { - if (err) logger.error(err); - }); + static async pauseDownload() { + if (this.gid) { + await this.aria2.call("forcePause", this.gid); + this.gid = null; + } + } + + static async resumeDownload(gid: string) { + await this.aria2.call("unpause", gid); + this.gid = gid; + } + + static async startDownload(downloadPath: string, downloadUrl: string) { + if (!this.connected) await this.connect(); + + const options = { + dir: downloadPath, + }; + + this.gid = await this.aria2.call("addUri", [downloadUrl], options); + return this.gid; } } diff --git a/src/main/services/download/real-debrid-downloader.ts b/src/main/services/download/real-debrid-downloader.ts index 476d8f3e..1886f36e 100644 --- a/src/main/services/download/real-debrid-downloader.ts +++ b/src/main/services/download/real-debrid-downloader.ts @@ -6,10 +6,10 @@ import { DownloadProgress } from "@types"; import { HttpDownload } from "./http-download"; export class RealDebridDownloader { + private static downloads = new Map(); private static downloadingGame: Game | null = null; private static realDebridTorrentId: string | null = null; - private static httpDownload: HttpDownload | null = null; private static async getRealDebridDownloadUrl() { if (this.realDebridTorrentId) { @@ -35,73 +35,43 @@ export class RealDebridDownloader { } public static async getStatus() { - const lastProgressEvent = this.httpDownload?.lastProgressEvent; + const status = await HttpDownload.getStatus(); + + if (status) { + const progress = + Number(status.completedLength) / Number(status.totalLength); - if (lastProgressEvent) { await gameRepository.update( { id: this.downloadingGame!.id }, { - bytesDownloaded: lastProgressEvent.loaded, - fileSize: lastProgressEvent.total, - progress: lastProgressEvent.progress, + bytesDownloaded: Number(status.completedLength), + fileSize: Number(status.totalLength), + progress, status: "active", } ); - const progress = { + return { numPeers: 0, numSeeds: 0, - downloadSpeed: lastProgressEvent.rate, + downloadSpeed: Number(status.downloadSpeed), timeRemaining: calculateETA( - lastProgressEvent.total ?? 0, - lastProgressEvent.loaded, - lastProgressEvent.rate ?? 0 + Number(status.totalLength), + Number(status.completedLength), + Number(status.downloadSpeed) ), isDownloadingMetadata: false, isCheckingFiles: false, - progress: lastProgressEvent.progress, + progress, gameId: this.downloadingGame!.id, } as DownloadProgress; - - if (lastProgressEvent.progress === 1) { - this.pauseDownload(); - } - - return progress; - } - - if (this.realDebridTorrentId && this.downloadingGame) { - const torrentInfo = await RealDebridClient.getTorrentInfo( - this.realDebridTorrentId - ); - - const { status } = torrentInfo; - - if (status === "downloaded") { - this.startDownload(this.downloadingGame); - } - - const progress = torrentInfo.progress / 100; - const totalDownloaded = progress * torrentInfo.bytes; - - return { - numPeers: 0, - numSeeds: torrentInfo.seeders, - downloadSpeed: torrentInfo.speed, - timeRemaining: calculateETA( - torrentInfo.bytes, - totalDownloaded, - torrentInfo.speed - ), - isDownloadingMetadata: status === "magnet_conversion", - } as DownloadProgress; } return null; } static async pauseDownload() { - this.httpDownload?.pauseDownload(); + HttpDownload.pauseDownload(); this.realDebridTorrentId = null; this.downloadingGame = null; } @@ -114,12 +84,20 @@ export class RealDebridDownloader { if (downloadUrl) { this.realDebridTorrentId = null; - this.httpDownload = new HttpDownload(downloadUrl, game!.downloadPath!); - this.httpDownload.startDownload(); + const gid = await HttpDownload.startDownload( + game.downloadPath!, + downloadUrl + ); + + this.downloads.set(game.id!, gid); } } - static cancelDownload() { - return this.httpDownload?.cancelDownload(); + static async cancelDownload(gameId: number) { + const gid = this.downloads.get(gameId); + if (gid) { + await HttpDownload.cancelDownload(gid); + this.downloads.delete(gameId); + } } } diff --git a/yarn.lock b/yarn.lock index 9fce82e7..9fabcf93 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2665,6 +2665,14 @@ aria-query@^5.3.0: dependencies: dequal "^2.0.3" +aria2@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/aria2/-/aria2-4.1.2.tgz#0ecbc50beea82856c88b4de71dac336154f67362" + integrity sha512-qTBr2RY8RZQmiUmbj2KXFvkErNxU4aTHZszszzwhE8svy2PEVX+IYR/c4Rp9Tuw4QkeU8cylGy6McV6Yl8i7Qw== + dependencies: + node-fetch "^2.6.1" + ws "^7.4.0" + array-buffer-byte-length@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz" @@ -5813,7 +5821,7 @@ node-domexception@^1.0.0: resolved "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@^2.6.7: +node-fetch@^2.6.1, node-fetch@^2.6.7: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -7609,6 +7617,11 @@ wrappy@1: resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +ws@^7.4.0: + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== + ws@^8.16.0: version "8.17.0" resolved "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz"