You've already forked qBittorrent
mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-10-14 11:52:15 +02:00
Compare commits
99 Commits
release-4.
...
v4_1_x
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d8cb552804 | ||
![]() |
304e831b0c | ||
![]() |
f16d219646 | ||
![]() |
22b0160eaa | ||
![]() |
d4f49c3666 | ||
![]() |
0b055d8fef | ||
![]() |
21595fca9c | ||
![]() |
64ac48ee11 | ||
![]() |
5d98721593 | ||
![]() |
598159552e | ||
![]() |
eea38e7c9e | ||
![]() |
5c933c9734 | ||
![]() |
102b7fa78e | ||
![]() |
b5ee908f6c | ||
![]() |
7825d8627f | ||
![]() |
b798c591e7 | ||
![]() |
9e7d21d7aa | ||
![]() |
38a15b27f0 | ||
![]() |
cb31684a66 | ||
![]() |
850cde19f7 | ||
![]() |
fc5b3b4f70 | ||
![]() |
73fd4d83af | ||
![]() |
811b525b1d | ||
![]() |
0f8def9a49 | ||
![]() |
359b464958 | ||
![]() |
b5b0d68dd9 | ||
![]() |
f48c49c248 | ||
![]() |
11ca744548 | ||
![]() |
82e6fc700e | ||
![]() |
59fd70c638 | ||
![]() |
617bf767df | ||
![]() |
55180e3598 | ||
![]() |
56b62e6573 | ||
![]() |
b37e7b0340 | ||
![]() |
21aebaf16f | ||
![]() |
5792465317 | ||
![]() |
e98f44af63 | ||
![]() |
40cf0203fb | ||
![]() |
05a82afeb6 | ||
![]() |
a456f1b0f9 | ||
![]() |
4acc44a5b0 | ||
![]() |
9c2a1146df | ||
![]() |
807abeae87 | ||
![]() |
dd2a0d0484 | ||
![]() |
3f3400f43b | ||
![]() |
334b57a89a | ||
![]() |
00d6c83ee5 | ||
![]() |
e8850c7a70 | ||
![]() |
2ef96eb218 | ||
![]() |
4682e31ab7 | ||
![]() |
988f7e2ef8 | ||
![]() |
6007913291 | ||
![]() |
cdcc7a210b | ||
![]() |
a466ff5057 | ||
![]() |
e954835579 | ||
![]() |
3e9be3a0e8 | ||
![]() |
4ab32a76f6 | ||
![]() |
bad60058df | ||
![]() |
31a6ad1eb6 | ||
![]() |
a8bfec081e | ||
![]() |
ae21d0f1e2 | ||
![]() |
c599976b6f | ||
![]() |
bcee784097 | ||
![]() |
697fc626cd | ||
![]() |
2f15ea9b54 | ||
![]() |
d03209a73d | ||
![]() |
ac9ba255d8 | ||
![]() |
9a7e79bd0e | ||
![]() |
e8be3bf939 | ||
![]() |
74e52746b1 | ||
![]() |
8d26a221e0 | ||
![]() |
3fdab88eb7 | ||
![]() |
d376d912b3 | ||
![]() |
e329c41ef2 | ||
![]() |
01e4179555 | ||
![]() |
06f503b5df | ||
![]() |
e2f3dad7b8 | ||
![]() |
377f31085c | ||
![]() |
ec13d195f8 | ||
![]() |
c01aed8d90 | ||
![]() |
ad7b8a9bfa | ||
![]() |
5bba1ed208 | ||
![]() |
fe94e14bcc | ||
![]() |
b0af479ab9 | ||
![]() |
24ff369f29 | ||
![]() |
979c9a7094 | ||
![]() |
7b90ac52c1 | ||
![]() |
ecfbda78bc | ||
![]() |
9ba7470815 | ||
![]() |
6394467cc7 | ||
![]() |
f6d72fa79f | ||
![]() |
32ed5f1c8e | ||
![]() |
5026da5773 | ||
![]() |
ef130e4438 | ||
![]() |
4fbd52c2d5 | ||
![]() |
8f29b70c1e | ||
![]() |
9a4dd3ea9d | ||
![]() |
fcd3bb6918 | ||
![]() |
9f69fd8750 |
51
Changelog
51
Changelog
@@ -1,3 +1,54 @@
|
||||
* Thu Oct 31 2019 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.1.9.1
|
||||
- WINDOWS: Fix a problem with bigger dialogs due to wrong DPI reported by the system (Chocobo1)
|
||||
|
||||
* Sun Oct 27 2019 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.1.9
|
||||
- BUGFIX: Preserve relative order when moving to top/bottom in queue (Chocobo1)
|
||||
- WINDOWS: Use real physical screen DPI (Chocobo1)
|
||||
- WEBUI: Bump Web API version
|
||||
|
||||
* Mon Sep 23 2019 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.1.8
|
||||
- BUGFIX: Fix filename validation on non-Windows OS (Chocobo1)
|
||||
- BUGFIX: ScanFolders/FileSystemWatcher now detect magnet files with case insensitivity in filename (Chocobo1)
|
||||
- BUGFIX: Fix failed seeding after creating a torrent and auto-adding it to the session (Chocobo1)
|
||||
|
||||
* Sun Aug 04 2019 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.1.7
|
||||
- FEATURE: Add 12 hour and 24 hour speed graphs (dzmat)
|
||||
- FEATURE: Change "Add new torrent" dialog to horizontal layout (Evgeny Lensky)
|
||||
- BUGFIX: Fix messed up symbols in log (Chocobo1)
|
||||
- BUGFIX: Fix incomplete file extension not applied for new torrents (Chocobo1)
|
||||
- BUGFIX: Save updated resume data for completed torrents (Vladimir Golovnev (Glassez))
|
||||
- BUGFIX: Fix requested torrent resume data handling (Vladimir Golovnev (Glassez))
|
||||
- BUGFIX: Prevent command injection via "Run external program" function (Chocobo1)
|
||||
- BUGFIX: Avoid race conditions when adding torrent (Vladimir Golovnev (Glassez))
|
||||
- BUGFIX: Fix torrent checking issues (Vladimir Golovnev (Glassez))
|
||||
- BUGFIX: Use proper log message when there are no error (Chocobo1)
|
||||
- BUGFIX: Fix torrent properties not saved for paused torrents (Chocobo1)
|
||||
- BUGFIX: Some improvements on qtsingleapplication code (Chocobo1)
|
||||
- BUGFIX: Remove limits of "Disk cache expiry interval" setting (Chocobo1)
|
||||
- BUGFIX: Remove upper limit of "Disk cache" setting (Chocobo1)
|
||||
- BUGFIX: Fix crash when removing phantom tags (Chocobo1)
|
||||
- BUGFIX: Improve handleFileErrorAlert error message (Chocobo1)
|
||||
- BUGFIX: Fix updated save path not saved for paused torrents (Chocobo1)
|
||||
- BUGFIX: Log save_resume_data_failed_alert (Chocobo1)
|
||||
- BUGFIX: Don't remove parent directories (Chocobo1)
|
||||
- BUGFIX: Properly remove empty leftover folders after rename (Chocobo1)
|
||||
- BUGFIX: Focus behavior row in Options dialog (silverqx)
|
||||
- BUGFIX: Fix unable to rename folder on Windows when same is used in different case(Chocobo1)
|
||||
- BUGFIX: Fix unable to control add torrent dialogs when opened simultaneously (Chocobo1)
|
||||
- BUGFIX: Disable "Upload mode" when start preloaded torrent (Vladimir Golovnev (Glassez))
|
||||
- BUGFIX: Fix wrong comparison result when sorting items(Chocobo1)
|
||||
- BUGFIX: Fix sequential downloading when redirected (Vladimir Golovnev (Glassez))
|
||||
- BUGFIX: Fix typos (Chocobo1)
|
||||
- BUGFIX: Fix assertion fail (Chocobo1)
|
||||
- BUGFIX: Change number of time axis divisions from 5 to 6 for convenience (dzmat)
|
||||
- BUGFIX: Don't turn window blank when closed to system tray (Ekin Dursun)
|
||||
- WEBUI: Fix WebUI encoding of special characters (Thomas Piccirello)
|
||||
- WEBUI: Change the speed unit from Bytes/s to KiB/s for the rate limiter(jerrymakesjelly)
|
||||
- WEBUI: Fix '+' char not decoded to space correctly (Chocobo1)
|
||||
- RSS: Ignore RSS articles with non-unique identifiers (Vladimir Golovnev (Glassez))
|
||||
- RSS: Perform more RSS parsing in working thread (Vladimir Golovnev (Glassez))
|
||||
- RSS: Download RSS enclosure element if no proper MIME type is found (Matan Bareket)
|
||||
|
||||
* Sun May 05 2019 - sledgehammer999 <sledgehammer999@qbittorrent.org> - v4.1.6
|
||||
- BUGFIX: Force recheck multiple torrents one by one in all possible cases. Closes #9120 (glassez)
|
||||
- BUGFIX: Don't query Google for tracker favicons, for privacy reasons (sledgehammer999)
|
||||
|
@@ -13,8 +13,7 @@ It aims to be a good alternative to all other bittorrent clients
|
||||
out there. qBittorrent is fast, stable and provides unicode
|
||||
support as well as many features.
|
||||
|
||||
This product includes GeoLite data created by MaxMind, available from
|
||||
https://www.maxmind.com/
|
||||
The free [IP to Country Lite database](https://db-ip.com/db/download/ip-to-country-lite) by [DB-IP](https://db-ip.com/) is used for resolving the countries of peers. The database is licensed under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
|
||||
|
||||
### Installation:
|
||||
For installation, follow the instructions from INSTALL file, but simple:
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Wrapper for compilers which do not understand '-c -o'.
|
||||
|
||||
scriptversion=2012-10-14.11; # UTC
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <tromey@cygnus.com>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
@@ -255,7 +255,8 @@ EOF
|
||||
echo "compile $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
|
||||
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
|
||||
icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
|
||||
func_cl_wrapper "$@" # Doesn't return...
|
||||
;;
|
||||
esac
|
||||
@@ -339,9 +340,9 @@ exit $ret
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
966
build-aux/config.guess
vendored
966
build-aux/config.guess
vendored
File diff suppressed because it is too large
Load Diff
2770
build-aux/config.sub
vendored
2770
build-aux/config.sub
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2013-12-25.23; # UTC
|
||||
scriptversion=2018-03-11.20; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
@@ -271,15 +271,18 @@ do
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
# If destination is a directory, append the input filename.
|
||||
if test -d "$dst"; then
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstbase=`basename "$src"`
|
||||
case $dst in
|
||||
*/) dst=$dst$dstbase;;
|
||||
*) dst=$dst/$dstbase;;
|
||||
esac
|
||||
dstdir_status=0
|
||||
else
|
||||
dstdir=`dirname "$dst"`
|
||||
@@ -288,6 +291,11 @@ do
|
||||
fi
|
||||
fi
|
||||
|
||||
case $dstdir in
|
||||
*/) dstdirslash=$dstdir;;
|
||||
*) dstdirslash=$dstdir/;;
|
||||
esac
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
@@ -324,34 +332,43 @@ do
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
# Note that $RANDOM variable is not portable (e.g. dash); Use it
|
||||
# here however when possible just to lower collision chance.
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
||||
# directly in world-writeable /tmp, make sure that the '$tmpdir'
|
||||
# directory is successfully created first before we actually test
|
||||
# 'mkdir -p' feature.
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
@@ -427,8 +444,8 @@ do
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
dsttmp=${dstdirslash}_inst.$$_
|
||||
rmtmp=${dstdirslash}_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
@@ -493,9 +510,9 @@ do
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Common wrapper for a few potentially missing GNU programs.
|
||||
|
||||
scriptversion=2013-10-28.13; # UTC
|
||||
scriptversion=2018-03-07.03; # UTC
|
||||
|
||||
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
|
||||
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
@@ -101,9 +101,9 @@ else
|
||||
exit $st
|
||||
fi
|
||||
|
||||
perl_URL=http://www.perl.org/
|
||||
flex_URL=http://flex.sourceforge.net/
|
||||
gnu_software_URL=http://www.gnu.org/software
|
||||
perl_URL=https://www.perl.org/
|
||||
flex_URL=https://github.com/westes/flex
|
||||
gnu_software_URL=https://www.gnu.org/software
|
||||
|
||||
program_details ()
|
||||
{
|
||||
@@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
|
||||
exit $st
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
31
configure
vendored
31
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for qbittorrent v4.1.6.
|
||||
# Generated by GNU Autoconf 2.69 for qbittorrent v4.1.9.1.
|
||||
#
|
||||
# Report bugs to <bugs.qbittorrent.org>.
|
||||
#
|
||||
@@ -580,8 +580,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='qbittorrent'
|
||||
PACKAGE_TARNAME='qbittorrent'
|
||||
PACKAGE_VERSION='v4.1.6'
|
||||
PACKAGE_STRING='qbittorrent v4.1.6'
|
||||
PACKAGE_VERSION='v4.1.9.1'
|
||||
PACKAGE_STRING='qbittorrent v4.1.9.1'
|
||||
PACKAGE_BUGREPORT='bugs.qbittorrent.org'
|
||||
PACKAGE_URL='https://www.qbittorrent.org/'
|
||||
|
||||
@@ -1299,7 +1299,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures qbittorrent v4.1.6 to adapt to many kinds of systems.
|
||||
\`configure' configures qbittorrent v4.1.9.1 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1370,7 +1370,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of qbittorrent v4.1.6:";;
|
||||
short | recursive ) echo "Configuration of qbittorrent v4.1.9.1:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1505,7 +1505,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
qbittorrent configure v4.1.6
|
||||
qbittorrent configure v4.1.9.1
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -1644,7 +1644,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by qbittorrent $as_me v4.1.6, which was
|
||||
It was created by qbittorrent $as_me v4.1.9.1, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -3822,7 +3822,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='qbittorrent'
|
||||
VERSION='v4.1.6'
|
||||
VERSION='v4.1.9.1'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -4178,7 +4178,6 @@ QBT_CXX="$CXX"
|
||||
|
||||
# Define --wth-* and --enable-* arguments
|
||||
|
||||
|
||||
# Check whether --with-qtsingleapplication was given.
|
||||
if test "${with_qtsingleapplication+set}" = set; then :
|
||||
withval=$with_qtsingleapplication;
|
||||
@@ -4749,7 +4748,9 @@ fi
|
||||
case ${host_cpu} in #(
|
||||
x86_64) :
|
||||
libsubdirs="lib64 libx32 lib lib64" ;; #(
|
||||
ppc64|s390x|sparc64|aarch64|ppc64le) :
|
||||
mips*64*) :
|
||||
libsubdirs="lib64 lib32 lib lib64" ;; #(
|
||||
ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64) :
|
||||
libsubdirs="lib64 lib lib64" ;; #(
|
||||
*) :
|
||||
libsubdirs="lib"
|
||||
@@ -5271,7 +5272,7 @@ fi
|
||||
|
||||
fi
|
||||
if test "x$ax_lib" = "x"; then
|
||||
as_fn_error $? "Could not find a version of the library!" "$LINENO" 5
|
||||
as_fn_error $? "Could not find a version of the Boost::System library!" "$LINENO" 5
|
||||
fi
|
||||
if test "x$link_system" = "xno"; then
|
||||
as_fn_error $? "Could not link against $ax_lib !" "$LINENO" 5
|
||||
@@ -6274,7 +6275,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by qbittorrent $as_me v4.1.6, which was
|
||||
This file was extended by qbittorrent $as_me v4.1.9.1, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -6332,7 +6333,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
qbittorrent config.status v4.1.6
|
||||
qbittorrent config.status v4.1.9.1
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
@@ -7590,7 +7591,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by qbittorrent $as_me v4.1.6, which was
|
||||
This file was extended by qbittorrent $as_me v4.1.9.1, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -7648,7 +7649,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
qbittorrent config.status v4.1.6
|
||||
qbittorrent config.status v4.1.9.1
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
AC_INIT([qbittorrent], [v4.1.6], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
|
||||
AC_INIT([qbittorrent], [v4.1.9.1], [bugs.qbittorrent.org], [], [https://www.qbittorrent.org/])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_PROG_CC
|
||||
|
2
dist/mac/Info.plist
vendored
2
dist/mac/Info.plist
vendored
@@ -55,7 +55,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>4.1.6</string>
|
||||
<string>4.1.9</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>@EXECUTABLE@</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
|
4
dist/windows/options.nsi
vendored
4
dist/windows/options.nsi
vendored
@@ -27,7 +27,7 @@ XPStyle on
|
||||
!define CSIDL_LOCALAPPDATA '0x1C' ;Local Application Data path
|
||||
|
||||
; Program specific
|
||||
!define PROG_VERSION "4.1.6"
|
||||
!define PROG_VERSION "4.1.9.1"
|
||||
|
||||
!define MUI_FINISHPAGE_RUN
|
||||
!define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
|
||||
@@ -54,7 +54,7 @@ VIAddVersionKey "LegalCopyright" "Copyright ©2006-2019 The qBittorrent project"
|
||||
VIAddVersionKey "FileDescription" "qBittorrent - A Bittorrent Client"
|
||||
VIAddVersionKey "FileVersion" "${PROG_VERSION}"
|
||||
|
||||
VIProductVersion "${PROG_VERSION}.0"
|
||||
VIProductVersion "${PROG_VERSION}.1"
|
||||
|
||||
; The default installation directory. It changes depending if we install in the 64bit dir or not.
|
||||
; A caveat of this is if a user has installed a 32bit version and then runs the 64bit installer
|
||||
|
@@ -33,7 +33,7 @@
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 42
|
||||
#serial 47
|
||||
|
||||
# example boost program (need to pass version)
|
||||
m4_define([_AX_BOOST_BASE_PROGRAM],
|
||||
@@ -113,7 +113,8 @@ AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
|
||||
dnl are found, e.g. when only header-only libraries are installed!
|
||||
AS_CASE([${host_cpu}],
|
||||
[x86_64],[libsubdirs="lib64 libx32 lib lib64"],
|
||||
[ppc64|s390x|sparc64|aarch64|ppc64le],[libsubdirs="lib64 lib lib64"],
|
||||
[mips*64*],[libsubdirs="lib64 lib32 lib lib64"],
|
||||
[ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64],[libsubdirs="lib64 lib lib64"],
|
||||
[libsubdirs="lib"]
|
||||
)
|
||||
|
||||
|
@@ -31,7 +31,7 @@
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 19
|
||||
#serial 20
|
||||
|
||||
AC_DEFUN([AX_BOOST_SYSTEM],
|
||||
[
|
||||
@@ -108,7 +108,7 @@ AC_DEFUN([AX_BOOST_SYSTEM],
|
||||
|
||||
fi
|
||||
if test "x$ax_lib" = "x"; then
|
||||
AC_MSG_ERROR(Could not find a version of the library!)
|
||||
AC_MSG_ERROR(Could not find a version of the Boost::System library!)
|
||||
fi
|
||||
if test "x$link_system" = "xno"; then
|
||||
AC_MSG_ERROR(Could not link against $ax_lib !)
|
||||
|
@@ -332,7 +332,11 @@ void Application::runExternalProgram(const BitTorrent::TorrentHandle *torrent) c
|
||||
|
||||
::LocalFree(args);
|
||||
#else
|
||||
QProcess::startDetached(QLatin1String("/bin/sh"), {QLatin1String("-c"), program});
|
||||
// Cannot give users shell environment by default, as doing so could
|
||||
// enable command injection via torrent name and other arguments
|
||||
// (especially when some automated download mechanism has been setup).
|
||||
// See: https://github.com/qbittorrent/qBittorrent/issues/10925
|
||||
QProcess::startDetached(program);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@@ -101,6 +101,7 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
|
||||
#endif
|
||||
|
||||
server = new QLocalServer(this);
|
||||
server->setSocketOptions(QLocalServer::UserAccessOption);
|
||||
QString lockName = QDir(QDir::tempPath()).absolutePath()
|
||||
+ QLatin1Char('/') + socketName
|
||||
+ QLatin1String("-lockfile");
|
||||
@@ -191,6 +192,12 @@ void QtLocalPeer::receiveConnection()
|
||||
QByteArray uMsg;
|
||||
quint32 remaining;
|
||||
ds >> remaining;
|
||||
if (remaining > 65535) {
|
||||
// drop suspiciously large data
|
||||
delete socket;
|
||||
return;
|
||||
}
|
||||
|
||||
uMsg.resize(remaining);
|
||||
int got = 0;
|
||||
char* uMsgBuf = uMsg.data();
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -482,6 +482,7 @@ namespace BitTorrent
|
||||
void bottomTorrentsPriority(const QStringList &hashes);
|
||||
|
||||
// TorrentHandle interface
|
||||
void handleTorrentSaveResumeDataRequested(TorrentHandle *const torrent);
|
||||
void handleTorrentShareLimitChanged(TorrentHandle *const torrent);
|
||||
void handleTorrentNameChanged(TorrentHandle *const torrent);
|
||||
void handleTorrentSavePathChanged(TorrentHandle *const torrent);
|
||||
@@ -608,13 +609,13 @@ namespace BitTorrent
|
||||
|
||||
void updateSeedingLimitTimer();
|
||||
void exportTorrentFile(TorrentHandle *const torrent, TorrentExportFolder folder = TorrentExportFolder::Regular);
|
||||
void saveTorrentResumeData(TorrentHandle *const torrent);
|
||||
|
||||
void handleAlert(libtorrent::alert *a);
|
||||
void dispatchTorrentAlert(libtorrent::alert *a);
|
||||
void handleAddTorrentAlert(libtorrent::add_torrent_alert *p);
|
||||
void handleStateUpdateAlert(libtorrent::state_update_alert *p);
|
||||
void handleMetadataReceivedAlert(libtorrent::metadata_received_alert *p);
|
||||
void handleMetadataReceivedAlert(const libtorrent::metadata_received_alert *p);
|
||||
void handleTorrentPausedAlert(const libtorrent::torrent_paused_alert *p);
|
||||
void handleFileErrorAlert(libtorrent::file_error_alert *p);
|
||||
void handleTorrentRemovedAlert(libtorrent::torrent_removed_alert *p);
|
||||
void handleTorrentDeletedAlert(libtorrent::torrent_deleted_alert *p);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -385,6 +385,12 @@ namespace BitTorrent
|
||||
private:
|
||||
typedef boost::function<void ()> EventTrigger;
|
||||
|
||||
#if (LIBTORRENT_VERSION_NUM < 10200)
|
||||
using LTFileIndex = int;
|
||||
#else
|
||||
using LTFileIndex = lt::file_index_t;
|
||||
#endif
|
||||
|
||||
void updateStatus();
|
||||
void updateStatus(const libtorrent::torrent_status &nativeStatus);
|
||||
void updateState();
|
||||
@@ -446,6 +452,10 @@ namespace BitTorrent
|
||||
QQueue<EventTrigger> m_moveFinishedTriggers;
|
||||
int m_renameCount;
|
||||
|
||||
// Until libtorrent provide an "old_name" field in `file_renamed_alert`
|
||||
// we will rely on this workaround to remove empty leftover folders
|
||||
QHash<LTFileIndex, QVector<QString>> m_oldPath;
|
||||
|
||||
bool m_useAutoTMM;
|
||||
|
||||
// Persistent data
|
||||
@@ -457,6 +467,7 @@ namespace BitTorrent
|
||||
qreal m_ratioLimit;
|
||||
int m_seedingTimeLimit;
|
||||
bool m_tempPathDisabled;
|
||||
bool m_fastresumeDataRejected;
|
||||
bool m_hasMissingFiles;
|
||||
bool m_hasRootFolder;
|
||||
bool m_needsToSetFirstLastPiecePriority;
|
||||
@@ -466,12 +477,15 @@ namespace BitTorrent
|
||||
|
||||
enum StartupState
|
||||
{
|
||||
NotStarted,
|
||||
Starting,
|
||||
Started
|
||||
Preparing, // torrent is preparing to start regular processing
|
||||
Starting, // torrent is prepared and starting to perform regular processing
|
||||
Started // torrent is performing regular processing
|
||||
};
|
||||
StartupState m_startupState = Preparing;
|
||||
// Handle torrent state when it starts performing some service job
|
||||
// being in Paused state so it might be unpaused internally and then paused again
|
||||
bool m_pauseWhenReady;
|
||||
|
||||
StartupState m_startupState = NotStarted;
|
||||
bool m_unchecked = false;
|
||||
};
|
||||
}
|
||||
|
@@ -340,8 +340,13 @@ TorrentInfo::PieceRange TorrentInfo::filePieces(int fileIndex) const
|
||||
const libt::file_storage &files = nativeInfo()->files();
|
||||
const auto fileSize = files.file_size(fileIndex);
|
||||
const auto fileOffset = files.file_offset(fileIndex);
|
||||
return makeInterval(static_cast<int>(fileOffset / pieceLength()),
|
||||
static_cast<int>((fileOffset + fileSize - 1) / pieceLength()));
|
||||
|
||||
const int beginIdx = (fileOffset / pieceLength());
|
||||
const int endIdx = ((fileOffset + fileSize - 1) / pieceLength());
|
||||
|
||||
if (fileSize <= 0)
|
||||
return {beginIdx, 0};
|
||||
return makeInterval(beginIdx, endIdx);
|
||||
}
|
||||
|
||||
void TorrentInfo::renameFile(const int index, const QString &newPath)
|
||||
|
@@ -29,16 +29,11 @@
|
||||
|
||||
#include "tracker.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <libtorrent/bencode.hpp>
|
||||
#include <libtorrent/entry.hpp>
|
||||
|
||||
#include "base/global.h"
|
||||
#include "base/http/server.h"
|
||||
#include "base/preferences.h"
|
||||
#include "base/utils/bytearray.h"
|
||||
#include "base/utils/string.h"
|
||||
|
||||
// static limits
|
||||
static const int MAX_TORRENTS = 100;
|
||||
@@ -133,21 +128,7 @@ Http::Response Tracker::processRequest(const Http::Request &request, const Http:
|
||||
|
||||
void Tracker::respondToAnnounceRequest()
|
||||
{
|
||||
QMap<QString, QByteArray> queryParams;
|
||||
// Parse GET parameters
|
||||
using namespace Utils::ByteArray;
|
||||
for (const QByteArray ¶m : asConst(splitToViews(m_request.query, "&"))) {
|
||||
const int sepPos = param.indexOf('=');
|
||||
if (sepPos <= 0) continue; // ignores params without name
|
||||
|
||||
const QByteArray nameComponent = midView(param, 0, sepPos);
|
||||
const QByteArray valueComponent = midView(param, (sepPos + 1));
|
||||
|
||||
const QString paramName = QString::fromUtf8(QByteArray::fromPercentEncoding(nameComponent));
|
||||
const QByteArray paramValue = QByteArray::fromPercentEncoding(valueComponent);
|
||||
queryParams[paramName] = paramValue;
|
||||
}
|
||||
|
||||
const QMap<QString, QByteArray> &queryParams = m_request.query;
|
||||
TrackerAnnounceRequest announceReq;
|
||||
|
||||
// IP
|
||||
|
@@ -36,7 +36,6 @@
|
||||
|
||||
#include "base/http/irequesthandler.h"
|
||||
#include "base/http/responsebuilder.h"
|
||||
#include "base/http/types.h"
|
||||
|
||||
namespace libtorrent
|
||||
{
|
||||
|
@@ -162,7 +162,7 @@ void FileSystemWatcher::processTorrentsInDir(const QDir &dir)
|
||||
const QStringList files = dir.entryList({"*.torrent", "*.magnet"}, QDir::Files);
|
||||
for (const QString &file : files) {
|
||||
const QString fileAbsPath = dir.absoluteFilePath(file);
|
||||
if (file.endsWith(".magnet"))
|
||||
if (file.endsWith(".magnet", Qt::CaseInsensitive))
|
||||
torrents << fileAbsPath;
|
||||
else if (BitTorrent::TorrentInfo::loadFromFile(fileAbsPath).isValid())
|
||||
torrents << fileAbsPath;
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include <QUrl>
|
||||
#include <QUrlQuery>
|
||||
|
||||
#include "base/global.h"
|
||||
#include "base/utils/bytearray.h"
|
||||
#include "base/utils/string.h"
|
||||
|
||||
@@ -180,14 +181,29 @@ bool RequestParser::parseRequestLine(const QString &line)
|
||||
m_request.method = match.captured(1);
|
||||
|
||||
// Request Target
|
||||
// URL components should be separated before percent-decoding
|
||||
// [rfc3986] 2.4 When to Encode or Decode
|
||||
const QByteArray url {match.captured(2).toLatin1()};
|
||||
const int sepPos = url.indexOf('?');
|
||||
const QByteArray pathComponent = ((sepPos == -1) ? url : Utils::ByteArray::midView(url, 0, sepPos));
|
||||
const QByteArray pathComponent = ((sepPos == -1) ? url : midView(url, 0, sepPos));
|
||||
|
||||
m_request.path = QString::fromUtf8(QByteArray::fromPercentEncoding(pathComponent));
|
||||
if (sepPos >= 0)
|
||||
m_request.query = url.mid(sepPos + 1);
|
||||
|
||||
if (sepPos >= 0) {
|
||||
const QByteArray query = midView(url, (sepPos + 1));
|
||||
|
||||
// [rfc3986] 2.4 When to Encode or Decode
|
||||
// URL components should be separated before percent-decoding
|
||||
for (const QByteArray ¶m : asConst(splitToViews(query, "&"))) {
|
||||
const int eqCharPos = param.indexOf('=');
|
||||
if (eqCharPos <= 0) continue; // ignores params without name
|
||||
|
||||
const QByteArray nameComponent = midView(param, 0, eqCharPos);
|
||||
const QByteArray valueComponent = midView(param, (eqCharPos + 1));
|
||||
const QString paramName = QString::fromUtf8(QByteArray::fromPercentEncoding(nameComponent).replace('+', ' '));
|
||||
const QByteArray paramValue = QByteArray::fromPercentEncoding(valueComponent).replace('+', ' ');
|
||||
|
||||
m_request.query[paramName] = paramValue;
|
||||
}
|
||||
}
|
||||
|
||||
// HTTP-version
|
||||
m_request.version = match.captured(3);
|
||||
|
@@ -97,8 +97,8 @@ namespace Http
|
||||
QString version;
|
||||
QString method;
|
||||
QString path;
|
||||
QByteArray query;
|
||||
QStringMap headers;
|
||||
QMap<QString, QByteArray> query;
|
||||
QStringMap posts;
|
||||
QVector<UploadedFile> files;
|
||||
};
|
||||
|
@@ -245,7 +245,7 @@ void Net::DownloadManager::applyProxySettings()
|
||||
|
||||
void Net::DownloadManager::handleReplyFinished(QNetworkReply *reply)
|
||||
{
|
||||
const ServiceID id = ServiceID::fromURL(reply->url());
|
||||
const ServiceID id = ServiceID::fromURL(reply->request().url());
|
||||
auto waitingJobsIter = m_waitingJobs.find(id);
|
||||
if ((waitingJobsIter == m_waitingJobs.end()) || waitingJobsIter.value().isEmpty()) {
|
||||
m_busyServices.remove(id);
|
||||
|
@@ -44,10 +44,9 @@
|
||||
#include "downloadmanager.h"
|
||||
#include "private/geoipdatabase.h"
|
||||
|
||||
static const char DATABASE_URL[] = "https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz";
|
||||
static const char GEOIP_FOLDER[] = "GeoIP";
|
||||
static const char GEOIP_FILENAME[] = "GeoLite2-Country.mmdb";
|
||||
static const int UPDATE_INTERVAL = 30; // Days between database updates
|
||||
static const QString DATABASE_URL = QStringLiteral("https://download.db-ip.com/free/dbip-country-lite-%1.mmdb.gz");
|
||||
static const char GEODB_FOLDER[] = "GeoDB";
|
||||
static const char GEODB_FILENAME[] = "dbip-country-lite.mmdb";
|
||||
|
||||
using namespace Net;
|
||||
|
||||
@@ -96,29 +95,45 @@ void GeoIPManager::loadDatabase()
|
||||
}
|
||||
|
||||
QString filepath = Utils::Fs::expandPathAbs(
|
||||
QString("%1%2/%3").arg(specialFolderLocation(SpecialFolder::Data), GEOIP_FOLDER, GEOIP_FILENAME));
|
||||
QString("%1%2/%3").arg(specialFolderLocation(SpecialFolder::Data), GEODB_FOLDER, GEODB_FILENAME));
|
||||
|
||||
QString error;
|
||||
m_geoIPDatabase = GeoIPDatabase::load(filepath, error);
|
||||
if (m_geoIPDatabase)
|
||||
Logger::instance()->addMessage(tr("GeoIP database loaded. Type: %1. Build time: %2.")
|
||||
Logger::instance()->addMessage(tr("IP geolocation database loaded. Type: %1. Build time: %2.")
|
||||
.arg(m_geoIPDatabase->type(), m_geoIPDatabase->buildEpoch().toString()),
|
||||
Log::INFO);
|
||||
else
|
||||
Logger::instance()->addMessage(tr("Couldn't load GeoIP database. Reason: %1").arg(error), Log::WARNING);
|
||||
Logger::instance()->addMessage(tr("Couldn't load IP geolocation database. Reason: %1").arg(error), Log::WARNING);
|
||||
|
||||
manageDatabaseUpdate();
|
||||
}
|
||||
|
||||
void GeoIPManager::manageDatabaseUpdate()
|
||||
{
|
||||
if (!m_geoIPDatabase || (m_geoIPDatabase->buildEpoch().daysTo(QDateTime::currentDateTimeUtc()) >= UPDATE_INTERVAL))
|
||||
const auto expired = [](const QDateTime &testDateTime)
|
||||
{
|
||||
const QDate testDate = testDateTime.date();
|
||||
const QDate curDate = QDateTime::currentDateTimeUtc().date();
|
||||
|
||||
if ((testDate.year() < curDate.year()) && (curDate.day() > 1))
|
||||
return true;
|
||||
|
||||
if ((testDate.month() < curDate.month()) && (curDate.day() > 1))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
if (!m_geoIPDatabase || expired(m_geoIPDatabase->buildEpoch()))
|
||||
downloadDatabaseFile();
|
||||
}
|
||||
|
||||
void GeoIPManager::downloadDatabaseFile()
|
||||
{
|
||||
DownloadHandler *handler = DownloadManager::instance()->download({DATABASE_URL});
|
||||
const QDate curDate = QDateTime::currentDateTimeUtc().date();
|
||||
const QString curUrl = DATABASE_URL.arg(curDate.toString("yyyy-MM"));
|
||||
DownloadHandler *handler = DownloadManager::instance()->download({curUrl});
|
||||
connect(handler, static_cast<void (Net::DownloadHandler::*)(const QString &, const QByteArray &)>(&Net::DownloadHandler::downloadFinished)
|
||||
, this, &GeoIPManager::downloadFinished);
|
||||
connect(handler, &Net::DownloadHandler::downloadFailed, this, &GeoIPManager::downloadFailed);
|
||||
@@ -420,7 +435,7 @@ void GeoIPManager::downloadFinished(const QString &url, QByteArray data)
|
||||
bool ok = false;
|
||||
data = Utils::Gzip::decompress(data, &ok);
|
||||
if (!ok) {
|
||||
Logger::instance()->addMessage(tr("Could not decompress GeoIP database file."), Log::WARNING);
|
||||
LogMsg(tr("Could not decompress IP geolocation database file."), Log::WARNING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -431,28 +446,25 @@ void GeoIPManager::downloadFinished(const QString &url, QByteArray data)
|
||||
if (m_geoIPDatabase)
|
||||
delete m_geoIPDatabase;
|
||||
m_geoIPDatabase = geoIPDatabase;
|
||||
Logger::instance()->addMessage(tr("GeoIP database loaded. Type: %1. Build time: %2.")
|
||||
LogMsg(tr("IP geolocation database loaded. Type: %1. Build time: %2.")
|
||||
.arg(m_geoIPDatabase->type(), m_geoIPDatabase->buildEpoch().toString()),
|
||||
Log::INFO);
|
||||
QString targetPath = Utils::Fs::expandPathAbs(
|
||||
specialFolderLocation(SpecialFolder::Data) + GEOIP_FOLDER);
|
||||
const QString targetPath = Utils::Fs::expandPathAbs(
|
||||
specialFolderLocation(SpecialFolder::Data) + GEODB_FOLDER);
|
||||
if (!QDir(targetPath).exists())
|
||||
QDir().mkpath(targetPath);
|
||||
QFile targetFile(QString("%1/%2").arg(targetPath, GEOIP_FILENAME));
|
||||
if (!targetFile.open(QFile::WriteOnly) || (targetFile.write(data) == -1)) {
|
||||
Logger::instance()->addMessage(
|
||||
tr("Couldn't save downloaded GeoIP database file."), Log::WARNING);
|
||||
}
|
||||
else {
|
||||
Logger::instance()->addMessage(tr("Successfully updated GeoIP database."), Log::INFO);
|
||||
}
|
||||
QFile targetFile(QString("%1/%2").arg(targetPath, GEODB_FILENAME));
|
||||
if (!targetFile.open(QFile::WriteOnly) || (targetFile.write(data) == -1))
|
||||
LogMsg(tr("Couldn't save downloaded IP geolocation database file."), Log::WARNING);
|
||||
else
|
||||
LogMsg(tr("Successfully updated IP geolocation database."), Log::INFO);
|
||||
}
|
||||
else {
|
||||
delete geoIPDatabase;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Logger::instance()->addMessage(tr("Couldn't load GeoIP database. Reason: %1").arg(error), Log::WARNING);
|
||||
LogMsg(tr("Couldn't load IP geolocation database. Reason: %1").arg(error), Log::WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -38,7 +38,6 @@
|
||||
namespace
|
||||
{
|
||||
const qint32 MAX_FILE_SIZE = 67108864; // 64MB
|
||||
const char DB_TYPE[] = "GeoLite2-Country";
|
||||
const quint32 MAX_METADATA_SIZE = 131072; // 128KB
|
||||
const char METADATA_BEGIN_MARK[] = "\xab\xcd\xefMaxMind.com";
|
||||
const char DATA_SECTION_SEPARATOR[16] = {0};
|
||||
@@ -144,7 +143,7 @@ GeoIPDatabase::~GeoIPDatabase()
|
||||
|
||||
QString GeoIPDatabase::type() const
|
||||
{
|
||||
return DB_TYPE;
|
||||
return m_dbType;
|
||||
}
|
||||
|
||||
quint16 GeoIPDatabase::ipVersion() const
|
||||
@@ -255,11 +254,7 @@ bool GeoIPDatabase::parseMetadata(const QVariantHash &metadata, QString &error)
|
||||
m_indexSize = m_nodeCount * m_nodeSize;
|
||||
|
||||
CHECK_METADATA_REQ(database_type, QString);
|
||||
QString dbType = metadata.value("database_type").toString();
|
||||
if (dbType != DB_TYPE) {
|
||||
error = tr("Invalid database type: %1").arg(dbType);
|
||||
return false;
|
||||
}
|
||||
m_dbType = metadata.value("database_type").toString();
|
||||
|
||||
CHECK_METADATA_REQ(build_epoch, ULongLong);
|
||||
m_buildEpoch = QDateTime::fromTime_t(metadata.value("build_epoch").toULongLong());
|
||||
@@ -272,7 +267,7 @@ bool GeoIPDatabase::parseMetadata(const QVariantHash &metadata, QString &error)
|
||||
|
||||
bool GeoIPDatabase::loadDB(QString &error) const
|
||||
{
|
||||
qDebug() << "Parsing MaxMindDB index tree...";
|
||||
qDebug() << "Parsing IP geolocation database index tree...";
|
||||
|
||||
const int nodeSize = m_recordSize / 4; // in bytes
|
||||
const int indexSize = m_nodeCount * nodeSize;
|
||||
|
@@ -93,6 +93,7 @@ private:
|
||||
int m_indexSize;
|
||||
int m_recordBytes;
|
||||
QDateTime m_buildEpoch;
|
||||
QString m_dbType;
|
||||
// Search data
|
||||
mutable QHash<quint32, QString> m_countries;
|
||||
quint32 m_size;
|
||||
|
@@ -585,11 +585,13 @@ void Parser::parse_impl(const QByteArray &feedData)
|
||||
|
||||
emit finished(m_result);
|
||||
m_result.articles.clear(); // clear articles only
|
||||
m_articleIDs.clear();
|
||||
}
|
||||
|
||||
void Parser::parseRssArticle(QXmlStreamReader &xml)
|
||||
{
|
||||
QVariantHash article;
|
||||
QString altTorrentUrl;
|
||||
|
||||
while (!xml.atEnd()) {
|
||||
xml.readNext();
|
||||
@@ -605,6 +607,8 @@ void Parser::parseRssArticle(QXmlStreamReader &xml)
|
||||
else if (name == QLatin1String("enclosure")) {
|
||||
if (xml.attributes().value("type") == QLatin1String("application/x-bittorrent"))
|
||||
article[Article::KeyTorrentURL] = xml.attributes().value(QLatin1String("url")).toString();
|
||||
else if (xml.attributes().value("type").isEmpty())
|
||||
altTorrentUrl = xml.attributes().value(QLatin1String("url")).toString();
|
||||
}
|
||||
else if (name == QLatin1String("link")) {
|
||||
const QString text {xml.readElementText().trimmed()};
|
||||
@@ -631,7 +635,10 @@ void Parser::parseRssArticle(QXmlStreamReader &xml)
|
||||
}
|
||||
}
|
||||
|
||||
m_result.articles.prepend(article);
|
||||
if (article[Article::KeyTorrentURL].toString().isEmpty())
|
||||
article[Article::KeyTorrentURL] = altTorrentUrl;
|
||||
|
||||
addArticle(article);
|
||||
}
|
||||
|
||||
void Parser::parseRSSChannel(QXmlStreamReader &xml)
|
||||
@@ -726,7 +733,7 @@ void Parser::parseAtomArticle(QXmlStreamReader &xml)
|
||||
}
|
||||
}
|
||||
|
||||
m_result.articles.prepend(article);
|
||||
addArticle(article);
|
||||
}
|
||||
|
||||
void Parser::parseAtomChannel(QXmlStreamReader &xml)
|
||||
@@ -756,3 +763,34 @@ void Parser::parseAtomChannel(QXmlStreamReader &xml)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Parser::addArticle(QVariantHash article)
|
||||
{
|
||||
QVariant &torrentURL = article[Article::KeyTorrentURL];
|
||||
if (torrentURL.toString().isEmpty())
|
||||
torrentURL = article[Article::KeyLink];
|
||||
|
||||
// If item does not have an ID, fall back to some other identifier.
|
||||
QVariant &localId = article[Article::KeyId];
|
||||
if (localId.toString().isEmpty())
|
||||
localId = article.value(Article::KeyTorrentURL);
|
||||
if (localId.toString().isEmpty())
|
||||
localId = article.value(Article::KeyTitle);
|
||||
|
||||
if (localId.toString().isEmpty()) {
|
||||
// The article could not be uniquely identified
|
||||
// since it has no appropriate data.
|
||||
// Just ignore it.
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_articleIDs.contains(localId.toString())) {
|
||||
// The article could not be uniquely identified
|
||||
// since the Feed has duplicate identifiers.
|
||||
// Just ignore it.
|
||||
return;
|
||||
}
|
||||
|
||||
m_articleIDs.insert(localId.toString());
|
||||
m_result.articles.prepend(article);
|
||||
}
|
||||
|
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <QList>
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
#include <QString>
|
||||
#include <QVariantHash>
|
||||
|
||||
@@ -65,9 +66,11 @@ namespace RSS
|
||||
void parseRSSChannel(QXmlStreamReader &xml);
|
||||
void parseAtomArticle(QXmlStreamReader &xml);
|
||||
void parseAtomChannel(QXmlStreamReader &xml);
|
||||
void addArticle(QVariantHash article);
|
||||
|
||||
QString m_baseUrl;
|
||||
ParsingResult m_result;
|
||||
QSet<QString> m_articleIDs;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -419,24 +419,10 @@ int Feed::updateArticles(const QList<QVariantHash> &loadedArticles)
|
||||
QVector<QVariantHash> newArticles;
|
||||
newArticles.reserve(loadedArticles.size());
|
||||
for (QVariantHash article : loadedArticles) {
|
||||
QVariant &torrentURL = article[Article::KeyTorrentURL];
|
||||
if (torrentURL.toString().isEmpty())
|
||||
torrentURL = article[Article::KeyLink];
|
||||
|
||||
// If item does not have an ID, fall back to some other identifier.
|
||||
QVariant &localId = article[Article::KeyId];
|
||||
if (localId.toString().isEmpty())
|
||||
localId = article.value(Article::KeyTorrentURL);
|
||||
if (localId.toString().isEmpty())
|
||||
localId = article.value(Article::KeyTitle);
|
||||
|
||||
if (localId.toString().isEmpty())
|
||||
continue;
|
||||
|
||||
// If article has no publication date we use feed update time as a fallback.
|
||||
// To prevent processing of "out-of-limit" articles we must not assign dates
|
||||
// that are earlier than the dates of existing articles.
|
||||
const Article *existingArticle = articleByGUID(localId.toString());
|
||||
const Article *existingArticle = articleByGUID(article[Article::KeyId].toString());
|
||||
if (existingArticle) {
|
||||
dummyPubDate = existingArticle->date().addMSecs(-1);
|
||||
continue;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user