Merge branch 'pr1802'

This resolves conflicts on https://github.com/aria2/aria2/pull/1802
and does fixups.
This commit is contained in:
Tatsuhiro Tsujikawa 2023-11-05 10:58:40 +09:00
commit 08b48dccb6
18 changed files with 52 additions and 53 deletions

41
COPYING
View file

@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc. Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
Preamble Preamble
The licenses for most software are designed to take away your The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public freedom to share and change it. By contrast, the GNU General Public
@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to the GNU Lesser General Public License instead.) You can apply it to
your programs, too. your programs, too.
When we speak of free software, we are referring to freedom, not When we speak of free software, we are referring to freedom, not
@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and The precise terms and conditions for copying, distribution and
modification follow. modification follow.
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains 0. This License applies to any program or other work which contains
@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on does not normally print such an announcement, your work based on
the Program is not required to print an announcement.) the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program, identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in and can be reasonably considered independent and separate works in
@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not distribution of the source code, even though third parties are not
compelled to copy the source along with the object code. compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program 4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is otherwise to copy, modify, sublicense or distribute the Program is
@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License. be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in 8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License original copyright holder who places the Program under this License
@ -255,7 +255,7 @@ 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 preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally. of promoting the sharing and reuse of software generally.
NO WARRANTY NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS 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 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@ -277,9 +277,9 @@ 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 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES. POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest 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 possible use to the public, the best way to achieve this is to make it
@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License along
along with this program; if not, write to the Free Software with this program; if not, write to the Free Software Foundation, Inc.,
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail. 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 If the program is interactive, make it output a short notice like this
when it starts in an interactive mode: when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details. under certain conditions; type `show c' for details.
@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. Public License instead of this License.

View file

@ -32,7 +32,7 @@
# files in the program, then also delete it here. # files in the program, then also delete it here.
# cd to the directory where this script exists. # cd to the directory where this script exists.
cd $(dirname $0) cd "$(dirname $0)"
. ./script-helper . ./script-helper
get_version get_version
@ -43,8 +43,8 @@ if [ -z "$VERSION" ]; then
fi fi
DIST_DIR=aria2-$VERSION-aarch64-linux-android-build1 DIST_DIR=aria2-$VERSION-aarch64-linux-android-build1
mkdir $DIST_DIR mkdir "$DIST_DIR"
cp AUTHORS COPYING ChangeLog LICENSE.OpenSSL NEWS README.html README.android \ cp AUTHORS COPYING ChangeLog LICENSE.OpenSSL NEWS README.html README.android \
android-out/aria2c $DIST_DIR android-out/aria2c "$DIST_DIR"
zip -9 -r $DIST_DIR.zip $DIST_DIR zip -9 -r "$DIST_DIR.zip" "$DIST_DIR"
rm -rf $DIST_DIR rm -rf "$DIST_DIR"

View file

@ -6,27 +6,27 @@ BUILDDIR=/tmp/aria2buildtest
if [ ! -d "$BUILDDIR" ]; then if [ ! -d "$BUILDDIR" ]; then
mkdir "$BUILDDIR" \ mkdir "$BUILDDIR" \
|| { echo "Failed to create directory $BUILDDIR" && exit -1; } || { echo "Failed to create directory $BUILDDIR" && exit 1; }
fi fi
echo -n "Starting build test " echo -n "Starting build test "
echo `date` echo "$(date)"
# build CONFIGURE_OPTS BIN_SUFFIX DESC # build CONFIGURE_OPTS BIN_SUFFIX DESC
build() build()
{ {
echo -n "new build() started at " echo -n "new build() started at "
echo `date` echo "$(date)"
echo "*** configure opts=$1" echo "*** configure opts=$1"
BIN_NAME="aria2c_$2" BIN_NAME="aria2c_$2"
if [ -f "$BUILDDIR/$BIN_NAME" ]; then if [ -f "$BUILDDIR/$BIN_NAME" ]; then
echo "$BIN_NAME exists, skipping" echo "$BIN_NAME exists, skipping"
return return
fi fi
./configure $1 2>&1 | tee "$BUILDDIR/configure_$2.log"\ ./configure $1 2>&1 | tee "$BUILDDIR/configure_$2.log" \
&& cp config.log "$BUILDDIR/config.log_$2" \ && cp config.log "$BUILDDIR/config.log_$2" \
&& LANG=C make clean \ && LANG=C make clean \
&& LANG=C make -j2 check 2>&1 |tee "$BUILDDIR/aria2c_$2.log" \ && LANG=C make -j2 check 2>&1 | tee "$BUILDDIR/aria2c_$2.log" \
&& cp src/aria2c "$BUILDDIR/aria2c_$2" && cp src/aria2c "$BUILDDIR/aria2c_$2"
if [ -f "test/aria2c.log" ]; then if [ -f "test/aria2c.log" ]; then
@ -36,8 +36,8 @@ build()
clear() clear()
{ {
for file in `ls $BUILDDIR`; do for file in $(ls "$BUILDDIR"); do
rm -f "$BUILDDIR/$file"; rm -f "$BUILDDIR/$file"
done done
} }

View file

@ -33,7 +33,7 @@ echo -n "en@quot en@boldquot" > "$PO_DIR"/LINGUAS
for file in "$WORK_DIR"/*.po; do for file in "$WORK_DIR"/*.po; do
# First remove useless '\r' in messages # First remove useless '\r' in messages
sed -i -e 's/\\r//' "$file" sed -i -e 's/\\r//' "$file"
bn=`basename "$file"` bn=$(basename "$file")
bn=${bn#aria2-} bn=${bn#aria2-}
dst="$PO_DIR"/"$bn" dst="$PO_DIR"/"$bn"
# copy file to po directory # copy file to po directory

View file

@ -238,7 +238,7 @@ endef
export ARIA2_DISTXML export ARIA2_DISTXML
# Detect numer of CPUs to be used with make -j # Detect number of CPUs to be used with make -j
CPUS = $(shell sysctl hw.ncpu | cut -d" " -f2) CPUS = $(shell sysctl hw.ncpu | cut -d" " -f2)

View file

@ -36,7 +36,7 @@ test -z "$BUILD_VER" && BUILD_VER=1
test -z "$LABEL" && LABEL=$HOST test -z "$LABEL" && LABEL=$HOST
# cd to the directory where this script exists. # cd to the directory where this script exists.
cd $(dirname $0) cd "$(dirname "$0")"
. ./script-helper . ./script-helper
get_version get_version
@ -48,8 +48,8 @@ fi
DIST_DIR=aria2-${VERSION}-${LABEL}-build${BUILD_VER} DIST_DIR=aria2-${VERSION}-${LABEL}-build${BUILD_VER}
mkdir $DIST_DIR mkdir "$DIST_DIR"
cp AUTHORS COPYING ChangeLog LICENSE.OpenSSL NEWS README.html README.mingw \ cp AUTHORS COPYING ChangeLog LICENSE.OpenSSL NEWS README.html README.mingw \
mingw-out/aria2c.exe $DIST_DIR mingw-out/aria2c.exe "$DIST_DIR"
zip -9 -r $DIST_DIR.zip $DIST_DIR zip -9 -r "$DIST_DIR.zip" "$DIST_DIR"
rm -rf $DIST_DIR rm -rf "$DIST_DIR"

View file

@ -29,7 +29,7 @@
# version. If you delete this exception statement from all source # version. If you delete this exception statement from all source
# files in the program, then also delete it here. # files in the program, then also delete it here.
get_version () { get_version() {
VERSION=`grep AC_INIT configure.ac | sed '/AC_INIT/ s/AC_INIT(\[aria2\],\[\([^]]\+\)\],.*/\1/'` VERSION=$(grep AC_INIT configure.ac | sed '/AC_INIT/ s/AC_INIT(\[aria2\],\[\([^]]\+\)\],.*/\1/')
echo "Version: $VERSION" echo "Version: $VERSION"
} }

View file

@ -131,7 +131,7 @@ struct hash_finder {
std::string errToString(OSStatus err) std::string errToString(OSStatus err)
{ {
std::string rv = "Unkown error"; std::string rv = "Unknown error";
CFRef<CFStringRef> cerr(SecCopyErrorMessageString(err, nullptr)); CFRef<CFStringRef> cerr(SecCopyErrorMessageString(err, nullptr));
if (!cerr) { if (!cerr) {
return rv; return rv;

View file

@ -52,7 +52,7 @@ public:
~DHTSetup(); ~DHTSetup();
// Returns two vector of Commands. First one contains regular // Returns two vector of Commands. First one contains regular
// commands. Secod one contains so called routine commands, which // commands. Second one contains so called routine commands, which
// executed once per event poll returns. // executed once per event poll returns.
std::pair<std::vector<std::unique_ptr<Command>>, std::pair<std::vector<std::unique_ptr<Command>>,
std::vector<std::unique_ptr<Command>>> std::vector<std::unique_ptr<Command>>>

View file

@ -62,7 +62,7 @@ public:
virtual void closeFile() = 0; virtual void closeFile() = 0;
/** /**
* Opens a file. If the file doesnot exists, an exception may be * Opens a file. If the file does not exist, an exception may be
* thrown. * thrown.
*/ */
virtual void openExistingFile(int64_t totalLength = 0) = 0; virtual void openExistingFile(int64_t totalLength = 0) = 0;

View file

@ -61,7 +61,7 @@ public:
bool parse(const std::string& data); bool parse(const std::string& data);
/** /**
* Retruns the number of bytes processed in the last invocation of * Returns the number of bytes processed in the last invocation of
* parse(). * parse().
*/ */
size_t getLastBytesProcessed() const; size_t getLastBytesProcessed() const;

View file

@ -179,7 +179,7 @@ void Netrc::parse(const std::string& path)
else { else {
if (!authenticator) { if (!authenticator) {
throw DL_ABORT_EX( throw DL_ABORT_EX(
fmt("Netrc:parse error. %s encounterd where 'machine'" fmt("Netrc:parse error. %s encountered where 'machine'"
" or 'default' expected.", " or 'default' expected.",
std::string((*iter).first, (*iter).second).c_str())); std::string((*iter).first, (*iter).second).c_str()));
} }

View file

@ -60,7 +60,7 @@ public:
virtual bool execute() CXX11_OVERRIDE; virtual bool execute() CXX11_OVERRIDE;
/** /**
* Binds port. If successful, the bound port number is assinged to port and * Binds port. If successful, the bound port number is assigned to port and
* returns true, otherwise port is undefined and returns false. * returns true, otherwise port is undefined and returns false.
*/ */
bool bindPort(uint16_t& port, SegList<int>& seq); bool bindPort(uint16_t& port, SegList<int>& seq);

View file

@ -49,7 +49,7 @@ public:
virtual bool evaluate() = 0; virtual bool evaluate() = 0;
/** /**
* Used for reseting status. * Used for resetting status.
*/ */
virtual void reset() = 0; virtual void reset() = 0;
}; };

View file

@ -52,7 +52,7 @@ public:
// Adds the cache entry |ent| to the storage. The size of cached // Adds the cache entry |ent| to the storage. The size of cached
// data of ent is added to total_. // data of ent is added to total_.
bool add(WrDiskCacheEntry* ent); bool add(WrDiskCacheEntry* ent);
// Removes the cache entry |ent| from the stroage. The size of // Removes the cache entry |ent| from the storage. The size of
// cached data of ent is subtracted from total_. // cached data of ent is subtracted from total_.
bool remove(WrDiskCacheEntry* ent); bool remove(WrDiskCacheEntry* ent);
// Updates the already added entry |ent|. The |delta| means how many // Updates the already added entry |ent|. The |delta| means how many

View file

@ -210,7 +210,7 @@ void createPeerMessageString(unsigned char* msg, size_t msgLength,
size_t payloadLength, uint8_t messageId); size_t payloadLength, uint8_t messageId);
/** /**
* Creates compact form(packed addresss + 2bytes port) and stores the * Creates compact form(packed address + 2bytes port) and stores the
* results in compact. This function looks addr and if it is IPv4 * results in compact. This function looks addr and if it is IPv4
* address, it stores 6bytes in compact and if it is IPv6, it stores * address, it stores 6bytes in compact and if it is IPv6, it stores
* 18bytes in compact. So compact must be at least 18 bytes and * 18bytes in compact. So compact must be at least 18 bytes and

View file

@ -275,7 +275,7 @@ error_code::Value option_processing(Option& op, bool standalone,
// we must clear eof bit and seek to the beginning of the buffer. // we must clear eof bit and seek to the beginning of the buffer.
cmdstream.clear(); cmdstream.clear();
cmdstream.seekg(0, std::ios::beg); cmdstream.seekg(0, std::ios::beg);
// finaly let's parse and store command-iine options. // finally let's parse and store command-line options.
op.setParent(confOption); op.setParent(confOption);
oparser->parse(op, cmdstream); oparser->parse(op, cmdstream);
oparser->parse(op, options); oparser->parse(op, options);