diff -Nru fatrat-1.2.0~beta2/CMakeLists.txt fatrat-1.2.0+git20180628/CMakeLists.txt --- fatrat-1.2.0~beta2/CMakeLists.txt 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/CMakeLists.txt 2018-07-05 18:20:27.000000000 +0000 @@ -1,6 +1,6 @@ project(fatrat) -cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) @@ -9,17 +9,25 @@ INCLUDE(CheckIncludeFiles) INCLUDE(FindPkgConfig) INCLUDE(FindBoost) -INCLUDE(FindJNI) +#INCLUDE(FindJNI) -find_package(Qt4 REQUIRED) +set(CMAKE_INCLUDE_CURRENT_DIR ON) -include_directories(src) +find_package(Qt5Core REQUIRED) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Svg REQUIRED) +find_package(Qt5DBus REQUIRED) +find_package(Qt5Network REQUIRED) +find_package(Qt5Xml REQUIRED) +find_package(Qt5LinguistTools REQUIRED) + +message(STATUS "XML: ${Qt5Xml_INCLUDE_DIRS}") +include_directories(${Qt5Widgets_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} + ${Qt5Network_INCLUDE_DIRS} ${Qt5Svg_INCLUDE_DIRS}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src) ADD_DEFINITIONS(-DBOOST_FILESYSTEM_NARROW_ONLY) -# If you remove the following line, the Boost ASIO code used in pion will make libtorrent's Boost ASIO code crash -# due to a curious symbol name conflict -#ADD_DEFINITIONS(-fvisibility-inlines-hidden) ADD_CUSTOM_TARGET(uninstall COMMAND ${CMAKE_COMMAND} -E echo Use 'xargs rm < install_manifest.txt' to uninstall this program @@ -41,29 +49,27 @@ set(WITH_JPLUGINS ON) endif(WITH_EVERYTHING) -if(WITH_CXX0X) - ADD_DEFINITIONS(-std=c++0x) -else(WITH_CXX0X) - ADD_DEFINITIONS(-Dunique_ptr=auto_ptr) -endif(WITH_CXX0X) +ADD_DEFINITIONS(-std=c++11) if(WITH_JPLUGINS) set(WITH_CURL ON) + INCLUDE(FindJNI) find_package(JNI REQUIRED) include_directories(${JNI_INCLUDE_DIRS}) endif(WITH_JPLUGINS) if(WITH_BITTORRENT) - pkg_check_modules(libtorrent REQUIRED "libtorrent-rasterbar >= 0.16.0") + pkg_check_modules(libtorrent REQUIRED "libtorrent-rasterbar >= 1.1.0") if(libtorrent_FOUND) message(STATUS "libtorrent ${libtorrent_VERSION} found OK") include_directories(${libtorrent_INCLUDE_DIRS}) - #if(libtorrent_VERSION GREATER 0.14.99) set(LIBTORRENT_0_15 TRUE) + #if(libtorrent_VERSION GREATER 1.0.99) + # set(LIBTORRENT_1_1 TRUE) #endif(libtorrent_VERSION GREATER 0.14.99) else(libtorrent_FOUND) message(FATAL_ERROR "No Rasterbar libtorrent found") @@ -90,8 +96,18 @@ # message(FATAL_ERROR "No Boost asio") #endif(ASIO_FOUND) - set(QT_USE_QTWEBKIT TRUE) - ADD_DEFINITIONS(-DTORRENT_USE_OPENSSL -DBOOST_ASIO_DYN_LINK) + find_package(Qt5WebEngine) + find_package(Qt5WebEngineWidgets) + + if (Qt5WebEngine_FOUND) + set(HAVE_WEBENGINE TRUE) + set(QT_LIBRARIES ${QT_LIBRAIRES} Qt5::WebEngine Qt5::WebEngineWidgets) + else(Qt5WebEngine_FOUND) + message(WARNING "Qt WebEngine not found, BitTorrent search not available") + endif (Qt5WebEngine_FOUND) + + include_directories(${Qt5WebEngine_INCLUDE_DIRS}) + ADD_DEFINITIONS(-DTORRENT_USE_OPENSSL) endif(WITH_BITTORRENT) if(WITH_JABBER) @@ -121,7 +137,6 @@ endif(curl_FOUND) endif(WITH_CURL) -ADD_DEFINITIONS(-Wl,--stack,524 288) if(CMAKE_BUILD_TYPE MATCHES Debug) ADD_DEFINITIONS(-ggdb) ADD_DEFINITIONS(-DDEBUG_BUILD) @@ -137,30 +152,24 @@ CHECK_FUNCTION_EXISTS(kqueue HAVE_KQUEUE) CONFIGURE_FILE(config.h.in config.h) -#QT4_ADD_DBUS_INTERFACE (fatrat_SRCS dbus/interface.xml dbusinterface) - -set(QT_USE_QTDBUS TRUE) -set(QT_USE_QTNETWORK TRUE) -set(QT_USE_QTXML TRUE) -set(QT_USE_QTSVG TRUE) - if(WITH_DOCUMENTATION) - set(QT_USE_QTHELP TRUE) + find_package(Qt5Help REQUIRED) + set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Help) endif(WITH_DOCUMENTATION) if(WITH_WEBINTERFACE) - pkg_check_modules(pion-net REQUIRED "pion-net >= 3.0.0") + pkg_check_modules(pion REQUIRED "pion >= 5.0.0") - if(pion-net_FOUND) - include_directories(${pion-net_INCLUDE_DIRS}) + if(pion_FOUND) + include_directories(${pion_INCLUDE_DIRS}) #message(STATUS "Pion libdir: ${pion-net_LIBDIR}") #FILE(GLOB pion_FileService "${pion-net_LIBDIR}/pion/plugins/FileService.*") #if(pion_FileService MATCHES "^$") # message(FATAL_ERROR "Pion-net FileService plugin not found (libpion-net-plugins?) - ${pion_FileService}") #endif(pion_FileService MATCHES "^$") - else(pion-net_FOUND) - message(FATAL_ERROR "No pion-net library found") - endif(pion-net_FOUND) + else(pion_FOUND) + message(FATAL_ERROR "No pion library found") + endif(pion_FOUND) endif(WITH_WEBINTERFACE) #set(CMAKE_REQUIRED_INCLUDES "sys/types.h") @@ -170,9 +179,7 @@ SET(XATTR_LIBRARIES "-lattr") endif (HAVE_XATTR_H) -include( ${QT_USE_FILE} ) -add_definitions(${QT_DEFINITIONS}) -include_directories(./ ../ ${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) set(fatrat_SRCS src/MyApplication.cpp @@ -207,7 +214,6 @@ src/XmlRpc.cpp src/Scheduler.cpp src/MyFileDialog.cpp - src/ReportBugDlg.cpp src/Settings.cpp src/QueueDlg.cpp src/ClipboardMonitor.cpp @@ -285,7 +291,6 @@ src/NewTransferDlg.h src/Logger.h src/MyApplication.h - src/ReportBugDlg.h src/ClipboardMonitor.h src/SettingsClipboardMonitorForm.h src/TransferFactory.h @@ -334,7 +339,6 @@ src/SpeedLimitWidget.ui src/UserAuthDlg.ui src/WidgetHostDlg.ui - src/ReportBugDlg.ui src/captcha/CaptchaQtDlg.ui src/tools/HashDlg.ui @@ -463,15 +467,12 @@ src/engines/TorrentPiecesModel.cpp src/engines/TorrentProgressWidget.cpp src/engines/TorrentSettings.cpp - src/tools/TorrentSearch.cpp - src/tools/TorrentWebView.cpp src/tools/CreateTorrentDlg.cpp src/tools/ContextListWidget.cpp ) + set(fatrat_MOC_HDRS ${fatrat_MOC_HDRS} - src/tools/TorrentSearch.h - src/tools/TorrentWebView.h src/tools/CreateTorrentDlg.h src/tools/ContextListWidget.h src/engines/TorrentDetails.h @@ -485,13 +486,29 @@ ) set(fatrat_UIS ${fatrat_UIS} - src/tools/TorrentSearch.ui - src/tools/TorrentWebView.ui src/tools/CreateTorrentDlg.ui src/engines/TorrentDetailsForm.ui src/engines/TorrentOptsWidget.ui src/engines/SettingsTorrentForm.ui ) + + if (HAVE_WEBENGINE) + set(fatrat_SRCS + ${fatrat_SRCS} + src/tools/TorrentSearch.cpp + src/tools/TorrentWebView.cpp + ) + set(fatrat_MOC_HDRS + ${fatrat_MOC_HDRS} + src/tools/TorrentSearch.h + src/tools/TorrentWebView.h + ) + set(fatrat_UIS + ${fatrat_UIS} + src/tools/TorrentSearch.ui + src/tools/TorrentWebView.ui + ) + endif (HAVE_WEBENGINE) endif(WITH_BITTORRENT) if(WITH_JABBER) @@ -552,15 +569,15 @@ ) endif(WITH_DOCUMENTATION) -qt4_wrap_cpp(fatrat_MOC_SRCS ${fatrat_MOC_HDRS}) +qt5_wrap_cpp(fatrat_MOC_SRCS ${fatrat_MOC_HDRS}) set(fatrat_RCS gfx/resources.qrc ) -qt4_wrap_ui(fatrat_UIS_H ${fatrat_UIS}) -qt4_add_resources(fatrat_QRC_H gfx/resources.qrc) -qt4_add_translation(lrelease_outputs locale/fatrat_cs_CZ.ts +qt5_wrap_ui(fatrat_UIS_H ${fatrat_UIS}) +qt5_add_resources(fatrat_QRC_H gfx/resources.qrc) +qt5_add_translation(lrelease_outputs locale/fatrat_cs_CZ.ts locale/fatrat_pl_PL.ts locale/fatrat_tr_TR.ts locale/fatrat_sk_SK.ts locale/fatrat_ru_RU.ts locale/fatrat_fr_FR.ts locale/fatrat_uk_UA.ts locale/fatrat_es_AR.ts locale/fatrat_es_ES.ts locale/fatrat_ca_ES.ts locale/fatrat_zh_CN.ts locale/fatrat_zh_TW.ts locale/fatrat_sr_RS.ts locale/fatrat_sr_BA.ts locale/fatrat_de_DE.ts) @@ -572,12 +589,22 @@ # This used to be a workaround until it started causing the exact opposite... oh dear! #STRING(REPLACE "-mt" "" pion-net_LIBRARIES "${pion-net_LIBRARIES}") #message(STATUS ${pion-net_LIBRARIES}) -target_link_libraries(fatrat -ldl -lpthread ${QT_LIBRARIES} ${libtorrent_LDFLAGS} ${gloox_LDFLAGS} ${curl_LDFLAGS} ${Boost_LIBRARIES} ${pion-net_LIBRARIES} ${QT_ADDITIONAL_LIBS} ${XATTR_LIBRARIES} -export-dynamic) -target_link_libraries(fatrat-conf ${QT_LIBRARIES}) + +if (POSIX_LINUX) + set (DL_LDFLAGS "-ldl") +endif (POSIX_LINUX) + +message(STATUS "Pion: ${pion_LIBRARIES}") + +target_link_libraries(fatrat ${DL_LDFLAGS} -lpthread ${QT_LIBRARIES} + Qt5::Widgets Qt5::Svg Qt5::Network Qt5::DBus Qt5::Xml + ${libtorrent_LDFLAGS} ${gloox_LDFLAGS} ${curl_LDFLAGS} ${Boost_LIBRARIES} + ${pion_LIBRARIES} ${XATTR_LIBRARIES} crypto -export-dynamic) +target_link_libraries(fatrat-conf Qt5::Core) set(fatrat_DEV_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/fatrat.h - ${CMAKE_CURRENT_SOURCE_DIR}/config.h + ${CMAKE_CURRENT_BINARY_DIR}/config.h ${CMAKE_CURRENT_SOURCE_DIR}/src/DelayedIcon.h ${CMAKE_CURRENT_SOURCE_DIR}/src/AppTools.h ${CMAKE_CURRENT_SOURCE_DIR}/src/Transfer.h @@ -648,7 +675,6 @@ if(WITH_JPLUGINS) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/java/findjvm.sh DESTINATION share/fatrat/data/java PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/java/fatrat-jplugins.jar DESTINATION share/fatrat/data/java) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/java/extension.policy DESTINATION share/fatrat/data/java) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/java/libs DESTINATION share/fatrat/data/java) endif(WITH_JPLUGINS) diff -Nru fatrat-1.2.0~beta2/config.h.in fatrat-1.2.0+git20180628/config.h.in --- fatrat-1.2.0~beta2/config.h.in 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/config.h.in 2018-07-05 18:20:27.000000000 +0000 @@ -20,6 +20,7 @@ #cmakedefine HAVE_SYS_EPOLL_H #cmakedefine HAVE_KQUEUE +#cmakedefine HAVE_WEBENGINE #cmakedefine GLOOX_0_9 #cmakedefine GLOOX_1_0 diff -Nru fatrat-1.2.0~beta2/data/defaults.conf fatrat-1.2.0+git20180628/data/defaults.conf --- fatrat-1.2.0~beta2/data/defaults.conf 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/data/defaults.conf 2018-07-05 18:20:27.000000000 +0000 @@ -20,7 +20,7 @@ css=true queue_tooltips=true queue_synconwrite=false -drop_forced_on_upload=true +drop_forced_on_upload=false [gui] hideunfocused=true diff -Nru fatrat-1.2.0~beta2/data/fatrat.desktop fatrat-1.2.0+git20180628/data/fatrat.desktop --- fatrat-1.2.0~beta2/data/fatrat.desktop 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/data/fatrat.desktop 2018-07-05 18:20:27.000000000 +0000 @@ -9,7 +9,7 @@ Comment[tr]=Qt tabanlı indirme/yükleme yöneticisi Comment[zh_TW]=基於-Qt 下載/上傳 管理員 Comment[zh_CN]=基于-Qt 下载/上传 管理员 -Exec=fatrat +Exec=fatrat %U Name=FatRat Name[sr]=ФатРат Name[sr@ijekavian]=ФатРат @@ -26,3 +26,5 @@ StartupNotify=true Terminal=false Type=Application +MimeType=x-scheme-handler/magnet;application/x-bittorrent + Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/fatrat-jplugins.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/fatrat-jplugins.jar differ diff -Nru fatrat-1.2.0~beta2/data/java/findjvm.sh fatrat-1.2.0+git20180628/data/java/findjvm.sh --- fatrat-1.2.0~beta2/data/java/findjvm.sh 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/data/java/findjvm.sh 2018-07-05 18:20:27.000000000 +0000 @@ -11,7 +11,7 @@ exit 1 fi - JAVA_HOME="$(java -cp "$(_dirname $0)/fatrat-jplugins.jar" info.dolezel.fatrat.plugins.helpers.GetJavaHome)" + JAVA_HOME="$(java -cp "$(_dirname $0)/libs/fatrat-jplugins-core.jar" info.dolezel.fatrat.plugins.helpers.GetJavaHome)" fi libjvm=$(find -L "$JAVA_HOME" -name libjvm.so | head -n1) Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/commons-codec-1.10.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/commons-codec-1.10.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/commons-codec.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/commons-codec.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/commons-io-2.4.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/commons-io-2.4.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/commons-io.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/commons-io.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/commons-lang-2.6.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/commons-lang-2.6.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/commons-lang.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/commons-lang.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/fatrat-jplugins-core.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/fatrat-jplugins-core.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/fatrat-jplugins-json.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/fatrat-jplugins-json.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/js-14.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/js-14.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/json.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/json.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/jsoup-1.6.3.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/jsoup-1.6.3.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/jsoup.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/jsoup.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/logback-classic-1.0.12.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/logback-classic-1.0.12.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/logback-core-1.0.12.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/logback-core-1.0.12.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/rhino-1.7.7.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/rhino-1.7.7.jar differ Binary files /tmp/tmpwJosn0/oWjPkH2upw/fatrat-1.2.0~beta2/data/java/libs/slf4j-api-1.7.5.jar and /tmp/tmpwJosn0/EhlklMaK87/fatrat-1.2.0+git20180628/data/java/libs/slf4j-api-1.7.5.jar differ diff -Nru fatrat-1.2.0~beta2/debian/changelog fatrat-1.2.0+git20180628/debian/changelog --- fatrat-1.2.0~beta2/debian/changelog 2014-05-23 11:18:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/changelog 2019-11-17 19:03:10.000000000 +0000 @@ -1,199 +1,177 @@ -fatrat (1.2.0~beta2-0ubuntu10) utopic; urgency=medium +fatrat (1.2.0+git20180628-2ppa1~eoan1) eoan; urgency=medium - * Rebuild against libgloox12. + * Automated backport upload; no source changes. - -- Colin Watson Fri, 23 May 2014 12:18:27 +0100 + -- Alexander Pozdnyakov Sun, 17 Nov 2019 22:03:10 +0300 -fatrat (1.2.0~beta2-0ubuntu9) utopic; urgency=high +fatrat (1.2.0+git20180628-2) unstable; urgency=medium - * No change rebuild against boost1.55. + * Rebuild - -- Dimitri John Ledkov Wed, 30 Apr 2014 23:29:21 +0100 + -- Alexander Pozdnyakov Sat, 16 Nov 2019 23:11:26 +0300 -fatrat (1.2.0~beta2-0ubuntu8) trusty; urgency=medium +fatrat (1.2.0+git20180628-1) unstable; urgency=medium - * No-change rebuild for gloox transition (LP: #1273967). + * Compile + * URL: https://github.com/LubosD/fatrat.git + * Branch: master + * Commit: f009cf18ae6ae85ff0f02e109de04d8b40c2d0f3 + * Date: 1530190166 + * git changelog: + * f009cf1 - Compatibility with latest libtorrent - -- Dmitry Shachnev Wed, 29 Jan 2014 17:04:17 +0400 + -- Alexander Pozdnyakov Thu, 05 Jul 2018 21:20:29 +0300 -fatrat (1.2.0~beta2-0ubuntu7) trusty; urgency=low +fatrat (1.2.0+git20161204-3) unstable; urgency=medium - * No change rebuild against Boost 1.54. + * fix depends - -- Dmitrijs Ledkovs Sun, 27 Oct 2013 00:51:51 +0100 + -- Alexander Pozdnyakov Mon, 04 Sep 2017 07:26:49 +0300 -fatrat (1.2.0~beta2-0ubuntu6) saucy; urgency=low +fatrat (1.2.0+git20161204-2) unstable; urgency=medium - * Build-Depend on libboost-thread-dev to fix FTBFS. + * Compile + * URL: https://github.com/LubosD/fatrat.git + * Branch: master + * Commit: 14a1a146df76d70c44dcc38363848a5b41a364d5 + * Date: 1480881672 + * git changelog: + * 14a1a14 - When adding/editing segment URLs, broken urls + http://@server.com were constructed - -- William Grant Wed, 16 Oct 2013 22:57:11 +1100 + -- Alexander Pozdnyakov Sat, 10 Dec 2016 13:29:41 +0300 -fatrat (1.2.0~beta2-0ubuntu5) saucy; urgency=low +fatrat (1.2.0+git20161121-1) unstable; urgency=medium - * No change rebuild for Boost 1.53 transition. + * Compile + * URL: https://github.com/LubosD/fatrat.git + * Branch: master + * Commit: cfe3ce938035df011ef45f886e3000a7d335778a + * Date: 1479730892 + * git changelog: + * cfe3ce9 - Improve compatibility with newer libtorrent + * 30cc07a - Java-related crash fix, fix for locating the JVM + * 3f34e47 - Prevent leaking passwords into Details view for HTTP/FTP + transfers (fixes #37) + * 8977a37 - Switch to libtorrent 1.1.x (fixes #35) - -- Dmitrijs Ledkovs Tue, 28 May 2013 09:46:28 +0100 + -- Alexander Pozdnyakov Sat, 26 Nov 2016 12:29:09 +0300 -fatrat (1.2.0~beta2-0ubuntu4) raring; urgency=low +fatrat (1.2.0+git20161108-1) unstable; urgency=medium - * No-change rebuild against libtorrent-rasterbar7. + * Compile + * URL: https://github.com/LubosD/fatrat.git + * Branch: master + * Commit: 8f653160d19d6a169d4ed09e3edd0301c8848fc7 + * Date: 1478638684 + * git changelog: + * 8f65316 - Support distributions without Qt WebEngine (e.g. Debian + or Ubuntu) - -- Andrew Starr-Bochicchio Fri, 08 Feb 2013 10:32:57 -0500 + -- Alexander Pozdnyakov Sun, 13 Nov 2016 12:14:20 +0300 -fatrat (1.2.0~beta2-0ubuntu3) quantal; urgency=low +fatrat (1.2.0+git20160927-1) unstable; urgency=medium - * Install StaticTransferMessage.h, since CurlDownload.h includes it. - Fixes fatrat-czshare build failure. + * Compile + * URL: https://github.com/LubosD/fatrat.git + * Branch: master + * Commit: 23008bba1381d502edde1c9666d90aa724415a4d + * Date: 1474972483 + * git changelog: + * 23008bb - Fix build with newer libtorrent - -- Colin Watson Wed, 03 Oct 2012 12:14:05 +0100 + -- Alexander Pozdnyakov Sat, 01 Oct 2016 20:26:52 +0300 -fatrat (1.2.0~beta2-0ubuntu2) quantal; urgency=low +fatrat (1.2.0+git20160628-1) unstable; urgency=medium - * Build using javahelper and default-jdk. - - Drop build depends on openjdk-6-* - - Include java-vars.mk in debian/rules and no longer manually - pass Java paths to configure. - * debian/patches/find_correct_jvm.patch (LP: #1035965): - - Patch findjvm.sh so that we find a usable jvm. The upstream script - simply takes the first jvm found. On 12.10 with default-jre this is - "cacao" which crashes fatrat on start up. Manual testing shows that - only "server" seems to allow fatrat to work. + * Compile + * URL: https://github.com/LubosD/fatrat.git + * Branch: master + * Commit: d215e77cde79d1b9a82687f39626ee0ea92350bb + * Date: 1467104618 + * git changelog: + * d215e77 - Fix issue #34 + * cd646de - Use WebEngine instead of WebKit (resolves #24) + * 3980d4e - Make the system tray icon fully working again + * 933be3b - Fix some obsoletion warnings in torrent download engine + * 18ac08d - Prevent re-adding a torrent which is already being + downloaded/seeded + * 9e7d484 - Support latest Pion sources + * fb0e0db - Test .travis.yml (try 7) + * a9643de - Test .travis.yml (try 6) + * 9d4edf5 - Test .travis.yml (try 5) + * ea38c18 - Test .travis.yml (try 4) + * 80e1146 - Test .travis.yml (try 3) + * 7c28d27 - Test .travis.yml (try 2) + * 7a325c5 - Test .travis.yml (try 1) + * e920c98 - Merge pull request #25 from misisko1/master + * cb889cf - Added library for SLF4J logging with updated fatrat- + jplugins-core.jar (logback.xml) + * 6de53db - Migrate jplugins build system from Ant to Maven - -- Andrew Starr-Bochicchio Tue, 14 Aug 2012 19:04:49 -0400 + -- Alexander Pozdnyakov Sat, 17 Sep 2016 19:00:49 +0300 -fatrat (1.2.0~beta2-0ubuntu1) quantal; urgency=low +fatrat (1.2.0+git20150930-5.1) unstable; urgency=medium - * New upstream release. - * Drop debian/patches/define_boost_fs_v2.patch, - applied upstream. - * Refresh debian/patches/fix_ftbfs_gold_linker.patch and - debian/patches/fix_ftbfs_gcc47.patch. - * debian/control: Build depend on libpion-net-dev, - openjdk-6-jdk, and openjdk-6-dbg and Recommend default-jre - in order to support new Java plugins. - * debian/watch: Look for both tar.gz and tar.xz releases. - * debian/rules: Pass Java paths to configure. - * Work around issue with libpion-net-dev by build depending - on libicu-dev, libboost-regex-dev, libboost-signals-dev, - libboost-iostreams-dev, libbz2-dev, and liblog4cpp5-dev. - See LP: #881632 and BTS #678433. - * debian/patches/fix_ftbfs_find_config.h.patch: - - Patch CMakeLists.txt in order to find and install config.h - * debian/patches/disable_tray_icon.patch: - - Disable tray icon by default. In Unity, with upstream defaults, - when you close fatrat it is minimized to the tray. Mouse clicks - on the tray in Unity only display the menu, which is empty, so - fatrat can not be reopened or quit. + * compile - -- Andrew Starr-Bochicchio Sat, 11 Aug 2012 17:17:44 -0400 + -- Alexander Pozdnyakov Tue, 02 Aug 2016 12:14:38 +0300 -fatrat (1.1.3-5) unstable; urgency=low +fatrat (1.2.0+git20150930-5) unstable; urgency=medium - * fix_ftbfs_gcc47.patch: fix ftbfs also on kfreebsd. Thanks to - Steven Chamberlain . (Closes: 672743) + * compile - -- Cristian Greco Sat, 19 May 2012 23:22:28 +0200 + -- Alexander Pozdnyakov Sat, 11 Jun 2016 20:19:38 +0300 -fatrat (1.1.3-4) unstable; urgency=low +fatrat (1.2.0+git20150930-4) unstable; urgency=medium - * fix_ftbfs_gcc47.patch: new patch, add missing includes to fix ftbfs. - Thanks to Sebastian Ramacher . (Closes: #672031) - * debian/rules: enable hardened build flags. (Closes: #671577) + * compile - -- Cristian Greco Sun, 13 May 2012 10:48:43 +0200 + -- Alexander Pozdnyakov Sun, 15 May 2016 12:37:40 +0300 -fatrat (1.1.3-3) unstable; urgency=low +fatrat (1.2.0+git20150930-3) unstable; urgency=medium - * fix_ftbfs_gold_linker.patch: update patch to also explicitly link - against boost.filesystem library. (Closes: #642822) - * debian/control: - - use my @debian.org email address and drop DMUA field. - - explicitly add build-dep on required boost libraries instead - of relying on them being pulled in by libtorrent-rasterbar-dev. + * lintian fix - -- Cristian Greco Sun, 25 Sep 2011 17:32:49 +0200 + -- Alexander Pozdnyakov Sat, 27 Feb 2016 14:28:17 +0300 -fatrat (1.1.3-2) unstable; urgency=low +fatrat (1.2.0+git20150930-2) unstable; urgency=medium - * debian/control: - - add build-dep on libqtwebkit-dev. - - bump up Standards-Version to 3.9.2. - * debian/patches: - - fix_ftbfs_gold_linker.patch: explicitly link against pthreads, dl - and boost.system libraries to avoid FTBFS with the gold linker - (Closes: #615711). - - define_boost_fs_v2.patch: new patch, fix FTBFS with boost1.46 - (Closes: #625795). + * Compile + * Branch: master + * Commit: ccf8d51664d1a9d4a4859e98010917bfb1dc0cdd + * Date: 1443648142 - -- Cristian Greco Tue, 24 May 2011 13:43:11 +0200 + -- Alexander Pozdnyakov Sat, 23 Jan 2016 15:26:52 +0300 -fatrat (1.1.3-1) unstable; urgency=low +fatrat (1.2.0+git20150930-1) unstable; urgency=medium - * New upstream version. - - Fix download issue specific to some 32bit arches (Closes: #587681). - - debian/patches: drop all patches previously cherry-picked upstream. - - debian/copyright: update copyright information about some new files - and translation. - * debian/control: bump up Standards-Version to 3.9.1 (no changes). - * debian/{control,rules}: bump debhelper build-dep to (>= 7.4.10) and - pass to dh in order to enable parallel build support. + * Compile + * Branch: master + * Commit: ccf8d51664d1a9d4a4859e98010917bfb1dc0cdd + * Date: 1443648142 - -- Cristian Greco Fri, 01 Oct 2010 20:54:47 +0200 + -- Alexander Pozdnyakov Sat, 03 Oct 2015 17:44:01 +0300 -fatrat (1.1.2-2) unstable; urgency=low +fatrat (1.2.0+git20150815-1) unstable; urgency=medium - * debian/patches: add the following patches, cherry-picked from upstream: - - 01_rss_fetcher_fix.patch, fix a bug in RSS fetcher. - - 02_trim_rscom_folder_urls.patch, trim RS.com folder URLs. - - 03_fix_dht_crash.patch, fix a crash for DHT fetched torrents. + * Compile + * Branch: master + * Commit: a49cbe6c84b26ea90b6db304ba90af8c353d80f8 + * Date: 1439658775 - -- Cristian Greco Fri, 18 Jun 2010 13:49:38 +0200 + -- Alexander Pozdnyakov Fri, 04 Sep 2015 22:31:59 +0300 -fatrat (1.1.2-1) unstable; urgency=low +fatrat (1.2.0+git20150531-1) unstable; urgency=medium - * New upstream version. - - Support building against gloox 1.x (Closes: #569390). - * debian/copyright: updated with information about french translation. - * debian/control: bump up standards-version to 3.8.4 (no changes). - * debian/patches: drop all patches, merged upstream - (01_fix_sigaction.patch, 02_fix_ftbfs_freebsd.patch). + * Compile + * Branch: master + * Commit: 81bad679ac2b3320ec810e5ac6c544c88150d49e - -- Cristian Greco Fri, 12 Feb 2010 17:59:55 +0100 + -- Alexander Pozdnyakov Sun, 07 Jun 2015 21:45:34 +0300 -fatrat (1.1.1-5) unstable; urgency=low +fatrat (1.1.2+git20100310-1) unstable; urgency=low - * debian/control: fix fatrat-dev package description. - (Closes: #560374) + * Initial release (Closes: #123456) - -- Cristian Greco Thu, 10 Dec 2009 20:27:51 +0100 - -fatrat (1.1.1-4) unstable; urgency=low - - * debian/patches/02_fix_ftbfs_freebsd.patch: new, fix FTBFS on - kFreeBSD. - - -- Cristian Greco Wed, 25 Nov 2009 15:48:39 +0100 - -fatrat (1.1.1-3) unstable; urgency=low - - * Convert to 3.0 (quilt) source format. - * 01_fix_sigaction.patch: new patch, fix FTBFS on most arches. - * debian/changelog: mark 1.1.1-2 as unreleased. - * debian/control: fatrat package depends on libqt4-sql-sqlite. - Closes: #557423 - - -- Cristian Greco Sun, 22 Nov 2009 14:14:36 +0100 - -fatrat (1.1.1-2) UNRELEASED; urgency=low - - * debian/control: - - fix packages description a bit. - - change (build-)dep from libcurl4-openssl-dev to libcurl4-gnutls-dev. - - -- Cristian Greco Wed, 18 Nov 2009 18:35:03 +0100 - -fatrat (1.1.1-1) unstable; urgency=low - - * Initial release (Closes: #495648). - - -- Cristian Greco Mon, 16 Nov 2009 00:30:34 +0100 + -- Alexander Pozdnyakov Thu, 22 Apr 2010 22:32:34 +0400 diff -Nru fatrat-1.2.0~beta2/debian/control fatrat-1.2.0+git20180628/debian/control --- fatrat-1.2.0~beta2/debian/control 2013-10-16 11:57:09.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/control 2019-11-17 06:37:43.000000000 +0000 @@ -1,45 +1,32 @@ Source: fatrat Section: net Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Cristian Greco -Build-Depends: debhelper (>= 7.4.10), - dpkg-dev (>= 1.16.1), - cmake (>= 2.6.0), - libtorrent-rasterbar-dev (>= 0.14.6), - libboost-system-dev, - libboost-filesystem-dev, - libboost-date-time-dev, - libqt4-dev (>= 4.4.0), - libqtwebkit-dev, - qt4-dev-tools (>= 4.4.0), - libgloox-dev (>= 0.9), - libcurl4-gnutls-dev | libcurl-dev, - libpion-net-dev, - default-jdk, - javahelper, - libicu-dev, - libboost-regex-dev, - libboost-signals-dev, - libboost-iostreams-dev, - libboost-thread-dev, - libbz2-dev, - liblog4cpp5-dev -Standards-Version: 3.9.2 -Vcs-Git: git://git.debian.org/git/collab-maint/fatrat.git -Vcs-Browser: http://git.debian.org/?p=collab-maint/fatrat.git -Homepage: http://fatrat.dolezel.info +Maintainer: Alexander Pozdnyakov +Build-Depends: debhelper (>= 7.0.50~), + cmake, + libtorrent-rasterbar-dev, + libboost-date-time-dev, + qtbase5-dev, qttools5-dev-tools, + qttools5-dev, libqt5svg5-dev, + libgloox-dev, + libcurl4-gnutls-dev | libcurl-dev, + libboost-regex-dev, + libboost-signals-dev, + libboost-iostreams-dev, + libbz2-dev, + liblog4cpp5-dev, + libboost-thread-dev, libboost-filesystem-dev, libqt5sql5-sqlite, zlib1g-dev +Standards-Version: 3.9.8 +Homepage: http://fatrat.dolezel.info/ Package: fatrat Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, fatrat-data (= ${source:Version}), - libqt4-sql-sqlite, xdg-utils -Recommends: default-jre Description: multi-protocol download manager, feature rich and extensible via plugin FatRat is a feature rich download manager written in C++ and built on top of - Qt4 library. It supports a lot of download and file exchange protocols and is + Qt5 library. It supports a lot of download and file exchange protocols and is continuously extended. It also includes a plugin system. Most relevant features are: . @@ -65,7 +52,7 @@ Recommends: fatrat Description: data files for fatrat FatRat is a feature rich download manager written in C++ and built on top of - Qt4 library. It supports a lot of download and file exchange protocols and is + Qt5 library. It supports a lot of download and file exchange protocols and is continuously extended. It also includes a plugin system. . This package contains data files for FatRat such as images, help and locales. @@ -73,10 +60,10 @@ Package: fatrat-dev Architecture: all Section: devel -Depends: ${misc:Depends}, libqt4-dev (>= 4.4.0), libcurl4-gnutls-dev +Depends: ${misc:Depends} Description: development files for fatrat FatRat is a feature rich download manager written in C++ and built on top of - Qt4 library. It supports a lot of download and file exchange protocols and is + Qt5 library. It supports a lot of download and file exchange protocols and is continuously extended. It also includes a plugin system. . This package contains FatRat source header files used to compile a plugin or diff -Nru fatrat-1.2.0~beta2/debian/copyright fatrat-1.2.0+git20180628/debian/copyright --- fatrat-1.2.0~beta2/debian/copyright 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/copyright 2018-07-05 18:20:29.000000000 +0000 @@ -9,6 +9,7 @@ Files: debian/* Copyright: 2009, Cristian Greco + 2009-2012, Alexander Pozdnyakov License: GPL-2+ Files: locale/fatrat_cs_CZ.ts diff -Nru fatrat-1.2.0~beta2/debian/docs fatrat-1.2.0+git20180628/debian/docs --- fatrat-1.2.0~beta2/debian/docs 1970-01-01 00:00:00.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/docs 2018-07-05 18:20:29.000000000 +0000 @@ -0,0 +1 @@ +README diff -Nru fatrat-1.2.0~beta2/debian/fatrat-data.links fatrat-1.2.0+git20180628/debian/fatrat-data.links --- fatrat-1.2.0~beta2/debian/fatrat-data.links 1970-01-01 00:00:00.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/fatrat-data.links 2018-07-05 18:20:29.000000000 +0000 @@ -0,0 +1 @@ +/usr/share/common-licenses/GPL-2 usr/share/fatrat/LICENSE \ No newline at end of file diff -Nru fatrat-1.2.0~beta2/debian/fatrat-data.lintian-overrides fatrat-1.2.0+git20180628/debian/fatrat-data.lintian-overrides --- fatrat-1.2.0~beta2/debian/fatrat-data.lintian-overrides 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/fatrat-data.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -# the extra LICENSE file is shown in About menu dialog. -fatrat-data: extra-license-file usr/share/fatrat/LICENSE diff -Nru fatrat-1.2.0~beta2/debian/fatrat.menu fatrat-1.2.0+git20180628/debian/fatrat.menu --- fatrat-1.2.0~beta2/debian/fatrat.menu 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/fatrat.menu 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -?package(fatrat): \ - needs="X11" \ - section="Applications/Network/File Transfer" \ - title="fatrat" \ - command="/usr/bin/fatrat" \ - icon="/usr/share/pixmaps/fatrat.xpm" \ - longtitle="FatRat download manager" diff -Nru fatrat-1.2.0~beta2/debian/patches/disable_tray_icon.patch fatrat-1.2.0+git20180628/debian/patches/disable_tray_icon.patch --- fatrat-1.2.0~beta2/debian/patches/disable_tray_icon.patch 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/patches/disable_tray_icon.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -Description: Disable tray icon by default. - In Unity, with upstream defaults, when you close fatrat it is minimized - to the tray. Mouse clicks on the tray in Unity only display the menu, which - is empty, so fatrat can not be reopened or quit. -Author: Andrew Starr-Bochicchio -Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/fatrat/+bug/1033762 -Forwarded: not-needed - ---- fatrat-1.2.0~beta2.orig/data/defaults.conf -+++ fatrat-1.2.0~beta2/data/defaults.conf -@@ -1,8 +1,8 @@ - [General] - fileexec=xdg-open --trayicon=true -+trayicon=false - hideminimize=false --hideclose=true -+hideclose=false - retrycount=0 - retryworking=true - showpopup=true diff -Nru fatrat-1.2.0~beta2/debian/patches/find_correct_jvm.patch fatrat-1.2.0+git20180628/debian/patches/find_correct_jvm.patch --- fatrat-1.2.0~beta2/debian/patches/find_correct_jvm.patch 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/patches/find_correct_jvm.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -Description: Patch findjvm.sh so that we find a usable jvm. - The upstream script simply takes the first jvm found. On 12.10 with - default-jre this is "cacao" which crashes fatrat on start up. Manual testing - shows that only "server" seems to allow fatrat to work. -Author: Andrew Starr-Bochicchio -Bug-Ubuntu: https://launchpad.net/bugs/1035965 - ---- fatrat-1.2.0~beta2.orig/data/java/findjvm.sh -+++ fatrat-1.2.0~beta2/data/java/findjvm.sh -@@ -14,7 +14,7 @@ if [ ! "$JAVA_HOME" ]; then - JAVA_HOME="$(java -cp "$(_dirname $0)/fatrat-jplugins.jar" info.dolezel.fatrat.plugins.helpers.GetJavaHome)" - fi - --libjvm=$(find -L "$JAVA_HOME" -name libjvm.so | head -n1) -+libjvm=$(find -L "$JAVA_HOME" -name libjvm.so | grep "server" | head -n1) - - if [ "x$libjvm" = "x" ]; then - exit 2 diff -Nru fatrat-1.2.0~beta2/debian/patches/fix_ftbfs_find_config.h.patch fatrat-1.2.0+git20180628/debian/patches/fix_ftbfs_find_config.h.patch --- fatrat-1.2.0~beta2/debian/patches/fix_ftbfs_find_config.h.patch 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/patches/fix_ftbfs_find_config.h.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -Description: Patch CMakeLists.txt in order to find and install config.h - Only config.h.in exists in CMAKE_CURRENT_SOURCE_DIR, the generated file issue - in CMAKE_CURRENT_BINARY_DIR. -Author: Andrew Starr-Bochicchio - ---- fatrat-1.2.0~beta2.orig/CMakeLists.txt -+++ fatrat-1.2.0~beta2/CMakeLists.txt -@@ -577,7 +577,7 @@ target_link_libraries(fatrat-conf ${QT_L - - set(fatrat_DEV_HEADERS - ${CMAKE_CURRENT_SOURCE_DIR}/src/fatrat.h -- ${CMAKE_CURRENT_SOURCE_DIR}/config.h -+ ${CMAKE_CURRENT_BINARY_DIR}/config.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/DelayedIcon.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/AppTools.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/Transfer.h diff -Nru fatrat-1.2.0~beta2/debian/patches/fix_ftbfs_gcc47.patch fatrat-1.2.0+git20180628/debian/patches/fix_ftbfs_gcc47.patch --- fatrat-1.2.0~beta2/debian/patches/fix_ftbfs_gcc47.patch 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/patches/fix_ftbfs_gcc47.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -Description: Fix build with gcc 4.7, add missing includes. -Origin: vendor -Forwarded: not-needed -Author: Sebastian Ramacher , Steven Chamberlain - -Index: fatrat/src/poller/KqueuePoller.cpp -=================================================================== ---- fatrat.orig/src/poller/KqueuePoller.cpp 2012-08-11 13:06:32.000000000 -0400 -+++ fatrat/src/poller/KqueuePoller.cpp 2012-08-11 13:32:51.589108092 -0400 -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - - KqueuePoller::KqueuePoller(QObject* parent) - : Poller(parent) -Index: fatrat/src/engines/CurlDownload.cpp -=================================================================== ---- fatrat.orig/src/engines/CurlDownload.cpp 2012-08-11 13:25:11.000000000 -0400 -+++ fatrat/src/engines/CurlDownload.cpp 2012-08-11 13:32:51.589108092 -0400 -@@ -49,6 +49,7 @@ - #include - #include - #include -+#include - #include - - #ifdef WITH_BITTORRENT diff -Nru fatrat-1.2.0~beta2/debian/patches/fix_ftbfs_gold_linker.patch fatrat-1.2.0+git20180628/debian/patches/fix_ftbfs_gold_linker.patch --- fatrat-1.2.0~beta2/debian/patches/fix_ftbfs_gold_linker.patch 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/patches/fix_ftbfs_gold_linker.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -Description: explicitly link against the following libraries to avoid FTBFS -with gold linker or ld --no-add-needed: pthread, dl, boost.system and -boost.filesystem. -Author: Cristian Greco - -Index: fatrat/CMakeLists.txt -=================================================================== ---- fatrat.orig/CMakeLists.txt 2012-08-11 13:25:11.000000000 -0400 -+++ fatrat/CMakeLists.txt 2012-08-11 13:29:54.635307792 -0400 -@@ -71,7 +71,7 @@ - - SET(Boost_USE_MULTITHREAD ON) - SET(Boost_USE_STATIC_LIBS OFF) -- find_package(Boost COMPONENTS date_time REQUIRED) -+ find_package(Boost COMPONENTS date_time system filesystem REQUIRED) - - if(Boost_FOUND) - message(STATUS "boost-datetime found OK") -@@ -572,7 +572,7 @@ - # This used to be a workaround until it started causing the exact opposite... oh dear! - #STRING(REPLACE "-mt" "" pion-net_LIBRARIES "${pion-net_LIBRARIES}") - #message(STATUS ${pion-net_LIBRARIES}) --target_link_libraries(fatrat -ldl -lpthread ${QT_LIBRARIES} ${libtorrent_LDFLAGS} ${gloox_LDFLAGS} ${curl_LDFLAGS} ${Boost_LIBRARIES} ${pion-net_LIBRARIES} ${QT_ADDITIONAL_LIBS} ${XATTR_LIBRARIES} -export-dynamic) -+target_link_libraries(fatrat -ldl -lpthread ${QT_LIBRARIES} ${libtorrent_LDFLAGS} ${gloox_LDFLAGS} ${curl_LDFLAGS} ${Boost_LIBRARIES} ${pion-net_LIBRARIES} ${QT_ADDITIONAL_LIBS} ${XATTR_LIBRARIES} -lpthread -ldl -export-dynamic) - target_link_libraries(fatrat-conf ${QT_LIBRARIES}) - - set(fatrat_DEV_HEADERS diff -Nru fatrat-1.2.0~beta2/debian/patches/install_statictransfermessage.patch fatrat-1.2.0+git20180628/debian/patches/install_statictransfermessage.patch --- fatrat-1.2.0~beta2/debian/patches/install_statictransfermessage.patch 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/patches/install_statictransfermessage.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -Description: Install StaticTransferMessage.h, since CurlDownload.h includes it -Author: Colin Watson -Forwarded: yes -Last-Update: 2012-10-03 - -Index: b/CMakeLists.txt -=================================================================== ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -596,6 +596,7 @@ - ${CMAKE_CURRENT_SOURCE_DIR}/src/engines/CurlUser.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/engines/CurlPoller.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/engines/CurlStat.h -+ ${CMAKE_CURRENT_SOURCE_DIR}/src/engines/StaticTransferMessage.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/engines/UrlClient.h - ) - diff -Nru fatrat-1.2.0~beta2/debian/patches/series fatrat-1.2.0+git20180628/debian/patches/series --- fatrat-1.2.0~beta2/debian/patches/series 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -fix_ftbfs_gold_linker.patch -fix_ftbfs_gcc47.patch -fix_ftbfs_find_config.h.patch -disable_tray_icon.patch -find_correct_jvm.patch -install_statictransfermessage.patch diff -Nru fatrat-1.2.0~beta2/debian/rules fatrat-1.2.0+git20180628/debian/rules --- fatrat-1.2.0~beta2/debian/rules 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/rules 2019-11-17 07:28:19.000000000 +0000 @@ -1,23 +1,40 @@ #!/usr/bin/make -f +export DH_VERBOSE=1 -DPKG_EXPORT_BUILDFLAGS = 1 -export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -include /usr/share/dpkg/buildflags.mk -include /usr/share/javahelper/java-vars.mk - -# cmake workarounds -CFLAGS+=$(CPPFLAGS) -CXXFLAGS+=$(CPPFLAGS) -DEB_CMAKE_EXE_LINKER_FLAGS=$(LDFLAGS) +#export DH_ALWAYS_EXCLUDE := LICENSE +DEBIAN_CODENAME = $(shell echo $$DIST) +ifeq "$(DEBIAN_CODENAME)" "" + DEBIAN_CODENAME = $(shell dpkg-parsechangelog | awk '/^Distribution: / {print $$2}') +endif + +ifneq (,$(filter $(DEBIAN_CODENAME),jessie trusty xenial)) + BITTORRENT=OFF +else + BITTORRENT=ON +endif + + +CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) +CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS) +LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed + +export QT_SELECT=qt5 %: - dh $@ --parallel + dh --parallel $@ override_dh_auto_configure: - dh_auto_configure -- -DWITH_EVERYTHING=ON \ - -DCMAKE_EXE_LINKER_FLAGS="$(DEB_CMAKE_EXE_LINKER_FLAGS)" + dh_auto_configure -- -DWITH_BITTORRENT=$(BITTORRENT) \ + -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)" \ + -DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS)" \ + -DCMAKE_CXX_FLAGS="$(CXXFLAGS)"\ + -DWITH_NLS=ON -DWITH_CURL=ON -DWITH_JABBER=ON \ + -DWITH_DOCUMENTATION=ON -DWITH_WEBINTERFACE=OFF + cp $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)/config.h $(CURDIR)/config.h + +#override_dh_builddeb: +# dh_builddeb -- -Zxz -z9 + + -override_dh_auto_clean: - rm -f doc/fatrat.qch doc/fatrat.qhc - dh_auto_clean diff -Nru fatrat-1.2.0~beta2/debian/watch fatrat-1.2.0+git20180628/debian/watch --- fatrat-1.2.0~beta2/debian/watch 2013-01-27 18:44:51.000000000 +0000 +++ fatrat-1.2.0+git20180628/debian/watch 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -version=3 -http://www.dolezel.info/download/data/fatrat/fatrat-(.*)\.tar\.(gz|xz) diff -Nru fatrat-1.2.0~beta2/INSTALL fatrat-1.2.0+git20180628/INSTALL --- fatrat-1.2.0~beta2/INSTALL 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/INSTALL 2018-07-05 18:20:27.000000000 +0000 @@ -1,4 +1,4 @@ -FatRat uses the CMake build system, just like KDE 4. +FatRat uses the CMake build system. An example compilation procedure: diff -Nru fatrat-1.2.0~beta2/LICENSE fatrat-1.2.0+git20180628/LICENSE --- fatrat-1.2.0~beta2/LICENSE 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/LICENSE 2018-07-05 18:20:27.000000000 +0000 @@ -1,295 +1,622 @@ -FatRat is licensed under the GNU General Public License version 2 with -the addition of the following special exception: - ------ - -In addition, as a special exemption, Luboš Doležel gives permission -to link the code of FatRat with the OpenSSL project's -"OpenSSL" library (or with modified versions of it that use the same -license as the "OpenSSL" library), and distribute the linked -executables. You must obey the GNU General Public License in all -respects for all of the code used other than "OpenSSL". - ------ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + Version 3, 29 June 2007 - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (C) 2007 Free Software Foundation, Inc. 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 + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. 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. +them 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 prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. 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. +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. 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. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + TERMS AND CONDITIONS + + 0. Definitions. - 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" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey 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; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of 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 + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If 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. +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions 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 + The Free Software Foundation may publish revised and/or new versions of +the GNU 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. + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + 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. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +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. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. END OF TERMS AND CONDITIONS @@ -301,15 +628,15 @@ 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 +state 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 + 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 + the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -317,37 +644,31 @@ 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. + You should have received a copy of the GNU General Public License + along with this program. If not, see . 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: + If the program does terminal interaction, 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'. + Copyright (C) + This program 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. +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU 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. But first, please read +. diff -Nru fatrat-1.2.0~beta2/README fatrat-1.2.0+git20180628/README --- fatrat-1.2.0~beta2/README 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/README 2018-07-05 18:20:27.000000000 +0000 @@ -1,6 +1,6 @@ -FatRat is an open source download manager for Linux written in C++ and built on top of the Trolltech Qt 4 library. +FatRat is an open source download manager for Linux written in C++ and built on top of the Qt 5 library. -Copyright © 2006-2010 Luboš Doležel +Copyright © 2006-2015 Luboš Doležel === GRAPHICS === diff -Nru fatrat-1.2.0~beta2/src/AboutDlg.cpp fatrat-1.2.0+git20180628/src/AboutDlg.cpp --- fatrat-1.2.0~beta2/src/AboutDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/AboutDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/AboutDlg.h fatrat-1.2.0+git20180628/src/AboutDlg.h --- fatrat-1.2.0~beta2/src/AboutDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/AboutDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/AppTools.cpp fatrat-1.2.0+git20180628/src/AppTools.cpp --- fatrat-1.2.0~beta2/src/AppTools.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/AppTools.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -31,7 +30,9 @@ #include "AppTools.h" #ifdef WITH_BITTORRENT -# include "tools/TorrentSearch.h" +# ifdef HAVE_WEBENGINE +# include "tools/TorrentSearch.h" +# endif # include "tools/CreateTorrentDlg.h" #endif #ifdef WITH_JPLUGINS @@ -45,7 +46,9 @@ void initAppTools() { #ifdef WITH_BITTORRENT +# ifdef HAVE_WEBENGINE g_tools << AppTool(QObject::tr("Torrent search"), TorrentSearch::create); +# endif g_tools << AppTool(QObject::tr("Create a torrent"), CreateTorrentDlg::create); #endif g_tools << AppTool(QObject::tr("File hasher"), HashDlg::create); diff -Nru fatrat-1.2.0~beta2/src/AppTools.h fatrat-1.2.0+git20180628/src/AppTools.h --- fatrat-1.2.0~beta2/src/AppTools.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/AppTools.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Auth.cpp fatrat-1.2.0+git20180628/src/Auth.cpp --- fatrat-1.2.0~beta2/src/Auth.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Auth.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Auth.h fatrat-1.2.0+git20180628/src/Auth.h --- fatrat-1.2.0~beta2/src/Auth.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Auth.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/AutoActionForm.h fatrat-1.2.0+git20180628/src/AutoActionForm.h --- fatrat-1.2.0~beta2/src/AutoActionForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/AutoActionForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/captcha/Captcha.cpp fatrat-1.2.0+git20180628/src/captcha/Captcha.cpp --- fatrat-1.2.0~beta2/src/captcha/Captcha.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/captcha/Captcha.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/captcha/Captcha.h fatrat-1.2.0+git20180628/src/captcha/Captcha.h --- fatrat-1.2.0~beta2/src/captcha/Captcha.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/captcha/Captcha.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/captcha/CaptchaHttp.cpp fatrat-1.2.0+git20180628/src/captcha/CaptchaHttp.cpp --- fatrat-1.2.0~beta2/src/captcha/CaptchaHttp.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/captcha/CaptchaHttp.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/captcha/CaptchaHttp.h fatrat-1.2.0+git20180628/src/captcha/CaptchaHttp.h --- fatrat-1.2.0~beta2/src/captcha/CaptchaHttp.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/captcha/CaptchaHttp.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -28,6 +27,7 @@ #ifndef CAPTCHAHTTP_H #define CAPTCHAHTTP_H #include "Captcha.h" +#include #include #include #include diff -Nru fatrat-1.2.0~beta2/src/captcha/CaptchaQt.cpp fatrat-1.2.0+git20180628/src/captcha/CaptchaQt.cpp --- fatrat-1.2.0~beta2/src/captcha/CaptchaQt.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/captcha/CaptchaQt.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/captcha/CaptchaQtDlg.cpp fatrat-1.2.0+git20180628/src/captcha/CaptchaQtDlg.cpp --- fatrat-1.2.0~beta2/src/captcha/CaptchaQtDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/captcha/CaptchaQtDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/captcha/CaptchaQtDlg.h fatrat-1.2.0+git20180628/src/captcha/CaptchaQtDlg.h --- fatrat-1.2.0~beta2/src/captcha/CaptchaQtDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/captcha/CaptchaQtDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/captcha/CaptchaQt.h fatrat-1.2.0+git20180628/src/captcha/CaptchaQt.h --- fatrat-1.2.0~beta2/src/captcha/CaptchaQt.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/captcha/CaptchaQt.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/ClickableLabel.h fatrat-1.2.0+git20180628/src/ClickableLabel.h --- fatrat-1.2.0~beta2/src/ClickableLabel.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/ClickableLabel.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/ClipboardMonitor.cpp fatrat-1.2.0+git20180628/src/ClipboardMonitor.cpp --- fatrat-1.2.0~beta2/src/ClipboardMonitor.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/ClipboardMonitor.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/ClipboardMonitor.h fatrat-1.2.0+git20180628/src/ClipboardMonitor.h --- fatrat-1.2.0~beta2/src/ClipboardMonitor.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/ClipboardMonitor.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/CommentForm.h fatrat-1.2.0+git20180628/src/CommentForm.h --- fatrat-1.2.0~beta2/src/CommentForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/CommentForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/dbus/DbusAdaptor.cpp fatrat-1.2.0+git20180628/src/dbus/DbusAdaptor.cpp --- fatrat-1.2.0~beta2/src/dbus/DbusAdaptor.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/dbus/DbusAdaptor.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/dbus/DbusAdaptor.h fatrat-1.2.0+git20180628/src/dbus/DbusAdaptor.h --- fatrat-1.2.0~beta2/src/dbus/DbusAdaptor.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/dbus/DbusAdaptor.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/dbus/DbusImpl.cpp fatrat-1.2.0+git20180628/src/dbus/DbusImpl.cpp --- fatrat-1.2.0~beta2/src/dbus/DbusImpl.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/dbus/DbusImpl.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/dbus/DbusImpl.h fatrat-1.2.0+git20180628/src/dbus/DbusImpl.h --- fatrat-1.2.0~beta2/src/dbus/DbusImpl.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/dbus/DbusImpl.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/DelayedIcon.cpp fatrat-1.2.0+git20180628/src/DelayedIcon.cpp --- fatrat-1.2.0~beta2/src/DelayedIcon.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/DelayedIcon.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/DelayedIcon.h fatrat-1.2.0+git20180628/src/DelayedIcon.h --- fatrat-1.2.0~beta2/src/DelayedIcon.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/DelayedIcon.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/DropBox.cpp fatrat-1.2.0+git20180628/src/DropBox.cpp --- fatrat-1.2.0~beta2/src/DropBox.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/DropBox.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/DropBox.h fatrat-1.2.0+git20180628/src/DropBox.h --- fatrat-1.2.0~beta2/src/DropBox.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/DropBox.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/CurlDownload.cpp fatrat-1.2.0+git20180628/src/engines/CurlDownload.cpp --- fatrat-1.2.0~beta2/src/engines/CurlDownload.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlDownload.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -54,6 +53,9 @@ #ifdef WITH_BITTORRENT # include "TorrentDownload.h" #endif +#ifndef POSIX_LINUX +# define O_LARGEFILE 0 +#endif static const QColor g_colors[] = { Qt::red, Qt::green, Qt::blue, Qt::cyan, Qt::magenta, Qt::yellow, Qt::darkRed, Qt::darkGreen, Qt::darkBlue, Qt::darkCyan, Qt::darkMagenta, Qt::darkYellow }; @@ -519,7 +521,7 @@ //sub.setAttribute("id", QString::number(i)); const UrlClient::UrlObject& url = m_urls[i]; - setXMLProperty(doc, sub, "address", QString(url.url.toEncoded())); + setXMLProperty(doc, sub, "address", QString(url.url.toString())); setXMLProperty(doc, sub, "effective", QString(url.effective.toEncoded())); setXMLProperty(doc, sub, "referrer", url.strReferrer); setXMLProperty(doc, sub, "proxy", url.proxy.toString()); diff -Nru fatrat-1.2.0~beta2/src/engines/CurlDownload.h fatrat-1.2.0+git20180628/src/engines/CurlDownload.h --- fatrat-1.2.0~beta2/src/engines/CurlDownload.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlDownload.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/CurlPoller.cpp fatrat-1.2.0+git20180628/src/engines/CurlPoller.cpp --- fatrat-1.2.0~beta2/src/engines/CurlPoller.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlPoller.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/CurlPoller.h fatrat-1.2.0+git20180628/src/engines/CurlPoller.h --- fatrat-1.2.0~beta2/src/engines/CurlPoller.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlPoller.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/CurlPollingMaster.cpp fatrat-1.2.0+git20180628/src/engines/CurlPollingMaster.cpp --- fatrat-1.2.0~beta2/src/engines/CurlPollingMaster.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlPollingMaster.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/CurlPollingMaster.h fatrat-1.2.0+git20180628/src/engines/CurlPollingMaster.h --- fatrat-1.2.0~beta2/src/engines/CurlPollingMaster.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlPollingMaster.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/CurlStat.cpp fatrat-1.2.0+git20180628/src/engines/CurlStat.cpp --- fatrat-1.2.0~beta2/src/engines/CurlStat.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlStat.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/CurlStat.h fatrat-1.2.0+git20180628/src/engines/CurlStat.h --- fatrat-1.2.0~beta2/src/engines/CurlStat.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlStat.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/CurlUpload.cpp fatrat-1.2.0+git20180628/src/engines/CurlUpload.cpp --- fatrat-1.2.0~beta2/src/engines/CurlUpload.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlUpload.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/CurlUpload.h fatrat-1.2.0+git20180628/src/engines/CurlUpload.h --- fatrat-1.2.0~beta2/src/engines/CurlUpload.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlUpload.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/CurlUser.cpp fatrat-1.2.0+git20180628/src/engines/CurlUser.cpp --- fatrat-1.2.0~beta2/src/engines/CurlUser.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlUser.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . */ #include "CurlUser.h" diff -Nru fatrat-1.2.0~beta2/src/engines/CurlUser.h fatrat-1.2.0+git20180628/src/engines/CurlUser.h --- fatrat-1.2.0~beta2/src/engines/CurlUser.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/CurlUser.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . */ diff -Nru fatrat-1.2.0~beta2/src/engines/ExtensionDownloadDlg.cpp fatrat-1.2.0+git20180628/src/engines/ExtensionDownloadDlg.cpp --- fatrat-1.2.0~beta2/src/engines/ExtensionDownloadDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/ExtensionDownloadDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/ExtensionDownloadDlg.h fatrat-1.2.0+git20180628/src/engines/ExtensionDownloadDlg.h --- fatrat-1.2.0~beta2/src/engines/ExtensionDownloadDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/ExtensionDownloadDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/FakeDownload.h fatrat-1.2.0+git20180628/src/engines/FakeDownload.h --- fatrat-1.2.0~beta2/src/engines/FakeDownload.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/FakeDownload.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/GeneralDownloadForms.cpp fatrat-1.2.0+git20180628/src/engines/GeneralDownloadForms.cpp --- fatrat-1.2.0~beta2/src/engines/GeneralDownloadForms.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/GeneralDownloadForms.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/GeneralDownloadForms.h fatrat-1.2.0+git20180628/src/engines/GeneralDownloadForms.h --- fatrat-1.2.0~beta2/src/engines/GeneralDownloadForms.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/GeneralDownloadForms.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/HttpDetailsBar.cpp fatrat-1.2.0+git20180628/src/engines/HttpDetailsBar.cpp --- fatrat-1.2.0~beta2/src/engines/HttpDetailsBar.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/HttpDetailsBar.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/HttpDetailsBar.h fatrat-1.2.0+git20180628/src/engines/HttpDetailsBar.h --- fatrat-1.2.0~beta2/src/engines/HttpDetailsBar.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/HttpDetailsBar.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/HttpDetails.cpp fatrat-1.2.0+git20180628/src/engines/HttpDetails.cpp --- fatrat-1.2.0~beta2/src/engines/HttpDetails.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/HttpDetails.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -95,8 +94,12 @@ UrlClient::UrlObject obj; obj.url = dlg.m_strURL; - obj.url.setUserName(dlg.m_strUser); - obj.url.setPassword(dlg.m_strPassword); + + if (!dlg.m_strUser.isEmpty()) + { + obj.url.setUserName(dlg.m_strUser); + obj.url.setPassword(dlg.m_strPassword); + } obj.strReferrer = dlg.m_strReferrer; obj.ftpMode = dlg.m_ftpMode; obj.proxy = dlg.m_proxy; @@ -127,8 +130,12 @@ if(dlg.exec() == QDialog::Accepted) { obj.url = dlg.m_strURL; - obj.url.setUserName(dlg.m_strUser); - obj.url.setPassword(dlg.m_strPassword); + + if (!dlg.m_strUser.isEmpty()) + { + obj.url.setUserName(dlg.m_strUser); + obj.url.setPassword(dlg.m_strPassword); + } obj.strReferrer = dlg.m_strReferrer; obj.ftpMode = dlg.m_ftpMode; obj.proxy = dlg.m_proxy; @@ -217,9 +224,11 @@ if (!s.client || s.urlIndex < 0) continue; QTreeWidgetItem* item; - QString url = m_download->m_urls[s.urlIndex].url.toString(); + QUrl url = m_download->m_urls[s.urlIndex].url; GradientWidget* gradient; + url.setUserInfo(QString()); + if (j < treeActiveSegments->topLevelItemCount()) item = treeActiveSegments->topLevelItem(j); else @@ -229,7 +238,7 @@ } item->setData(0, Qt::UserRole, s.urlIndex); item->setData(1, Qt::UserRole, i); - item->setText(0, url); + item->setText(0, url.toString()); gradient = static_cast(treeActiveSegments->itemWidget(item, 1)); if (!gradient) @@ -274,7 +283,9 @@ { int urlIndex = m_download->m_listActiveSegments[i]; QTreeWidgetItem* item; - QString url = m_download->m_urls[urlIndex].url.toString(); // TODO - this is a point of crash due to subclassing issues + QUrl url = m_download->m_urls[urlIndex].url; // TODO - this is a point of crash due to subclassing issues + + url.setUserInfo(QString()); if (i < treeActiveSegments->topLevelItemCount()) item = treeActiveSegments->topLevelItem(i); @@ -284,7 +295,7 @@ treeActiveSegments->addTopLevelItem(item); } item->setData(0, Qt::UserRole, urlIndex); - item->setText(0, url); + item->setText(0, url.toString()); treeActiveSegments->removeItemWidget(item, 1); item->setText(2, QString()); item->setText(3, QString()); @@ -298,7 +309,7 @@ for (int i=0;im_urls.size();i++) { - QString url = m_download->m_urls[i].url.toString(); + QUrl url = m_download->m_urls[i].url; QListWidgetItem* item; if (i < listUrls->count()) @@ -308,7 +319,9 @@ item = new QListWidgetItem(listUrls); listUrls->addItem(item); } - item->setText(url); + + url.setUserInfo(QString()); + item->setText(url.toString()); } int count; while ( (count = listUrls->count()) > m_download->m_urls.size()) @@ -316,8 +329,13 @@ for (int i=0;im_urls.size();i++) { - QString url = m_download->m_urls[i].url.toString(); + QUrl temp = m_download->m_urls[i].url; + QString url; QAction* a; + + temp.setUserInfo(QString()); + url = temp.toString(); + if(url.size() > 50) { url.resize(47); diff -Nru fatrat-1.2.0~beta2/src/engines/HttpDetails.h fatrat-1.2.0+git20180628/src/engines/HttpDetails.h --- fatrat-1.2.0~beta2/src/engines/HttpDetails.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/HttpDetails.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/HttpFtpSettings.cpp fatrat-1.2.0+git20180628/src/engines/HttpFtpSettings.cpp --- fatrat-1.2.0~beta2/src/engines/HttpFtpSettings.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/HttpFtpSettings.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/HttpFtpSettings.h fatrat-1.2.0+git20180628/src/engines/HttpFtpSettings.h --- fatrat-1.2.0~beta2/src/engines/HttpFtpSettings.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/HttpFtpSettings.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/HttpMirrorsDlg.cpp fatrat-1.2.0+git20180628/src/engines/HttpMirrorsDlg.cpp --- fatrat-1.2.0~beta2/src/engines/HttpMirrorsDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/HttpMirrorsDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/HttpMirrorsDlg.h fatrat-1.2.0+git20180628/src/engines/HttpMirrorsDlg.h --- fatrat-1.2.0~beta2/src/engines/HttpMirrorsDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/HttpMirrorsDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/JavaAccountStatusWidget.cpp fatrat-1.2.0+git20180628/src/engines/JavaAccountStatusWidget.cpp --- fatrat-1.2.0~beta2/src/engines/JavaAccountStatusWidget.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/JavaAccountStatusWidget.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/JavaAccountStatusWidget.h fatrat-1.2.0+git20180628/src/engines/JavaAccountStatusWidget.h --- fatrat-1.2.0~beta2/src/engines/JavaAccountStatusWidget.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/JavaAccountStatusWidget.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/JavaDownload.cpp fatrat-1.2.0+git20180628/src/engines/JavaDownload.cpp --- fatrat-1.2.0~beta2/src/engines/JavaDownload.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/JavaDownload.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/JavaDownload.h fatrat-1.2.0+git20180628/src/engines/JavaDownload.h --- fatrat-1.2.0~beta2/src/engines/JavaDownload.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/JavaDownload.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/JavaExtractor.cpp fatrat-1.2.0+git20180628/src/engines/JavaExtractor.cpp --- fatrat-1.2.0~beta2/src/engines/JavaExtractor.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/JavaExtractor.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/JavaExtractor.h fatrat-1.2.0+git20180628/src/engines/JavaExtractor.h --- fatrat-1.2.0~beta2/src/engines/JavaExtractor.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/JavaExtractor.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/JavaPersistentVariables.cpp fatrat-1.2.0+git20180628/src/engines/JavaPersistentVariables.cpp --- fatrat-1.2.0~beta2/src/engines/JavaPersistentVariables.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/JavaPersistentVariables.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/JavaPersistentVariables.h fatrat-1.2.0+git20180628/src/engines/JavaPersistentVariables.h --- fatrat-1.2.0~beta2/src/engines/JavaPersistentVariables.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/JavaPersistentVariables.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/JavaUpload.cpp fatrat-1.2.0+git20180628/src/engines/JavaUpload.cpp --- fatrat-1.2.0~beta2/src/engines/JavaUpload.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/JavaUpload.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/JavaUpload.h fatrat-1.2.0+git20180628/src/engines/JavaUpload.h --- fatrat-1.2.0~beta2/src/engines/JavaUpload.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/JavaUpload.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/MetalinkDownload.cpp fatrat-1.2.0+git20180628/src/engines/MetalinkDownload.cpp --- fatrat-1.2.0~beta2/src/engines/MetalinkDownload.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/MetalinkDownload.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/MetalinkDownload.h fatrat-1.2.0+git20180628/src/engines/MetalinkDownload.h --- fatrat-1.2.0~beta2/src/engines/MetalinkDownload.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/MetalinkDownload.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/MetalinkSettings.cpp fatrat-1.2.0+git20180628/src/engines/MetalinkSettings.cpp --- fatrat-1.2.0~beta2/src/engines/MetalinkSettings.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/MetalinkSettings.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/MetalinkSettings.h fatrat-1.2.0+git20180628/src/engines/MetalinkSettings.h --- fatrat-1.2.0~beta2/src/engines/MetalinkSettings.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/MetalinkSettings.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/PlaceholderTransfer.cpp fatrat-1.2.0+git20180628/src/engines/PlaceholderTransfer.cpp --- fatrat-1.2.0~beta2/src/engines/PlaceholderTransfer.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/PlaceholderTransfer.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/PlaceholderTransfer.h fatrat-1.2.0+git20180628/src/engines/PlaceholderTransfer.h --- fatrat-1.2.0~beta2/src/engines/PlaceholderTransfer.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/PlaceholderTransfer.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/SettingsJavaPluginForm.cpp fatrat-1.2.0+git20180628/src/engines/SettingsJavaPluginForm.cpp --- fatrat-1.2.0~beta2/src/engines/SettingsJavaPluginForm.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/SettingsJavaPluginForm.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/SettingsJavaPluginForm.h fatrat-1.2.0+git20180628/src/engines/SettingsJavaPluginForm.h --- fatrat-1.2.0~beta2/src/engines/SettingsJavaPluginForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/SettingsJavaPluginForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/StaticTransferMessage.h fatrat-1.2.0+git20180628/src/engines/StaticTransferMessage.h --- fatrat-1.2.0~beta2/src/engines/StaticTransferMessage.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/StaticTransferMessage.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . */ #ifndef STATICTRANSFERMESSAGE_H diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentDetails.cpp fatrat-1.2.0+git20180628/src/engines/TorrentDetails.cpp --- fatrat-1.2.0~beta2/src/engines/TorrentDetails.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentDetails.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -39,7 +38,7 @@ #include #include #include - +#include TorrentDetails::TorrentDetails(QWidget* me, TorrentDownload* obj) : m_download(obj), m_bFilled(false) @@ -141,7 +140,7 @@ if(row != -1) { const libtorrent::peer_info& info = m_pPeersModel->m_peers[row]; - QMessageBox::information(treePeers, "FatRat", QString("Load balancing: %1").arg(info.load_balancing)); + QMessageBox::information(treePeers, "FatRat", QString("Reciprocion rate: %1").arg(info.estimated_reciprocation_rate)); } } @@ -213,8 +212,8 @@ fill(); // GENERAL - boost::posix_time::time_duration& next = m_download->m_status.next_announce; - boost::posix_time::time_duration& intv = m_download->m_status.announce_interval; + int next = std::chrono::duration_cast(m_download->m_status.next_announce).count(); + int intv = std::chrono::duration_cast(m_download->m_status.announce_interval).count(); // availability QPalette palette = QApplication::palette(lineAvailability); @@ -230,8 +229,8 @@ lineTracker->setText(tr("%1 (refresh in %2:%3:%4, every %5:%6:%7)") .arg(m_download->m_status.current_tracker.c_str()) - .arg(next.hours()).arg(next.minutes(),2,10,QChar('0')).arg(next.seconds(),2,10,QChar('0')) - .arg(intv.hours()).arg(intv.minutes(),2,10,QChar('0')).arg(intv.seconds(),2,10,QChar('0'))); + .arg(next / 3600).arg(next / 60,2,10,QChar('0')).arg(next % 60,2,10,QChar('0')) + .arg(intv / 3600).arg(intv / 60,2,10,QChar('0')).arg(intv % 60,2,10,QChar('0'))); libtorrent::bitfield pieces = m_download->m_status.pieces; diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentDetails.h fatrat-1.2.0+git20180628/src/engines/TorrentDetails.h --- fatrat-1.2.0~beta2/src/engines/TorrentDetails.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentDetails.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentDownload.cpp fatrat-1.2.0+git20180628/src/engines/TorrentDownload.cpp --- fatrat-1.2.0~beta2/src/engines/TorrentDownload.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentDownload.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -45,10 +44,13 @@ #include #include #include +#include +#include +#include +#include #include #include -#include #include #include @@ -188,7 +190,9 @@ if(getSettingsValue("torrent/pex").toBool()) m_session->add_extension(&libtorrent::create_ut_pex_plugin); - m_session->add_extension(&libtorrent::create_metadata_plugin); + + // Deprecated. The replacement is added by default. + // m_session->add_extension(&libtorrent::create_metadata_plugin); m_session->add_extension(&libtorrent::create_ut_metadata_plugin); m_session->add_extension(&libtorrent::create_smart_ban_plugin); @@ -352,7 +356,7 @@ settings.cache_size = getSettingsValue("torrent/cache_size").toInt(); settings.disk_io_write_mode = getSettingsValue("torrent/disk_io_write_mode").toInt(); settings.disk_io_read_mode = getSettingsValue("torrent/disk_io_read_mode").toInt(); - + QString external_ip = getSettingsValue("torrent/external_ip").toString(); if(!external_ip.isEmpty()) settings.announce_ip = external_ip.toStdString(); @@ -469,12 +473,14 @@ { if(m_handle.is_valid()) { - std::string str = m_handle.name(); + libtorrent::torrent_status st; + + st = m_handle.status(libtorrent::torrent_handle::query_name); - if(str.empty() && m_status.state == libtorrent::torrent_status::downloading_metadata) + if(st.name.empty() && m_status.state == libtorrent::torrent_status::downloading_metadata) return tr("Downloading metadata: %1%").arg((int) m_status.progress*100); else - return QString::fromUtf8(str.c_str()); + return QString::fromUtf8(st.name.c_str()); } else if(m_pFileDownload != 0) return tr("Downloading the .torrent file..."); @@ -529,13 +535,19 @@ //p = data.data(); libtorrent::add_torrent_params params; - m_info = new libtorrent::torrent_info(source.toStdString()); + boost::shared_ptr ti(new libtorrent::torrent_info(source.toStdString())); + + m_info = ti; - params.ti = m_info; + params.ti = ti; params.save_path = target.toStdString(); params.storage_mode = storageMode; params.paused = !isActive(); params.auto_managed = false; + params.flags = libtorrent::add_torrent_params::flag_duplicate_is_error; + + if (!isActive()) + params.flags |= libtorrent::add_torrent_params::flag_paused; m_handle = m_session->add_torrent(params); //m_handle = m_session->add_torrent(m_info, target.toStdString(), libtorrent::entry(), storageMode, !isActive()); @@ -553,6 +565,10 @@ params.paused = !isActive(); params.auto_managed = false; params.url = ss; + params.flags = libtorrent::add_torrent_params::flag_duplicate_is_error; + + if (!isActive()) + params.flags |= libtorrent::add_torrent_params::flag_paused; m_handle = m_session->add_torrent(params); } @@ -652,22 +668,28 @@ str = dir.absoluteFilePath(str); - const libtorrent::torrent_info info = m_handle.get_torrent_info(); - boost::shared_array md = info.metadata(); - int mdlen = info.metadata_size(); + boost::shared_ptr info = m_handle.torrent_file(); - QFile file(str); - if(!file.open(QIODevice::ReadWrite)) + if (info) { - qDebug() << "Unable to open" << str << "for writing"; - return false; - } + boost::shared_array md = info->metadata(); + int mdlen = info->metadata_size(); + + QFile file(str); + if(!file.open(QIODevice::ReadWrite)) + { + qDebug() << "Unable to open" << str << "for writing"; + return false; + } - file.write("d4:info"); - file.write(md.get(), mdlen); - file.write("e"); - file.close(); - return true; + file.write("d4:info"); + file.write(md.get(), mdlen); + file.write("e"); + file.close(); + return true; + } + else + return false; } QString TorrentDownload::storedTorrentName() const @@ -907,7 +929,8 @@ return; } - m_info = new libtorrent::torrent_info(sfile.toStdString()); + boost::shared_ptr ti(new libtorrent::torrent_info(sfile.toStdString())); + m_info = ti; torrent_resume = QByteArray::fromBase64(getXMLProperty(map, "torrent_resume").toUtf8()); @@ -916,13 +939,14 @@ libtorrent::add_torrent_params params; std::vector torrent_resume2 = std::vector(torrent_resume.data(), torrent_resume.data()+torrent_resume.size()); - params.storage_mode = (libtorrent::storage_mode_t) getSettingsValue("torrent/allocation").toInt(); - params.ti = m_info; + //params.storage_mode = (libtorrent::storage_mode_t) getSettingsValue("torrent/allocation").toInt(); + params.storage_mode = libtorrent::storage_mode_sparse; // don't force full allocation upon load + params.ti = ti; QByteArray path = str.toUtf8(); params.save_path = path.constData(); if(!torrent_resume2.empty()) - params.resume_data = &torrent_resume2; + params.resume_data = torrent_resume2; params.paused = true; params.auto_managed = false; @@ -1034,7 +1058,7 @@ for(i = 0; i < 3;) { libtorrent::alert* aaa; - std::auto_ptr a = TorrentDownload::m_session->pop_alert(); + std::unique_ptr a = TorrentDownload::m_session->pop_alert(); if((aaa = a.get()) == 0) { @@ -1157,7 +1181,18 @@ else { if(m_status.num_complete >= 0 || m_status.num_incomplete >= 0) - state = tr("Seeders: %1 | Leechers: %2").arg(m_status.num_complete).arg(m_status.num_incomplete); + { + state = tr("Seeders: %1 | Leechers: %2"); + if (m_status.num_complete >= 0) + state = state.arg(m_status.num_complete); + else + state = state.arg("?"); + + if (m_status.num_incomplete >= 0) + state = state.arg(m_status.num_incomplete); + else + state = state.arg("?"); + } } return state; @@ -1240,8 +1275,7 @@ comment.replace('\n', "
"); rv["comment"] = comment; - QString magnet = QString::fromStdString(libtorrent::make_magnet_uri(m_handle)); - rv["magnetLink"] = magnet; + rv["magnetLink"] = remoteURI(); if(!d) ratio = QString::fromUtf8("∞"); @@ -1250,16 +1284,20 @@ rv["ratio"] = ratio; QVariantList files; - int i = 0; - std::vector progresses; + std::vector progresses; m_handle.file_progress(progresses); - for(libtorrent::torrent_info::file_iterator it=m_info->begin_files();it!=m_info->end_files();it++,i++) + // num_files(), file_at() + for (int i = 0; i < m_info->num_files(); i++) { QVariantMap map; - map["name"] = QString::fromStdString(it->filename()); - map["size"] = qint64(it->size); + libtorrent::file_entry fe; + + fe = m_info->file_at(i); + + map["name"] = QString::fromStdString(fe.path); + map["size"] = qint64(fe.size); map["done"] = qint64(progresses[i]); map["priority"] = m_vecPriorities[i]; files << map; @@ -1352,7 +1390,7 @@ d->storeTorrent(); if (!d->m_info) - d->m_info = new libtorrent::torrent_info(d->m_handle.get_torrent_info()); + d->m_info = d->m_handle.torrent_file(); d->createDefaultPriorityList(); } @@ -1389,7 +1427,7 @@ { if(!d->m_status.has_metadata) continue; - d->m_info = new libtorrent::torrent_info(d->m_handle.get_torrent_info()); + d->m_info = d->m_handle.torrent_file(); } } @@ -1457,7 +1495,7 @@ while(true) { libtorrent::alert* aaa; - std::auto_ptr a = TorrentDownload::m_session->pop_alert(); + std::unique_ptr a = TorrentDownload::m_session->pop_alert(); if((aaa = a.get()) == 0) break; diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentDownload.h fatrat-1.2.0+git20180628/src/engines/TorrentDownload.h --- fatrat-1.2.0~beta2/src/engines/TorrentDownload.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentDownload.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -43,6 +42,8 @@ #include #include #include +#include +#include #include "Proxy.h" #ifdef WITH_WEBINTERFACE # include "remote/TransferHttpService.h" @@ -135,7 +136,7 @@ #endif protected: libtorrent::torrent_handle m_handle; - boost::intrusive_ptr m_info; + boost::shared_ptr m_info; libtorrent::torrent_status m_status; QString m_strError, m_strTarget; diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentFilesModel.cpp fatrat-1.2.0+git20180628/src/engines/TorrentFilesModel.cpp --- fatrat-1.2.0~beta2/src/engines/TorrentFilesModel.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentFilesModel.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -31,6 +30,7 @@ #include "fatrat.h" #include #include +#include TorrentFilesModel::TorrentFilesModel(QObject* parent, TorrentDownload* d) : QAbstractListModel(parent), m_pieces(0), m_download(d) diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentFilesModel.h fatrat-1.2.0+git20180628/src/engines/TorrentFilesModel.h --- fatrat-1.2.0~beta2/src/engines/TorrentFilesModel.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentFilesModel.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -35,6 +34,7 @@ #include #include #include +#include class TorrentDownload; @@ -64,7 +64,7 @@ void refresh(const libtorrent::bitfield* pieces); protected: QList m_files; - std::vector m_progresses; + std::vector m_progresses; const libtorrent::bitfield* m_pieces; private: TorrentDownload* m_download; diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentIPFilter.cpp fatrat-1.2.0+git20180628/src/engines/TorrentIPFilter.cpp --- fatrat-1.2.0~beta2/src/engines/TorrentIPFilter.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentIPFilter.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentIPFilter.h fatrat-1.2.0+git20180628/src/engines/TorrentIPFilter.h --- fatrat-1.2.0~beta2/src/engines/TorrentIPFilter.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentIPFilter.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentOptsWidget.cpp fatrat-1.2.0+git20180628/src/engines/TorrentOptsWidget.cpp --- fatrat-1.2.0~beta2/src/engines/TorrentOptsWidget.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentOptsWidget.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -29,6 +28,8 @@ #include #include #include "fatrat.h" +#include +#include TorrentOptsWidget::TorrentOptsWidget(QWidget* me, TorrentDownload* parent) : m_download(parent), m_bUpdating(false) @@ -92,11 +93,10 @@ QHeaderView* hdr = treeFiles->header(); hdr->resizeSection(0, 350); - for(libtorrent::torrent_info::file_iterator it = m_download->m_info->begin_files(); - it != m_download->m_info->end_files(); - it++) + for (int i = 0; i < m_download->m_info->num_files(); i++) { - QStringList elems = QString::fromUtf8(it->filename().c_str()).split('/'); + libtorrent::file_entry file = m_download->m_info->file_at(i); + QStringList elems = QString::fromStdString(file.path).split('/'); //QString name = elems.takeLast(); QTreeWidgetItem* item = 0; @@ -138,8 +138,8 @@ } // fill in info - item->setText(1, formatSize(it->size)); - item->setData(1, Qt::UserRole, qint64(it->size)); + item->setText(1, formatSize(file.size)); + item->setData(1, Qt::UserRole, qint64(file.size)); m_files << item; } @@ -162,7 +162,7 @@ m_trackers = m_download->m_handle.trackers(); for(size_t i=0;iaddItem(QString::fromUtf8(m_trackers[i].url.c_str())); + listTrackers->addItem(QString::fromStdString(m_trackers[i].url)); checkSuperSeeding->setChecked(m_download->m_bSuperSeeding); } diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentOptsWidget.h fatrat-1.2.0+git20180628/src/engines/TorrentOptsWidget.h --- fatrat-1.2.0~beta2/src/engines/TorrentOptsWidget.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentOptsWidget.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -29,9 +28,11 @@ #define TORRENTOPTSWIDGET_H #include #include +#include "config.h" #include "ui_TorrentOptsWidget.h" #include "WidgetHostChild.h" #include "TorrentDownload.h" +#include class TorrentOptsWidget : public QObject, public WidgetHostChild, Ui_TorrentOptsWidget { diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentPeersModel.cpp fatrat-1.2.0+git20180628/src/engines/TorrentPeersModel.cpp --- fatrat-1.2.0~beta2/src/engines/TorrentPeersModel.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentPeersModel.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -166,7 +165,7 @@ case 10: { int pcs = 0; - for ( size_t i=0;i. In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentPiecesModel.cpp fatrat-1.2.0+git20180628/src/engines/TorrentPiecesModel.cpp --- fatrat-1.2.0~beta2/src/engines/TorrentPiecesModel.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentPiecesModel.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentPiecesModel.h fatrat-1.2.0+git20180628/src/engines/TorrentPiecesModel.h --- fatrat-1.2.0~beta2/src/engines/TorrentPiecesModel.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentPiecesModel.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentProgressWidget.cpp fatrat-1.2.0+git20180628/src/engines/TorrentProgressWidget.cpp --- fatrat-1.2.0~beta2/src/engines/TorrentProgressWidget.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentProgressWidget.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentProgressWidget.h fatrat-1.2.0+git20180628/src/engines/TorrentProgressWidget.h --- fatrat-1.2.0~beta2/src/engines/TorrentProgressWidget.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentProgressWidget.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentSettings.cpp fatrat-1.2.0+git20180628/src/engines/TorrentSettings.cpp --- fatrat-1.2.0~beta2/src/engines/TorrentSettings.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentSettings.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/TorrentSettings.h fatrat-1.2.0+git20180628/src/engines/TorrentSettings.h --- fatrat-1.2.0~beta2/src/engines/TorrentSettings.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/TorrentSettings.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/engines/UrlClient.cpp fatrat-1.2.0+git20180628/src/engines/UrlClient.cpp --- fatrat-1.2.0~beta2/src/engines/UrlClient.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/UrlClient.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . */ #include "config.h" @@ -30,6 +29,10 @@ #include #include +#ifndef POSIX_LINUX +# define lseek64 lseek +#endif + UrlClient::UrlClient() : m_source(0), m_target(0), m_rangeFrom(0), m_rangeTo(-1), m_progress(0), m_curl(0), m_postData(0), m_bTerminating(false) { @@ -239,21 +242,7 @@ if(m_headers.contains("content-disposition") /*&& m_bAutoName*/) { QByteArray con = m_headers["content-disposition"]; - int pos = con.indexOf("filename="); - - if(pos != -1) - { - QString name = con.mid(pos+9); - - QRegExp quoted("\"([^\"]+)\".*"); - if(quoted.exactMatch(name)) - name = quoted.cap(1); - - name.replace('/', '_'); - qDebug() << "Automatically renaming to" << name; - //setTargetName(name); - emit renameTo(name); - } + processContentDisposition(con); } } else @@ -267,6 +256,50 @@ m_headers.clear(); } +void UrlClient::processContentDisposition(const QByteArray& con) +{ + int pos = con.indexOf("filename="); + + if(pos != -1) + { + QString name = con.mid(pos+9); + + QRegExp quoted("\"([^\"]+)\".*"); + if(quoted.exactMatch(name)) + name = quoted.cap(1); + + name.replace('/', '_'); + qDebug() << "Automatically renaming to" << name; + //setTargetName(name); + emit renameTo(name); + } + else + { + pos = con.indexOf("filename*="); + + if (pos == -1) + return; + + QByteArray name = con.mid(pos+10); + QString encoding, decName; + + pos = name.indexOf("''"); + + if (pos == -1) + return; + + encoding = name.left(pos); + name = name.mid(pos+2); + + if (encoding.compare("utf-8", Qt::CaseInsensitive) != 0) + return; // Qt can only handle UTF-8 url encoding + + decName = QUrl::fromPercentEncoding(name); + + emit renameTo(decName); + } +} + CURL* UrlClient::curlHandle() { return m_curl; diff -Nru fatrat-1.2.0~beta2/src/engines/UrlClient.h fatrat-1.2.0+git20180628/src/engines/UrlClient.h --- fatrat-1.2.0~beta2/src/engines/UrlClient.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/engines/UrlClient.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . */ #ifndef URLCLIENT_H @@ -68,6 +67,7 @@ static size_t process_header(const char* ptr, size_t size, size_t nmemb, UrlClient* This); static int curl_debug_callback(CURL*, curl_infotype, char* text, size_t bytes, UrlClient* This); void processHeaders(); + void processContentDisposition(const QByteArray& value); signals: void failure(QString msg); void renameTo(QString name); diff -Nru fatrat-1.2.0~beta2/src/ExtensionMgr.h fatrat-1.2.0+git20180628/src/ExtensionMgr.h --- fatrat-1.2.0~beta2/src/ExtensionMgr.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/ExtensionMgr.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/fancylineedit.cpp fatrat-1.2.0+git20180628/src/fancylineedit.cpp --- fatrat-1.2.0~beta2/src/fancylineedit.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/fancylineedit.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -29,18 +29,18 @@ #include "fancylineedit.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include enum { margin = 6 }; diff -Nru fatrat-1.2.0~beta2/src/fancylineedit.h fatrat-1.2.0+git20180628/src/fancylineedit.h --- fatrat-1.2.0~beta2/src/fancylineedit.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/fancylineedit.h 2018-07-05 18:20:27.000000000 +0000 @@ -32,8 +32,8 @@ //#include "utils_global.h" -#include -#include +#include +#include namespace Utils { diff -Nru fatrat-1.2.0~beta2/src/fatrat-conf.cpp fatrat-1.2.0+git20180628/src/fatrat-conf.cpp --- fatrat-1.2.0~beta2/src/fatrat-conf.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/fatrat-conf.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -14,7 +14,6 @@ QCoreApplication::setOrganizationName("Dolezel"); QCoreApplication::setOrganizationDomain("dolezel.info"); QCoreApplication::setApplicationName("fatrat"); - QTextCodec::setCodecForCStrings( QTextCodec::codecForName("UTF-8") ); QCoreApplication app(argc, argv); QSettings settings; diff -Nru fatrat-1.2.0~beta2/src/fatrat.cpp fatrat-1.2.0+git20180628/src/fatrat.cpp --- fatrat-1.2.0~beta2/src/fatrat.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/fatrat.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -115,7 +114,7 @@ static bool m_bForceNewInstance = false; static bool m_bStartHidden = false; static bool m_bStartGUI = true; -static bool m_bManualGraphicsSystem = false, m_bDisableJava = false, m_bJavaForceSearch = false; +static bool m_bDisableJava = false, m_bJavaForceSearch = false; static QString m_strUnitTest; static QString m_strSettingsPath; static QString m_strPidFile, m_strSetUser; @@ -128,11 +127,10 @@ int main(int argc,char** argv) { - QApplication* app = 0; + QCoreApplication* app = 0; int rval; QString arg; - QTextCodec::setCodecForCStrings( QTextCodec::codecForName("UTF-8") ); qsrand(time(0)); QCoreApplication::setOrganizationName("Dolezel"); @@ -141,15 +139,15 @@ arg = argsToArg(argc, argv); - if (!m_bManualGraphicsSystem) - QApplication::setGraphicsSystem("raster"); // native is too slow on Linux - if (!m_strPidFile.isEmpty()) writePidFile(); if (!m_strSetUser.isEmpty()) dropPrivileges(); - app = new MyApplication(argc, argv, m_bStartGUI); + if (m_bStartGUI) + app = new MyApplication(argc, argv); + else + app = new QCoreApplication(argc, argv); g_argc = argc; g_argv = argv; @@ -311,8 +309,6 @@ Logger::global()->toggleSysLog(true); else if(argv[i][0] == '-') { - if (!strcasecmp(argv[i], "-graphicssystem")) - m_bManualGraphicsSystem = true; i++; } else @@ -594,9 +590,9 @@ void showHelp() { - std::cout << "FatRat download manager ("VERSION")\n\n" + std::cout << "FatRat download manager (" VERSION ")\n\n" "Copyright (C) 2006-2011 Lubos Dolezel\n" - "Licensed under the terms of the GNU GPL version 2 as published by the Free Software Foundation\n\n" + "Licensed under the terms of the GNU GPL version 3 as published by the Free Software Foundation\n\n" "-f, --force \tRun the program even if an instance already exists\n" "-i, --hidden \tHide the GUI at startup (only if the tray icon exists)\n" "-n, --nogui \tStart with no GUI at all\n" @@ -630,7 +626,7 @@ memset(&act, 0, sizeof(act)); act.sa_handler = terminateHandler; - act.sa_flags = SA_NOMASK; + act.sa_flags = SA_NODEFER; sigaction(SIGINT, &act, 0); sigaction(SIGTERM, &act, 0); diff -Nru fatrat-1.2.0~beta2/src/fatrat.h fatrat-1.2.0+git20180628/src/fatrat.h --- fatrat-1.2.0~beta2/src/fatrat.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/fatrat.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/GenericOptsForm.h fatrat-1.2.0+git20180628/src/GenericOptsForm.h --- fatrat-1.2.0~beta2/src/GenericOptsForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/GenericOptsForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/InfoBar.cpp fatrat-1.2.0+git20180628/src/InfoBar.cpp --- fatrat-1.2.0~beta2/src/InfoBar.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/InfoBar.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/InfoBar.h fatrat-1.2.0+git20180628/src/InfoBar.h --- fatrat-1.2.0~beta2/src/InfoBar.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/InfoBar.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JAccountStatusPlugin.cpp fatrat-1.2.0+git20180628/src/java/JAccountStatusPlugin.cpp --- fatrat-1.2.0~beta2/src/java/JAccountStatusPlugin.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JAccountStatusPlugin.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JAccountStatusPlugin.h fatrat-1.2.0+git20180628/src/java/JAccountStatusPlugin.h --- fatrat-1.2.0~beta2/src/java/JAccountStatusPlugin.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JAccountStatusPlugin.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JArray.cpp fatrat-1.2.0+git20180628/src/java/JArray.cpp --- fatrat-1.2.0~beta2/src/java/JArray.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JArray.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JArray.h fatrat-1.2.0+git20180628/src/java/JArray.h --- fatrat-1.2.0~beta2/src/java/JArray.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JArray.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JBackgroundWorker.cpp fatrat-1.2.0+git20180628/src/java/JBackgroundWorker.cpp --- fatrat-1.2.0~beta2/src/java/JBackgroundWorker.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JBackgroundWorker.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JBackgroundWorker.h fatrat-1.2.0+git20180628/src/java/JBackgroundWorker.h --- fatrat-1.2.0~beta2/src/java/JBackgroundWorker.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JBackgroundWorker.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JByteBuffer.cpp fatrat-1.2.0+git20180628/src/java/JByteBuffer.cpp --- fatrat-1.2.0~beta2/src/java/JByteBuffer.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JByteBuffer.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JByteBuffer.h fatrat-1.2.0+git20180628/src/java/JByteBuffer.h --- fatrat-1.2.0~beta2/src/java/JByteBuffer.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JByteBuffer.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JClass.cpp fatrat-1.2.0+git20180628/src/java/JClass.cpp --- fatrat-1.2.0~beta2/src/java/JClass.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JClass.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -33,7 +32,10 @@ #include "JScope.h" #include "JException.h" #include "RuntimeException.h" -#include +#ifdef POSIX_LINUX +# include +#endif +#include #include JClass::JClass(const JClass& cls) diff -Nru fatrat-1.2.0~beta2/src/java/JClass.h fatrat-1.2.0+git20180628/src/java/JClass.h --- fatrat-1.2.0~beta2/src/java/JClass.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JClass.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JDownloadPlugin.cpp fatrat-1.2.0+git20180628/src/java/JDownloadPlugin.cpp --- fatrat-1.2.0~beta2/src/java/JDownloadPlugin.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JDownloadPlugin.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -35,6 +34,7 @@ #include "engines/JavaDownload.h" #include "captcha/Captcha.h" #include +#include #include QMap JDownloadPlugin::m_captchaCallbacks; diff -Nru fatrat-1.2.0~beta2/src/java/JDownloadPlugin.h fatrat-1.2.0+git20180628/src/java/JDownloadPlugin.h --- fatrat-1.2.0~beta2/src/java/JDownloadPlugin.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JDownloadPlugin.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JException.cpp fatrat-1.2.0+git20180628/src/java/JException.cpp --- fatrat-1.2.0~beta2/src/java/JException.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JException.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JException.h fatrat-1.2.0+git20180628/src/java/JException.h --- fatrat-1.2.0~beta2/src/java/JException.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JException.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JExtractorPlugin.cpp fatrat-1.2.0+git20180628/src/java/JExtractorPlugin.cpp --- fatrat-1.2.0~beta2/src/java/JExtractorPlugin.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JExtractorPlugin.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JExtractorPlugin.h fatrat-1.2.0+git20180628/src/java/JExtractorPlugin.h --- fatrat-1.2.0~beta2/src/java/JExtractorPlugin.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JExtractorPlugin.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JLinkCheckerPlugin.cpp fatrat-1.2.0+git20180628/src/java/JLinkCheckerPlugin.cpp --- fatrat-1.2.0~beta2/src/java/JLinkCheckerPlugin.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JLinkCheckerPlugin.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JLinkCheckerPlugin.h fatrat-1.2.0+git20180628/src/java/JLinkCheckerPlugin.h --- fatrat-1.2.0~beta2/src/java/JLinkCheckerPlugin.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JLinkCheckerPlugin.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JMap.cpp fatrat-1.2.0+git20180628/src/java/JMap.cpp --- fatrat-1.2.0~beta2/src/java/JMap.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JMap.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JMap.h fatrat-1.2.0+git20180628/src/java/JMap.h --- fatrat-1.2.0~beta2/src/java/JMap.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JMap.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JNativeMethod.cpp fatrat-1.2.0+git20180628/src/java/JNativeMethod.cpp --- fatrat-1.2.0~beta2/src/java/JNativeMethod.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JNativeMethod.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JNativeMethod.h fatrat-1.2.0+git20180628/src/java/JNativeMethod.h --- fatrat-1.2.0~beta2/src/java/JNativeMethod.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JNativeMethod.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JObject.cpp fatrat-1.2.0+git20180628/src/java/JObject.cpp --- fatrat-1.2.0~beta2/src/java/JObject.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JObject.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -33,7 +32,10 @@ #include "JClass.h" #include "JScope.h" #include "JException.h" -#include +#ifdef POSIX_LINUX +# include +#endif +#include #include #include @@ -508,7 +510,7 @@ m_object = 0; if (!m_bWeak) - env->DeleteWeakGlobalRef(o); + env->DeleteWeakGlobalRef(jweak(o)); else env->DeleteGlobalRef(o); } diff -Nru fatrat-1.2.0~beta2/src/java/JObject.h fatrat-1.2.0+git20180628/src/java/JObject.h --- fatrat-1.2.0~beta2/src/java/JObject.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JObject.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JPlugin.cpp fatrat-1.2.0+git20180628/src/java/JPlugin.cpp --- fatrat-1.2.0~beta2/src/java/JPlugin.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JPlugin.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JPlugin.h fatrat-1.2.0+git20180628/src/java/JPlugin.h --- fatrat-1.2.0~beta2/src/java/JPlugin.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JPlugin.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JScope.cpp fatrat-1.2.0+git20180628/src/java/JScope.cpp --- fatrat-1.2.0~beta2/src/java/JScope.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JScope.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JScope.h fatrat-1.2.0+git20180628/src/java/JScope.h --- fatrat-1.2.0~beta2/src/java/JScope.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JScope.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JSearchPlugin.cpp fatrat-1.2.0+git20180628/src/java/JSearchPlugin.cpp --- fatrat-1.2.0~beta2/src/java/JSearchPlugin.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JSearchPlugin.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JSearchPlugin.h fatrat-1.2.0+git20180628/src/java/JSearchPlugin.h --- fatrat-1.2.0~beta2/src/java/JSearchPlugin.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JSearchPlugin.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JSettings.cpp fatrat-1.2.0+git20180628/src/java/JSettings.cpp --- fatrat-1.2.0~beta2/src/java/JSettings.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JSettings.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JSettings.h fatrat-1.2.0+git20180628/src/java/JSettings.h --- fatrat-1.2.0~beta2/src/java/JSettings.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JSettings.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JSignature.cpp fatrat-1.2.0+git20180628/src/java/JSignature.cpp --- fatrat-1.2.0~beta2/src/java/JSignature.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JSignature.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JSignature.h fatrat-1.2.0+git20180628/src/java/JSignature.h --- fatrat-1.2.0~beta2/src/java/JSignature.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JSignature.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JSingleCObject.cpp fatrat-1.2.0+git20180628/src/java/JSingleCObject.cpp --- fatrat-1.2.0~beta2/src/java/JSingleCObject.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JSingleCObject.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JSingleCObject.h fatrat-1.2.0+git20180628/src/java/JSingleCObject.h --- fatrat-1.2.0~beta2/src/java/JSingleCObject.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JSingleCObject.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JString.cpp fatrat-1.2.0+git20180628/src/java/JString.cpp --- fatrat-1.2.0~beta2/src/java/JString.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JString.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JString.h fatrat-1.2.0+git20180628/src/java/JString.h --- fatrat-1.2.0~beta2/src/java/JString.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JString.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JSynchronized.h fatrat-1.2.0+git20180628/src/java/JSynchronized.h --- fatrat-1.2.0~beta2/src/java/JSynchronized.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JSynchronized.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JTransferPlugin.cpp fatrat-1.2.0+git20180628/src/java/JTransferPlugin.cpp --- fatrat-1.2.0~beta2/src/java/JTransferPlugin.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JTransferPlugin.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JTransferPlugin.h fatrat-1.2.0+git20180628/src/java/JTransferPlugin.h --- fatrat-1.2.0~beta2/src/java/JTransferPlugin.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JTransferPlugin.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JUploadPlugin.cpp fatrat-1.2.0+git20180628/src/java/JUploadPlugin.cpp --- fatrat-1.2.0~beta2/src/java/JUploadPlugin.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JUploadPlugin.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JUploadPlugin.h fatrat-1.2.0+git20180628/src/java/JUploadPlugin.h --- fatrat-1.2.0~beta2/src/java/JUploadPlugin.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JUploadPlugin.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JValue.cpp fatrat-1.2.0+git20180628/src/java/JValue.cpp --- fatrat-1.2.0~beta2/src/java/JValue.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JValue.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JValue.h fatrat-1.2.0+git20180628/src/java/JValue.h --- fatrat-1.2.0~beta2/src/java/JValue.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JValue.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/java/JVM.cpp fatrat-1.2.0+git20180628/src/java/JVM.cpp --- fatrat-1.2.0~beta2/src/java/JVM.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JVM.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -41,7 +40,10 @@ #include "config.h" #include "JObject.h" #include "JSingleCObject.h" -#include +#ifdef POSIX_LINUX +# include +#endif +#include #include #include @@ -169,7 +171,7 @@ } catch (...) { - qDebug() << "Failed to register JNI functions. This usually happens when there is an API discrepancy between the Java and the native code.\nPlease, remove ~/.local/share/fatrat/data/java/fatrat-jplugins.jar, and try again"; + qDebug() << "Failed to register JNI functions. This usually happens when there is an API discrepancy between the Java and the native code.\nPlease, remove ~/.local/share/fatrat/data/java/libs/fatrat-jplugins-core.jar, and try again"; abort(); } } @@ -187,16 +189,13 @@ foreach (QString f, list) { - if (f == "fatrat-jplugins.jar") + if (f == "fatrat-jplugins-core.jar") hasCore = true; if (!rv.isEmpty()) rv += ':'; rv += dir.filePath(f); } - if (!hasCore) - rv += ":" DATA_LOCATION "/data/java/fatrat-jplugins.jar"; - // Now enumerate extra Java classpath libs dir = (DATA_LOCATION "/data/java/libs"); list = dir.entryList(QStringList() << "*.jar", QDir::Files); @@ -204,6 +203,8 @@ { if (!rv.isEmpty()) rv += ':'; + if (f == "fatrat-jplugins-core.jar" && hasCore) + continue; rv += dir.filePath(f); } diff -Nru fatrat-1.2.0~beta2/src/java/JVM.h fatrat-1.2.0+git20180628/src/java/JVM.h --- fatrat-1.2.0~beta2/src/java/JVM.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/java/JVM.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Logger.cpp fatrat-1.2.0+git20180628/src/Logger.cpp --- fatrat-1.2.0~beta2/src/Logger.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Logger.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Logger.h fatrat-1.2.0+git20180628/src/Logger.h --- fatrat-1.2.0~beta2/src/Logger.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Logger.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/LogManager.h fatrat-1.2.0+git20180628/src/LogManager.h --- fatrat-1.2.0~beta2/src/LogManager.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/LogManager.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/MainTab.cpp fatrat-1.2.0+git20180628/src/MainTab.cpp --- fatrat-1.2.0~beta2/src/MainTab.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/MainTab.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/MainTab.h fatrat-1.2.0+git20180628/src/MainTab.h --- fatrat-1.2.0~beta2/src/MainTab.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/MainTab.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/MainWindow.cpp fatrat-1.2.0+git20180628/src/MainWindow.cpp --- fatrat-1.2.0~beta2/src/MainWindow.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/MainWindow.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -61,7 +60,7 @@ #include "SpeedLimitWidget.h" #include "AppTools.h" #include "AboutDlg.h" -#include "ReportBugDlg.h" +#include #include "filterlineedit.h" #include "ClipboardMonitor.h" #include "ClickableLabel.h" @@ -70,6 +69,7 @@ #ifdef WITH_JPLUGINS # include "engines/JavaAccountStatusWidget.h" # include "engines/SettingsJavaPluginForm.h" +# include "java/JVM.h" # include "ExtensionMgr.h" #endif @@ -135,6 +135,7 @@ treeTransfers->setItemDelegate(new ProgressDelegate(treeTransfers)); m_trayIcon.setIcon(QIcon(":/fatrat/fatrat.png")); + m_trayIcon.setToolTip("FatRat"); showTrayIcon(); statusbar->addWidget(&m_labelStatus); @@ -167,42 +168,48 @@ loadCSS(); #ifdef WITH_JPLUGINS - m_premiumAccounts = new ClickableLabel(this); + if (JVM::JVMAvailable()) + { + m_premiumAccounts = new ClickableLabel(this); - m_premiumAccounts->setToolTip(tr("Premium account status...")); - m_premiumAccounts->setScaledContents(true); - m_premiumAccounts->setPixmap(QPixmap(":/fatrat/premium.png")); - m_premiumAccounts->setMaximumSize(16, 16); - m_premiumAccounts->setCursor(Qt::PointingHandCursor); - statusbar->insertPermanentWidget(1, m_premiumAccounts); - m_premiumAccounts->show(); - - m_updates = new ClickableLabel(this); - m_updates->setScaledContents(true); - m_updates->setToolTip(tr("Extension updates: %1").arg(0)); - m_updates->setPixmap(QPixmap(":/fatrat/updates.png")); - m_updates->setMaximumSize(16, 16); - m_updates->setCursor(Qt::PointingHandCursor); - statusbar->insertPermanentWidget(1, m_updates); - m_updates->show(); - - m_extensionMgr = new ExtensionMgr; - connect(&m_extensionCheckTimer, SIGNAL(timeout()), m_extensionMgr, SLOT(loadFromServer())); - connect(m_extensionMgr, SIGNAL(loaded()), this, SLOT(updatesChecked())); + m_premiumAccounts->setToolTip(tr("Premium account status...")); + m_premiumAccounts->setScaledContents(true); + m_premiumAccounts->setPixmap(QPixmap(":/fatrat/premium.png")); + m_premiumAccounts->setMaximumSize(16, 16); + m_premiumAccounts->setCursor(Qt::PointingHandCursor); + statusbar->insertPermanentWidget(1, m_premiumAccounts); + m_premiumAccounts->show(); + + m_updates = new ClickableLabel(this); + m_updates->setScaledContents(true); + m_updates->setToolTip(tr("Extension updates: %1").arg(0)); + m_updates->setPixmap(QPixmap(":/fatrat/updates.png")); + m_updates->setMaximumSize(16, 16); + m_updates->setCursor(Qt::PointingHandCursor); + statusbar->insertPermanentWidget(1, m_updates); + m_updates->show(); + + m_extensionMgr = new ExtensionMgr; + connect(&m_extensionCheckTimer, SIGNAL(timeout()), m_extensionMgr, SLOT(loadFromServer())); + connect(m_extensionMgr, SIGNAL(loaded()), this, SLOT(updatesChecked())); - m_bUpdatesBubbleManuallyClosed = false; - m_extensionCheckTimer.setInterval(60*60*1000); + m_bUpdatesBubbleManuallyClosed = false; + m_extensionCheckTimer.setInterval(60*60*1000); - if (getSettingsValue("java/check_updates").toBool()) - { - m_extensionCheckTimer.start(); - QTimer::singleShot(20*1000, m_extensionMgr, SLOT(loadFromServer())); - } + if (getSettingsValue("java/check_updates").toBool()) + { + m_extensionCheckTimer.start(); + QTimer::singleShot(20*1000, m_extensionMgr, SLOT(loadFromServer())); + } - connect(m_updates, SIGNAL(clicked()), this, SLOT(showSettings())); + connect(m_updates, SIGNAL(clicked()), this, SLOT(showSettings())); + } + else + m_premiumAccounts = nullptr; #endif connectActions(); + setupTrayIconMenu(); for(int i=0;itoggle(); } - else if(reason == QSystemTrayIcon::Context) - { - QMenu menu(this); - - menu.addAction(actionDisplay); - menu.addAction(actionDropBox); - menu.addSeparator(); - menu.addAction(actionPauseAll); - menu.addSeparator(); - menu.addAction(actionHideAllInfoBars); - menu.addSeparator(); - menu.addAction(actionQuit); - - menu.exec(QCursor::pos()); - } - else if(reason == QSystemTrayIcon::MiddleClick) + else if(reason == QSystemTrayIcon::MiddleClick || reason == QSystemTrayIcon::Context) { actionDropBox->toggle(); } @@ -1648,8 +1658,20 @@ } } -void MainWindow::downloadModeChanged(Transfer* /*t*/, Transfer::State /*prev*/, Transfer::State /*now*/) +void MainWindow::downloadModeChanged(Transfer* d, Transfer::Mode prev, Transfer::Mode now) { + const bool popup = g_settings->value("showpopup", getSettingsDefault("showpopup")).toBool(); + + if(!popup) + return; + + if(prev == Transfer::Download && now == Transfer::Upload) + { + m_trayIcon.showMessage(tr("Download completed"), + QString(tr("The download of \"%1\" has been completed. Starting the upload now.")).arg(d->name()), + QSystemTrayIcon::Information, g_settings->value("popuptime", getSettingsDefault("popuptime")).toInt()*1000); + } + } QList MainWindow::getSelection() @@ -1792,7 +1814,7 @@ void MainWindow::reportBug() { - ReportBugDlg(this).exec(); + QProcess::startDetached("xdg-open", QStringList() << QLatin1String("https://github.com/LubosD/fatrat/issues")); } void MainWindow::copyRemoteURI() diff -Nru fatrat-1.2.0~beta2/src/MainWindow.h fatrat-1.2.0+git20180628/src/MainWindow.h --- fatrat-1.2.0~beta2/src/MainWindow.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/MainWindow.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -113,7 +112,7 @@ void trayIconActivated(QSystemTrayIcon::ActivationReason reason); void downloadStateChanged(Transfer* d, Transfer::State prev, Transfer::State now); - void downloadModeChanged(Transfer* d, Transfer::State prev, Transfer::State now); + void downloadModeChanged(Transfer* d, Transfer::Mode prev, Transfer::Mode now); void reconfigure(); void showWindow(bool); @@ -145,6 +144,7 @@ void restoreWindowState(bool bStartHidden); void connectActions(); void fillSettingsMenu(); + void setupTrayIconMenu(); void showTrayIcon(); void transferOpen(bool bOpenFile); @@ -154,6 +154,7 @@ private: QTimer* m_timer; MyTrayIcon m_trayIcon; + QMenu m_trayIconMenu; TransfersModel* m_modelTransfers; QLabel m_labelStatus; QObject* m_pDetailsDisplay; diff -Nru fatrat-1.2.0~beta2/src/MyApplication.cpp fatrat-1.2.0+git20180628/src/MyApplication.cpp --- fatrat-1.2.0~beta2/src/MyApplication.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/MyApplication.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -31,8 +30,8 @@ #include "MyApplication.h" #include "Queue.h" -MyApplication::MyApplication(int& argc, char** argv, bool gui) - : QApplication(argc, argv, gui) +MyApplication::MyApplication(int& argc, char** argv) + : QApplication(argc, argv) { } diff -Nru fatrat-1.2.0~beta2/src/MyApplication.h fatrat-1.2.0+git20180628/src/MyApplication.h --- fatrat-1.2.0~beta2/src/MyApplication.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/MyApplication.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -34,7 +33,7 @@ { Q_OBJECT public: - MyApplication(int& argc, char** argv, bool gui); + MyApplication(int& argc, char** argv); virtual bool notify(QObject* receiver, QEvent* e); virtual void saveState(QSessionManager&); diff -Nru fatrat-1.2.0~beta2/src/MyFileDialog.cpp fatrat-1.2.0+git20180628/src/MyFileDialog.cpp --- fatrat-1.2.0~beta2/src/MyFileDialog.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/MyFileDialog.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/MyFileDialog.h fatrat-1.2.0+git20180628/src/MyFileDialog.h --- fatrat-1.2.0~beta2/src/MyFileDialog.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/MyFileDialog.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/MyTrayIcon.h fatrat-1.2.0+git20180628/src/MyTrayIcon.h --- fatrat-1.2.0~beta2/src/MyTrayIcon.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/MyTrayIcon.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/NetIface.cpp fatrat-1.2.0+git20180628/src/NetIface.cpp --- fatrat-1.2.0~beta2/src/NetIface.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/NetIface.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/NetIface.h fatrat-1.2.0+git20180628/src/NetIface.h --- fatrat-1.2.0~beta2/src/NetIface.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/NetIface.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/NewTransferDlg.cpp fatrat-1.2.0+git20180628/src/NewTransferDlg.cpp --- fatrat-1.2.0~beta2/src/NewTransferDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/NewTransferDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/NewTransferDlg.h fatrat-1.2.0+git20180628/src/NewTransferDlg.h --- fatrat-1.2.0~beta2/src/NewTransferDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/NewTransferDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/notify/Notification.cpp fatrat-1.2.0+git20180628/src/notify/Notification.cpp --- fatrat-1.2.0~beta2/src/notify/Notification.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/notify/Notification.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/notify/Notification.h fatrat-1.2.0+git20180628/src/notify/Notification.h --- fatrat-1.2.0~beta2/src/notify/Notification.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/notify/Notification.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/poller/EpollPoller.cpp fatrat-1.2.0+git20180628/src/poller/EpollPoller.cpp --- fatrat-1.2.0~beta2/src/poller/EpollPoller.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/poller/EpollPoller.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/poller/EpollPoller.h fatrat-1.2.0+git20180628/src/poller/EpollPoller.h --- fatrat-1.2.0~beta2/src/poller/EpollPoller.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/poller/EpollPoller.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/poller/KqueuePoller.cpp fatrat-1.2.0+git20180628/src/poller/KqueuePoller.cpp --- fatrat-1.2.0~beta2/src/poller/KqueuePoller.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/poller/KqueuePoller.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -30,7 +29,7 @@ #include #include #include -#include +#include KqueuePoller::KqueuePoller(QObject* parent) : Poller(parent) diff -Nru fatrat-1.2.0~beta2/src/poller/KqueuePoller.h fatrat-1.2.0+git20180628/src/poller/KqueuePoller.h --- fatrat-1.2.0~beta2/src/poller/KqueuePoller.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/poller/KqueuePoller.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/poller/Poller.cpp fatrat-1.2.0+git20180628/src/poller/Poller.cpp --- fatrat-1.2.0~beta2/src/poller/Poller.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/poller/Poller.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/poller/Poller.h fatrat-1.2.0+git20180628/src/poller/Poller.h --- fatrat-1.2.0~beta2/src/poller/Poller.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/poller/Poller.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Proxy.cpp fatrat-1.2.0+git20180628/src/Proxy.cpp --- fatrat-1.2.0~beta2/src/Proxy.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Proxy.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -27,7 +26,6 @@ #include "Proxy.h" #include -#include #include extern QSettings* g_settings; diff -Nru fatrat-1.2.0~beta2/src/ProxyDlg.h fatrat-1.2.0+git20180628/src/ProxyDlg.h --- fatrat-1.2.0~beta2/src/ProxyDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/ProxyDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Proxy.h fatrat-1.2.0+git20180628/src/Proxy.h --- fatrat-1.2.0~beta2/src/Proxy.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Proxy.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -30,7 +29,6 @@ #include #include #include -#include struct Proxy { diff -Nru fatrat-1.2.0~beta2/src/Queue.cpp fatrat-1.2.0+git20180628/src/Queue.cpp --- fatrat-1.2.0~beta2/src/Queue.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Queue.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -246,7 +245,7 @@ } else { - qDebug() << "***ERROR*** Unable to createInstance " << n.attribute("class").toAscii(); + qDebug() << "***ERROR*** Unable to createInstance " << n.attribute("class"); d = new PlaceholderTransfer(n.attribute("class")); d->load(n); diff -Nru fatrat-1.2.0~beta2/src/QueueDlg.cpp fatrat-1.2.0+git20180628/src/QueueDlg.cpp --- fatrat-1.2.0~beta2/src/QueueDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/QueueDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/QueueDlg.h fatrat-1.2.0+git20180628/src/QueueDlg.h --- fatrat-1.2.0~beta2/src/QueueDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/QueueDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Queue.h fatrat-1.2.0+git20180628/src/Queue.h --- fatrat-1.2.0~beta2/src/Queue.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Queue.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/QueueMgr.cpp fatrat-1.2.0+git20180628/src/QueueMgr.cpp --- fatrat-1.2.0~beta2/src/QueueMgr.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/QueueMgr.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/QueueMgr.h fatrat-1.2.0+git20180628/src/QueueMgr.h --- fatrat-1.2.0~beta2/src/QueueMgr.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/QueueMgr.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/QueueView.cpp fatrat-1.2.0+git20180628/src/QueueView.cpp --- fatrat-1.2.0~beta2/src/QueueView.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/QueueView.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/QueueView.h fatrat-1.2.0+git20180628/src/QueueView.h --- fatrat-1.2.0~beta2/src/QueueView.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/QueueView.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/remote/CertGenDlg.cpp fatrat-1.2.0+git20180628/src/remote/CertGenDlg.cpp --- fatrat-1.2.0~beta2/src/remote/CertGenDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/CertGenDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/remote/CertGenDlg.h fatrat-1.2.0+git20180628/src/remote/CertGenDlg.h --- fatrat-1.2.0~beta2/src/remote/CertGenDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/CertGenDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/remote/HttpService.cpp fatrat-1.2.0+git20180628/src/remote/HttpService.cpp --- fatrat-1.2.0~beta2/src/remote/HttpService.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/HttpService.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -51,9 +50,8 @@ #include #include #include -#include -#include -#include +#include +#include #include #include "pion/FileService.hpp" #include @@ -63,7 +61,7 @@ #include #include -using namespace pion::net; +using namespace pion::http; extern QList g_queues; extern QReadWriteLock g_queuesLock; @@ -172,16 +170,16 @@ void HttpService::setupAuth() { - pion::net::PionUserManagerPtr userManager(new pion::net::PionUserManager); + pion::user_manager_ptr userManager(new pion::user_manager); QString password = getSettingsValue("remote/password").toString(); - m_auth_ptr = pion::net::HTTPAuthPtr( new pion::net::HTTPBasicAuth(userManager, "FatRat Web Interface") ); - m_server->setAuthentication(m_auth_ptr); - m_auth_ptr->addRestrict("/"); - - m_auth_ptr->addUser("fatrat", password.toStdString()); - m_auth_ptr->addUser("admin", password.toStdString()); - m_auth_ptr->addUser("user", password.toStdString()); + m_auth_ptr = pion::http::auth_ptr( new pion::http::basic_auth(userManager, "FatRat Web Interface") ); + m_server->set_authentication(m_auth_ptr); + m_auth_ptr->add_restrict("/"); + + m_auth_ptr->add_user("fatrat", password.toStdString()); + m_auth_ptr->add_user("admin", password.toStdString()); + m_auth_ptr->add_user("user", password.toStdString()); } void HttpService::setup() @@ -190,28 +188,30 @@ try { - m_server = new pion::net::WebServer(m_port); + m_server = new pion::http::plugin_server(m_port); setupAuth(); setupSSL(); - m_server->addService("/xmlrpc", new XmlRpcService); - m_server->addService("/subclass", new SubclassService); - m_server->addService("/log", new LogService); - m_server->addService("/browse", new TransferTreeBrowserService); - m_server->addService("/", new pion::plugins::FileService); - m_server->setServiceOption("/", "directory", DATA_LOCATION "/data/remote"); - m_server->setServiceOption("/", "file", DATA_LOCATION "/data/remote/index.html"); - m_server->addService("/copyrights", new pion::plugins::FileService); - m_server->setServiceOption("/copyrights", "file", DATA_LOCATION "/README"); - m_server->addService("/download", new TransferDownloadService); - m_server->addService("/captcha", new CaptchaService); + m_server->add_service("/xmlrpc", new XmlRpcService); + m_server->add_service("/subclass", new SubclassService); + m_server->add_service("/log", new LogService); + m_server->add_service("/browse", new TransferTreeBrowserService); + m_server->add_service("/", new pion::plugins::FileService); + m_server->set_service_option("/", "directory", DATA_LOCATION "/data/remote"); + m_server->set_service_option("/", "file", DATA_LOCATION "/data/remote/index.html"); + m_server->add_service("/copyrights", new pion::plugins::FileService); + m_server->set_service_option("/copyrights", "file", DATA_LOCATION "/README"); + m_server->add_service("/download", new TransferDownloadService); + m_server->add_service("/captcha", new CaptchaService); m_server->start(); Logger::global()->enterLogMessage("HttpService", tr("Listening on port %1").arg(m_port)); + std::cout << "Listening on port " << m_port << std::endl; } catch(const std::exception& e) { + std::cerr << e.what() << std::endl; Logger::global()->enterLogMessage("HttpService", tr("Failed to start: %1").arg(e.what())); } } @@ -225,29 +225,29 @@ if (file.isEmpty() || !QFile::exists(file)) { Logger::global()->enterLogMessage("HttpService", tr("SSL key file not found, disabling HTTPS")); - m_server->setSSLFlag(false); + m_server->set_ssl_flag(false); m_strSSLPem.clear(); } else { Logger::global()->enterLogMessage("HttpService", tr("Loading a SSL key from %1").arg(file)); m_strSSLPem = file; - m_server->setSSLKeyFile(file.toStdString()); - m_server->setSSLFlag(true); + m_server->set_ssl_key_file(file.toStdString()); + m_server->set_ssl_flag(true); } } else { Logger::global()->enterLogMessage("HttpService", tr("Running in plain HTTP mode")); - m_server->setSSLFlag(false); + m_server->set_ssl_flag(false); m_strSSLPem.clear(); } } -void HttpService::LogService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) +void HttpService::LogService::operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) { - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))); - QString uuidTransfer = QString::fromStdString(getRelativeResource(request->getResource())); + pion::http::response_writer_ptr writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn))); + QString uuidTransfer = QString::fromStdString(get_relative_resource(request->get_resource())); QString data; if (uuidTransfer.isEmpty()) @@ -260,8 +260,8 @@ if (!q || !t) { - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); + writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); + writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); writer->send(); return; } @@ -272,16 +272,16 @@ g_queuesLock.unlock(); } - writer->getResponse().addHeader("Content-Type", "text/plain"); + writer->get_response().add_header("Content-Type", "text/plain"); writer->write(data.toStdString()); writer->send(); } -void HttpService::TransferTreeBrowserService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) +void HttpService::TransferTreeBrowserService::operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) { - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))); - QString uuidTransfer = QString::fromStdString(getRelativeResource(request->getResource())); - QString path = QString::fromStdString(request->getQuery("path")); + pion::http::response_writer_ptr writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn))); + QString uuidTransfer = QString::fromStdString(get_relative_resource(request->get_resource())); + QString path = QString::fromStdString(request->get_query("path")); path = path.replace("+", " "); path = QUrl::fromPercentEncoding(path.toUtf8()); @@ -294,8 +294,8 @@ if (path.contains("/..") || path.contains("../")) { - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_FORBIDDEN); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_FORBIDDEN); + writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_FORBIDDEN); + writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_FORBIDDEN); writer->send(); return; } @@ -304,8 +304,8 @@ if (!q || !t) { - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); + writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); + writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); writer->send(); return; } @@ -320,8 +320,8 @@ if (!dir.cd(path)) { - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); + writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); + writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); writer->send(); return; } @@ -371,11 +371,11 @@ writer->send(); } -void HttpService::TransferDownloadService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) +void HttpService::TransferDownloadService::operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) { - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))); - QString transfer = QString::fromStdString(request->getQuery("transfer")); - QString path = QString::fromStdString(request->getQuery("path")); + pion::http::response_writer_ptr writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn))); + QString transfer = QString::fromStdString(request->get_query("transfer")); + QString path = QString::fromStdString(request->get_query("path")); path = path.replace("+", " "); path = QUrl::fromPercentEncoding(path.toUtf8()); @@ -387,8 +387,8 @@ if (path.contains("/..") || path.contains("../")) { - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_FORBIDDEN); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_FORBIDDEN); + writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_FORBIDDEN); + writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_FORBIDDEN); writer->send(); return; } @@ -397,8 +397,8 @@ if (!q || !t) { - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); + writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); + writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); writer->send(); return; } @@ -428,24 +428,24 @@ response_file.update(); pion::plugins::DiskFileSenderPtr sender_ptr(pion::plugins::DiskFileSender::create(response_file, request, tcp_conn, 8192)); - sender_ptr->getWriter()->getResponse().addHeader("Content-Disposition", disposition.toStdString()); + sender_ptr->get_writer()->get_response().add_header("Content-Disposition", disposition.toStdString()); if (unsigned long long fileSize = response_file.getFileSize()) { std::stringstream fileSizeStream; fileSizeStream << fileSize; - sender_ptr->getWriter()->getResponse().addHeader("Content-Length", fileSizeStream.str()); + sender_ptr->get_writer()->get_response().add_header("Content-Length", fileSizeStream.str()); } sender_ptr->send(); } -void HttpService::SubclassService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) +void HttpService::SubclassService::operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) { - pion::net::HTTPResponseWriterPtr writer = HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn)); + pion::http::response_writer_ptr writer = pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn)); HttpService::WriteBackImpl wb = HttpService::WriteBackImpl(writer); - QString transfer = QString::fromStdString(request->getQuery("transfer")); - QString method = QString::fromStdString(getRelativeResource(request->getResource())); + QString transfer = QString::fromStdString(request->get_query("transfer")); + QString method = QString::fromStdString(get_relative_resource(request->get_resource())); Queue* q = 0; Transfer* t = 0; @@ -460,15 +460,15 @@ g_queuesLock.unlock(); } - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); + writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); + writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); writer->send(); return; } QMultiMap map; - pion::net::HTTPTypes::QueryParams params = request->getQueryParams(); - for (pion::net::HTTPTypes::QueryParams::iterator it = params.begin(); it != params.end(); it++) + pion::ihash_multimap params = request->get_queries(); + for (pion::ihash_multimap::iterator it = params.begin(); it != params.end(); it++) { map.insert(QString::fromStdString(it->first), QString::fromStdString(it->second)); } @@ -481,7 +481,7 @@ g_queuesLock.unlock(); } -HttpService::WriteBackImpl::WriteBackImpl(pion::net::HTTPResponseWriterPtr& writer) +HttpService::WriteBackImpl::WriteBackImpl(pion::http::response_writer_ptr& writer) : m_writer(writer) { @@ -489,7 +489,7 @@ void HttpService::WriteBackImpl::writeNoCopy(void* data, size_t bytes) { - m_writer->writeNoCopy(data, bytes); + m_writer->write_no_copy(data, bytes); } void HttpService::WriteBackImpl::send() @@ -504,13 +504,13 @@ void HttpService::WriteBackImpl::setContentType(const char* type) { - m_writer->getResponse().addHeader("Content-Type", type); + m_writer->get_response().add_header("Content-Type", type); } void HttpService::WriteBackImpl::writeFail(QString error) { - m_writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); - m_writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); + m_writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_NOT_FOUND); + m_writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_NOT_FOUND); } int HttpService::findTransfer(QString transferUUID, Queue** q, Transfer** t, bool lockForWrite) @@ -601,9 +601,9 @@ /* -void HttpService::CaptchaService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) +void HttpService::CaptchaService::operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn) { - m_cap.writer = HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn)); + m_cap.writer = pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn)); std::string upgrade, connection; upgrade = request->getHeader("Upgrade"); @@ -616,8 +616,8 @@ if (connection != "upgrade" || upgrade != "websocket" || m_cap.key1.empty() || m_cap.key2.empty()) { - m_cap.writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_BAD_REQUEST); - m_cap.writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_BAD_REQUEST); + m_cap.writer->get_response().set_status_code(pion::http::types::RESPONSE_CODE_BAD_REQUEST); + m_cap.writer->get_response().set_status_message(pion::http::types::RESPONSE_MESSAGE_BAD_REQUEST); m_cap.writer->send(); } @@ -668,30 +668,30 @@ */ -void HttpService::CaptchaHttpResponseWriter::handleWrite(const boost::system::error_code &write_error, std::size_t bytes_written) +void HttpService::CaptchaHttpResponseWriter::handle_write(const boost::system::error_code &write_error, std::size_t bytes_written) { if (!bytes_written) { // TODO: handle errors HttpService::instance()->removeCaptchaClient(client); - sendFinalChunk(); + send_final_chunk(); delete client; } - pion::net::HTTPResponseWriter::handleWrite(write_error, bytes_written); + pion::http::response_writer::handle_write(write_error, bytes_written); } -void HttpService::CaptchaService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) +void HttpService::CaptchaService::operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) { - if (request->hasQuery("id")) + if (request->has_query("id")) { - QString id = QString::fromStdString(request->getQuery("id")); - QString solution = QString::fromStdString(request->getQuery("solution")); + QString id = QString::fromStdString(request->get_query("id")); + QString solution = QString::fromStdString(request->get_query("solution")); int iid = id.toInt(); HttpService::instance()->m_captchaHttp.captchaEntered(iid, solution); - pion::net::HTTPResponseWriterPtr writer = HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn)); + pion::http::response_writer_ptr writer = pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn)); writer->send(); } else @@ -709,13 +709,13 @@ RegisteredClient* client = new RegisteredClient; client->writer = CaptchaHttpResponseWriter::create(client, tcp_conn, *request, - boost::bind(&TCPConnection::finish, tcp_conn)); + boost::bind(&pion::tcp::connection::finish, tcp_conn)); HttpService::instance()->addCaptchaClient(client); - client->writer->getResponse().addHeader("Content-Type", "text/event-stream"); - client->writer->getResponse().addHeader("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0"); - client->writer->getResponse().addHeader("Expires", "Tue, 03 Jul 2001 06:00:00 GMT"); - client->writer->getResponse().addHeader("Pragma", "no-cache"); + client->writer->get_response().add_header("Content-Type", "text/event-stream"); + client->writer->get_response().add_header("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0"); + client->writer->get_response().add_header("Expires", "Tue, 03 Jul 2001 06:00:00 GMT"); + client->writer->get_response().add_header("Pragma", "no-cache"); } } @@ -747,7 +747,7 @@ writer->clear(); writer->write(buf.data(), buf.length()); - writer->sendChunk(boost::bind(&HttpService::RegisteredClient::finished, this)); + writer->send_chunk(boost::bind(&HttpService::RegisteredClient::finished, this)); } else writeInProgressLock.unlock(); @@ -760,7 +760,7 @@ writer->clear(); writer->write(": keepalive\r\n\r\n"); - writer->sendChunk(boost::bind(&HttpService::RegisteredClient::finished, this)); + writer->send_chunk(boost::bind(&HttpService::RegisteredClient::finished, this)); } void HttpService::addCaptchaEvent(int id, QString url) @@ -803,5 +803,5 @@ void HttpService::RegisteredClient::terminate() { - writer->getTCPConnection()->finish(); + writer->get_connection()->finish(); } diff -Nru fatrat-1.2.0~beta2/src/remote/HttpService.h fatrat-1.2.0+git20180628/src/remote/HttpService.h --- fatrat-1.2.0~beta2/src/remote/HttpService.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/HttpService.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -40,7 +39,8 @@ #include #include #include -#include +#include +#include #include "captcha/CaptchaHttp.h" #include "remote/TransferHttpService.h" @@ -48,7 +48,8 @@ # error This file is not supposed to be included! #endif -#include +#include +#include class Queue; class Transfer; @@ -83,8 +84,8 @@ void killCaptchaClients(); private: static HttpService* m_instance; - pion::net::WebServer* m_server; - pion::net::HTTPAuthPtr m_auth_ptr; + pion::http::plugin_server* m_server; + pion::http::auth_ptr m_auth_ptr; CaptchaHttp m_captchaHttp; quint16 m_port; QString m_strSSLPem; @@ -94,27 +95,27 @@ QList m_registeredCaptchaClients; QMutex m_registeredCaptchaClientsMutex; - class LogService : public pion::net::WebService + class LogService : public pion::http::plugin_service { - void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); + void operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) override; }; - class TransferTreeBrowserService : public pion::net::WebService + class TransferTreeBrowserService : public pion::http::plugin_service { - void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); + void operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) override; }; - class TransferDownloadService : public pion::net::WebService + class TransferDownloadService : public pion::http::plugin_service { - void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); + void operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) override; }; - class SubclassService : public pion::net::WebService + class SubclassService : public pion::http::plugin_service { public: - void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); + void operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) override; }; - /*class CaptchaService : public pion::net::WebService + /*class CaptchaService : public pion::http::plugin_service { public: - void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); + void operator()(pion::http::request_ptr &request, pion::tcp::connection_ptr &tcp_conn); private: class CapServCap { @@ -126,15 +127,15 @@ std::string key1, key2; char sig[8]; int inbuf; - pion::net::TCPConnectionPtr tcp_conn; + pion::tcp::connection_ptr tcp_conn; } m_cap; };*/ class CaptchaHttpResponseWriter; - class CaptchaService : public pion::net::WebService + class CaptchaService : public pion::http::plugin_service { public: - void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); + void operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn); }; struct RegisteredClient { @@ -151,16 +152,16 @@ void terminate(); }; - class CaptchaHttpResponseWriter : public pion::net::HTTPResponseWriter + class CaptchaHttpResponseWriter : public pion::http::response_writer { public: - CaptchaHttpResponseWriter(HttpService::RegisteredClient* cl, pion::net::TCPConnectionPtr &tcp_conn, const pion::net::HTTPRequest& request, FinishedHandler handler = FinishedHandler()) - : pion::net::HTTPResponseWriter(tcp_conn, request, handler), client(cl) + CaptchaHttpResponseWriter(HttpService::RegisteredClient* cl, const pion::tcp::connection_ptr &tcp_conn, const pion::http::request& request, finished_handler_t handler = finished_handler_t()) + : pion::http::response_writer(tcp_conn, request, handler), client(cl) { } - static inline boost::shared_ptr create(HttpService::RegisteredClient* cl, pion::net::TCPConnectionPtr &tcp_conn, const pion::net::HTTPRequest& request, FinishedHandler handler = FinishedHandler()) + static inline boost::shared_ptr create(HttpService::RegisteredClient* cl, const pion::tcp::connection_ptr &tcp_conn, const pion::http::request& request, finished_handler_t handler = finished_handler_t()) { return boost::shared_ptr(new CaptchaHttpResponseWriter(cl, tcp_conn, request, handler)); } @@ -171,7 +172,7 @@ m_http_response->prepareBuffersForSend(write_buffers, getTCPConnection()->getKeepAlive(), sendingChunkedMessage()); }*/ - virtual void handleWrite(const boost::system::error_code &write_error, std::size_t bytes_written); + virtual void handle_write(const boost::system::error_code &write_error, std::size_t bytes_written); HttpService::RegisteredClient* client; }; @@ -179,14 +180,14 @@ class WriteBackImpl : public TransferHttpService::WriteBack { public: - WriteBackImpl(pion::net::HTTPResponseWriterPtr& writer); + WriteBackImpl(pion::http::response_writer_ptr& writer); void write(const char* data, size_t bytes); void writeFail(QString error); void writeNoCopy(void* data, size_t bytes); void send(); void setContentType(const char* type); private: - pion::net::HTTPResponseWriterPtr m_writer; + pion::http::response_writer_ptr m_writer; }; }; diff -Nru fatrat-1.2.0~beta2/src/remote/JabberService.cpp fatrat-1.2.0+git20180628/src/remote/JabberService.cpp --- fatrat-1.2.0~beta2/src/remote/JabberService.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/JabberService.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/remote/JabberService.h fatrat-1.2.0+git20180628/src/remote/JabberService.h --- fatrat-1.2.0~beta2/src/remote/JabberService.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/JabberService.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/remote/pion/FileService.cpp fatrat-1.2.0+git20180628/src/remote/pion/FileService.cpp --- fatrat-1.2.0~beta2/src/remote/pion/FileService.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/pion/FileService.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -1,7 +1,7 @@ -// ------------------------------------------------------------------ -// pion-net: a C++ framework for building lightweight HTTP interfaces -// ------------------------------------------------------------------ -// Copyright (C) 2007-2008 Atomic Labs, Inc. (http://www.atomiclabs.com) +// --------------------------------------------------------------------- +// pion: a Boost C++ framework for building lightweight HTTP interfaces +// --------------------------------------------------------------------- +// Copyright (C) 2007-2014 Splunk Inc. (https://github.com/splunk/pion) // // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt @@ -9,692 +9,748 @@ #include #include +#include #include #include #include #include +#include #include "FileService.hpp" -#include -#include -#include -#include +#include +#include +#include +#include using namespace pion; -using namespace pion::net; -namespace pion { // begin namespace pion -namespace plugins { // begin namespace plugins +namespace pion { // begin namespace pion +namespace plugins { // begin namespace plugins // static members of FileService -const std::string FileService::DEFAULT_MIME_TYPE("application/octet-stream"); -const unsigned int FileService::DEFAULT_CACHE_SETTING = 1; -const unsigned int FileService::DEFAULT_SCAN_SETTING = 0; -const unsigned long FileService::DEFAULT_MAX_CACHE_SIZE = 0; /* 0=disabled */ -const unsigned long FileService::DEFAULT_MAX_CHUNK_SIZE = 0; /* 0=disabled */ -boost::once_flag FileService::m_mime_types_init_flag = BOOST_ONCE_INIT; -FileService::MIMETypeMap *FileService::m_mime_types_ptr = NULL; +const std::string FileService::DEFAULT_MIME_TYPE("application/octet-stream"); +const unsigned int FileService::DEFAULT_CACHE_SETTING = 1; +const unsigned int FileService::DEFAULT_SCAN_SETTING = 0; +const unsigned long FileService::DEFAULT_MAX_CACHE_SIZE = 0; /* 0=disabled */ +const unsigned long FileService::DEFAULT_MAX_CHUNK_SIZE = 0; /* 0=disabled */ +boost::once_flag FileService::m_mime_types_init_flag = BOOST_ONCE_INIT; +FileService::MIMETypeMap *FileService::m_mime_types_ptr = NULL; // FileService member functions FileService::FileService(void) - : m_logger(PION_GET_LOGGER("pion.FileService")), - m_cache_setting(DEFAULT_CACHE_SETTING), - m_scan_setting(DEFAULT_SCAN_SETTING), - m_max_cache_size(DEFAULT_MAX_CACHE_SIZE), - m_max_chunk_size(DEFAULT_MAX_CHUNK_SIZE), - m_writable(false) + : m_logger(PION_GET_LOGGER("pion.FileService")), + m_cache_setting(DEFAULT_CACHE_SETTING), + m_scan_setting(DEFAULT_SCAN_SETTING), + m_max_cache_size(DEFAULT_MAX_CACHE_SIZE), + m_max_chunk_size(DEFAULT_MAX_CHUNK_SIZE), + m_writable(false) {} -void FileService::setOption(const std::string& name, const std::string& value) +void FileService::set_option(const std::string& name, const std::string& value) { - if (name == "directory") { - m_directory = value; - //PionPlugin::checkCygwinPath(m_directory, value); - // make sure that the directory exists - if (! boost::filesystem::exists(m_directory) ) - throw DirectoryNotFoundException(value); - if (! boost::filesystem::is_directory(m_directory) ) - throw NotADirectoryException(value); - } else if (name == "file") { - m_file = value; - //PionPlugin::checkCygwinPath(m_file, value); - // make sure that the directory exists - if (! boost::filesystem::exists(m_file) ) - throw FileNotFoundException(value); - if (boost::filesystem::is_directory(m_file) ) - throw NotAFileException(value); - } else if (name == "cache") { - if (value == "0") { - m_cache_setting = 0; - } else if (value == "1") { - m_cache_setting = 1; - } else if (value == "2") { - m_cache_setting = 2; - } else { - throw InvalidCacheException(value); - } - } else if (name == "scan") { - if (value == "0") { - m_scan_setting = 0; - } else if (value == "1") { - m_scan_setting = 1; - } else if (value == "2") { - m_scan_setting = 2; - } else if (value == "3") { - m_scan_setting = 3; - } else { - throw InvalidScanException(value); - } - } else if (name == "max_chunk_size") { - m_max_chunk_size = boost::lexical_cast(value); - } else if (name == "writable") { - if (value == "true") { - m_writable = true; - } else if (value == "false") { - m_writable = false; - } else { - throw InvalidOptionValueException("writable", value); - } - } else { - throw UnknownOptionException(name); - } -} - -void FileService::operator()(HTTPRequestPtr& request, TCPConnectionPtr& tcp_conn) -{ - // get the relative resource path for the request - const std::string relative_path(getRelativeResource(request->getResource())); - - // determine the path of the file being requested - boost::filesystem::path file_path; - if (relative_path.empty()) { - // request matches resource exactly - - if (m_file.empty()) { - // no file is specified, either in the request or in the options - PION_LOG_WARN(m_logger, "No file option defined (" - << getResource() << ")"); - sendNotFoundResponse(request, tcp_conn); - return; - } else { - file_path = m_file; - } - } else { - // request does not match resource - - if (m_directory.empty()) { - // no directory is specified for the relative file - PION_LOG_WARN(m_logger, "No directory option defined (" - << getResource() << "): " << relative_path); - sendNotFoundResponse(request, tcp_conn); - return; - } else { - file_path = m_directory / relative_path; - } - } - - // make sure that the requested file is within the configured directory - file_path.normalize(); - std::string string = file_path.string(); - if (string.find(m_directory.string()) != 0) { - PION_LOG_WARN(m_logger, "Request for file outside of directory (" - << getResource() << "): " << relative_path); - static const std::string FORBIDDEN_HTML_START = - "\n" - "403 Forbidden\n" - "\n" - "

Forbidden

\n" - "

The requested URL "; - static const std::string FORBIDDEN_HTML_FINISH = - " is not in the configured directory.

\n" - "\n"; - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, - boost::bind(&TCPConnection::finish, tcp_conn))); - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_FORBIDDEN); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_FORBIDDEN); - if (request->getMethod() != HTTPTypes::REQUEST_METHOD_HEAD) { - writer->writeNoCopy(FORBIDDEN_HTML_START); - writer << request->getResource(); - writer->writeNoCopy(FORBIDDEN_HTML_FINISH); - } - writer->send(); - return; - } - - // requests specifying directories are not allowed - if (boost::filesystem::is_directory(file_path)) { - PION_LOG_WARN(m_logger, "Request for directory (" - << getResource() << "): " << relative_path); - static const std::string FORBIDDEN_HTML_START = - "\n" - "403 Forbidden\n" - "\n" - "

Forbidden

\n" - "

The requested URL "; - static const std::string FORBIDDEN_HTML_FINISH = - " is a directory.

\n" - "\n"; - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, - boost::bind(&TCPConnection::finish, tcp_conn))); - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_FORBIDDEN); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_FORBIDDEN); - if (request->getMethod() != HTTPTypes::REQUEST_METHOD_HEAD) { - writer->writeNoCopy(FORBIDDEN_HTML_START); - writer << request->getResource(); - writer->writeNoCopy(FORBIDDEN_HTML_FINISH); - } - writer->send(); - return; - } - - if (request->getMethod() == HTTPTypes::REQUEST_METHOD_GET - || request->getMethod() == HTTPTypes::REQUEST_METHOD_HEAD) - { - // the type of response we will send - enum ResponseType { - RESPONSE_UNDEFINED, // initial state until we know how to respond - RESPONSE_OK, // normal response that includes the file's content - RESPONSE_HEAD_OK, // response to HEAD request (would send file's content) - RESPONSE_NOT_FOUND, // Not Found (404) - RESPONSE_NOT_MODIFIED // Not Modified (304) response to If-Modified-Since - } response_type = RESPONSE_UNDEFINED; - - // used to hold our response information - DiskFile response_file; - - // get the If-Modified-Since request header - const std::string if_modified_since(request->getHeader(HTTPTypes::HEADER_IF_MODIFIED_SINCE)); - - // check the cache for a corresponding entry (if enabled) - // note that m_cache_setting may equal 0 if m_scan_setting == 1 - if (m_cache_setting > 0 || m_scan_setting > 0) { - - // search for a matching cache entry - boost::mutex::scoped_lock cache_lock(m_cache_mutex); - CacheMap::iterator cache_itr = m_cache_map.find(relative_path); - - if (cache_itr == m_cache_map.end()) { - // no existing cache entries found - - if (m_scan_setting == 1 || m_scan_setting == 3) { - // do not allow files to be added; - // all requests must correspond with existing cache entries - // since no match was found, just return file not found - PION_LOG_WARN(m_logger, "Request for unknown file (" - << getResource() << "): " << relative_path); - response_type = RESPONSE_NOT_FOUND; - } else { - PION_LOG_DEBUG(m_logger, "No cache entry for request (" - << getResource() << "): " << relative_path); - } - - } else { - // found an existing cache entry - - PION_LOG_DEBUG(m_logger, "Found cache entry for request (" - << getResource() << "): " << relative_path); - - if (m_cache_setting == 0) { - // cache is disabled - - // copy & re-use file_path and mime_type - response_file.setFilePath(cache_itr->second.getFilePath()); - response_file.setMimeType(cache_itr->second.getMimeType()); - - // get the file_size and last_modified timestamp - response_file.update(); - - // just compare strings for simplicity (parsing this date format sucks!) - if (response_file.getLastModifiedString() == if_modified_since) { - // no need to read the file; the modified times match! - response_type = RESPONSE_NOT_MODIFIED; - } else { - if (request->getMethod() == HTTPTypes::REQUEST_METHOD_HEAD) { - response_type = RESPONSE_HEAD_OK; - } else { - response_type = RESPONSE_OK; - PION_LOG_DEBUG(m_logger, "Cache disabled, reading file (" - << getResource() << "): " << relative_path); - } - } - - } else { - // cache is enabled - - // true if the entry was updated (used for log message) - bool cache_was_updated = false; - - if (cache_itr->second.getLastModified() == 0) { - - // cache file for the first time - cache_was_updated = true; - cache_itr->second.update(); - if (m_max_cache_size==0 || cache_itr->second.getFileSize() <= m_max_cache_size) { - // read the file (may throw exception) - cache_itr->second.read(); - } else { - cache_itr->second.resetFileContent(); - } - - } else if (m_cache_setting == 1) { - - // check if file has been updated (may throw exception) - cache_was_updated = cache_itr->second.checkUpdated(); - - } // else cache_setting == 2 (use existing values) - - // get the response type - if (cache_itr->second.getLastModifiedString() == if_modified_since) { - response_type = RESPONSE_NOT_MODIFIED; - } else if (request->getMethod() == HTTPTypes::REQUEST_METHOD_HEAD) { - response_type = RESPONSE_HEAD_OK; - } else { - response_type = RESPONSE_OK; - } - - // copy cache contents so that we can release the mutex - response_file = cache_itr->second; - - PION_LOG_DEBUG(m_logger, (cache_was_updated ? "Updated" : "Using") - << " cache entry for request (" - << getResource() << "): " << relative_path); - } - } - } - - if (response_type == RESPONSE_UNDEFINED) { - // make sure that the file exists - if (! boost::filesystem::exists(file_path)) { - PION_LOG_WARN(m_logger, "File not found (" - << getResource() << "): " << relative_path); - sendNotFoundResponse(request, tcp_conn); - return; - } - - response_file.setFilePath(file_path); - - PION_LOG_DEBUG(m_logger, "Found file for request (" - << getResource() << "): " << relative_path); - - // determine the MIME type - response_file.setMimeType(findMIMEType( response_file.getFilePath().string() )); - - // get the file_size and last_modified timestamp - response_file.update(); - - // just compare strings for simplicity (parsing this date format sucks!) - if (response_file.getLastModifiedString() == if_modified_since) { - // no need to read the file; the modified times match! - response_type = RESPONSE_NOT_MODIFIED; - } else if (request->getMethod() == HTTPTypes::REQUEST_METHOD_HEAD) { - response_type = RESPONSE_HEAD_OK; - } else { - response_type = RESPONSE_OK; - if (m_cache_setting != 0) { - if (m_max_cache_size==0 || response_file.getFileSize() <= m_max_cache_size) { - // read the file (may throw exception) - response_file.read(); - } - // add new entry to the cache - PION_LOG_DEBUG(m_logger, "Adding cache entry for request (" - << getResource() << "): " << relative_path); - boost::mutex::scoped_lock cache_lock(m_cache_mutex); - m_cache_map.insert( std::make_pair(relative_path, response_file) ); - } - } - } - - if (response_type == RESPONSE_OK) { - // use DiskFileSender to send a file - DiskFileSenderPtr sender_ptr(DiskFileSender::create(response_file, - request, tcp_conn, - m_max_chunk_size)); - sender_ptr->send(); - } else if (response_type == RESPONSE_NOT_FOUND) { - sendNotFoundResponse(request, tcp_conn); - } else { - // sending headers only -> use our own response object - - // prepare a response and set the Content-Type - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, - boost::bind(&TCPConnection::finish, tcp_conn))); - writer->getResponse().setContentType(response_file.getMimeType()); - - // set Last-Modified header to enable client-side caching - writer->getResponse().addHeader(HTTPTypes::HEADER_LAST_MODIFIED, - response_file.getLastModifiedString()); - - std::stringstream out; - out << response_file.getFileSize(); - writer->getResponse().addHeader(HTTPTypes::HEADER_CONTENT_LENGTH, out.str()); - - switch(response_type) { - case RESPONSE_UNDEFINED: - case RESPONSE_NOT_FOUND: - case RESPONSE_OK: - // this should never happen - throw UndefinedResponseException(request->getResource()); - break; - case RESPONSE_NOT_MODIFIED: - // set "Not Modified" response - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_MODIFIED); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_MODIFIED); - break; - case RESPONSE_HEAD_OK: - // set "OK" response (not really necessary since this is the default) - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_OK); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_OK); - break; - } - - // send the response - writer->send(); - } - } else if (request->getMethod() == HTTPTypes::REQUEST_METHOD_POST - || request->getMethod() == HTTPTypes::REQUEST_METHOD_PUT - || request->getMethod() == HTTPTypes::REQUEST_METHOD_DELETE) - { - // If not writable, then send 405 (Method Not Allowed) response for POST, PUT or DELETE requests. - if (!m_writable) { - static const std::string NOT_ALLOWED_HTML_START = - "\n" - "405 Method Not Allowed\n" - "\n" - "

Not Allowed

\n" - "

The requested method "; - static const std::string NOT_ALLOWED_HTML_FINISH = - " is not allowed on this server.

\n" - "\n"; - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, - boost::bind(&TCPConnection::finish, tcp_conn))); - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_METHOD_NOT_ALLOWED); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED); - writer->writeNoCopy(NOT_ALLOWED_HTML_START); - writer << request->getMethod(); - writer->writeNoCopy(NOT_ALLOWED_HTML_FINISH); - writer->getResponse().addHeader("Allow", "GET, HEAD"); - writer->send(); - } else { - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, - boost::bind(&TCPConnection::finish, tcp_conn))); - if (request->getMethod() == HTTPTypes::REQUEST_METHOD_POST - || request->getMethod() == HTTPTypes::REQUEST_METHOD_PUT) - { - if (boost::filesystem::exists(file_path)) { - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NO_CONTENT); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NO_CONTENT); - } else { - // The file doesn't exist yet, so it will be created below, unless the - // directory of the requested file also doesn't exist. - if (!boost::filesystem::exists(file_path.branch_path())) { - static const std::string NOT_FOUND_HTML_START = - "\n" - "404 Not Found\n" - "\n" - "

Not Found

\n" - "

The directory of the requested URL "; - static const std::string NOT_FOUND_HTML_FINISH = - " was not found on this server.

\n" - "\n"; - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); - writer->writeNoCopy(NOT_FOUND_HTML_START); - writer << request->getResource(); - writer->writeNoCopy(NOT_FOUND_HTML_FINISH); - writer->send(); - return; - } - static const std::string CREATED_HTML_START = - "\n" - "201 Created\n" - "\n" - "

Created

\n" - "

"; - static const std::string CREATED_HTML_FINISH = - "

\n" - "\n"; - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_CREATED); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_CREATED); - writer->getResponse().addHeader(HTTPTypes::HEADER_LOCATION, request->getResource()); - writer->writeNoCopy(CREATED_HTML_START); - writer << request->getResource(); - writer->writeNoCopy(CREATED_HTML_FINISH); - } - std::ios_base::openmode mode = request->getMethod() == HTTPTypes::REQUEST_METHOD_POST? - std::ios::app : std::ios::out; - boost::filesystem::ofstream file_stream(file_path, mode); - file_stream.write(request->getContent(), request->getContentLength()); - file_stream.close(); - if (!boost::filesystem::exists(file_path)) { - static const std::string PUT_FAILED_HTML_START = - "\n" - "500 Server Error\n" - "\n" - "

Server Error

\n" - "

Error writing to "; - static const std::string PUT_FAILED_HTML_FINISH = - ".

\n" - "\n"; - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_SERVER_ERROR); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_SERVER_ERROR); - writer->writeNoCopy(PUT_FAILED_HTML_START); - writer << request->getResource(); - writer->writeNoCopy(PUT_FAILED_HTML_FINISH); - } - writer->send(); - } else if (request->getMethod() == HTTPTypes::REQUEST_METHOD_DELETE) { - if (!boost::filesystem::exists(file_path)) { - sendNotFoundResponse(request, tcp_conn); - } else { - try { - boost::filesystem::remove(file_path); - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NO_CONTENT); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NO_CONTENT); - writer->send(); - } catch (...) { - static const std::string DELETE_FAILED_HTML_START = - "\n" - "500 Server Error\n" - "\n" - "

Server Error

\n" - "

Could not delete "; - static const std::string DELETE_FAILED_HTML_FINISH = - ".

\n" - "\n"; - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_SERVER_ERROR); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_SERVER_ERROR); - writer->writeNoCopy(DELETE_FAILED_HTML_START); - writer << request->getResource(); - writer->writeNoCopy(DELETE_FAILED_HTML_FINISH); - writer->send(); - } - } - } else { - // This should never be reached. - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_SERVER_ERROR); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_SERVER_ERROR); - writer->send(); - } - } - } - // Any method not handled above is unimplemented. - else { - static const std::string NOT_IMPLEMENTED_HTML_START = - "\n" - "501 Not Implemented\n" - "\n" - "

Not Implemented

\n" - "

The requested method "; - static const std::string NOT_IMPLEMENTED_HTML_FINISH = - " is not implemented on this server.

\n" - "\n"; - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, - boost::bind(&TCPConnection::finish, tcp_conn))); - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_IMPLEMENTED); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_IMPLEMENTED); - writer->writeNoCopy(NOT_IMPLEMENTED_HTML_START); - writer << request->getMethod(); - writer->writeNoCopy(NOT_IMPLEMENTED_HTML_FINISH); - writer->send(); - } -} - -void FileService::sendNotFoundResponse(HTTPRequestPtr& http_request, - TCPConnectionPtr& tcp_conn) -{ - static const std::string NOT_FOUND_HTML_START = - "\n" - "404 Not Found\n" - "\n" - "

Not Found

\n" - "

The requested URL "; - static const std::string NOT_FOUND_HTML_FINISH = - " was not found on this server.

\n" - "\n"; - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *http_request, - boost::bind(&TCPConnection::finish, tcp_conn))); - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_NOT_FOUND); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_NOT_FOUND); - if (http_request->getMethod() != HTTPTypes::REQUEST_METHOD_HEAD) { - writer->writeNoCopy(NOT_FOUND_HTML_START); - writer << http_request->getResource(); - writer->writeNoCopy(NOT_FOUND_HTML_FINISH); - } - writer->send(); + if (name == "directory") { + m_directory = value; + m_directory.normalize(); + plugin::check_cygwin_path(m_directory, value); + // make sure that the directory exists + if (! boost::filesystem::exists(m_directory) || ! boost::filesystem::is_directory(m_directory)) { +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + const std::string dir_name = m_directory.string(); +#else + const std::string dir_name = m_directory.directory_string(); +#endif + BOOST_THROW_EXCEPTION( error::directory_not_found() << error::errinfo_dir_name(dir_name) ); + } + } else if (name == "file") { + m_file = value; + plugin::check_cygwin_path(m_file, value); + // make sure that the directory exists + if (! boost::filesystem::exists(m_file) || boost::filesystem::is_directory(m_file)) { +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + const std::string file_name = m_file.string(); +#else + const std::string file_name = m_file.file_string(); +#endif + BOOST_THROW_EXCEPTION( error::file_not_found() << error::errinfo_file_name(file_name) ); + } + } else if (name == "cache") { + if (value == "0") { + m_cache_setting = 0; + } else if (value == "1") { + m_cache_setting = 1; + } else if (value == "2") { + m_cache_setting = 2; + } else { + BOOST_THROW_EXCEPTION( error::bad_arg() << error::errinfo_arg_name(name) ); + } + } else if (name == "scan") { + if (value == "0") { + m_scan_setting = 0; + } else if (value == "1") { + m_scan_setting = 1; + } else if (value == "2") { + m_scan_setting = 2; + } else if (value == "3") { + m_scan_setting = 3; + } else { + BOOST_THROW_EXCEPTION( error::bad_arg() << error::errinfo_arg_name(name) ); + } + } else if (name == "max_chunk_size") { + m_max_chunk_size = boost::lexical_cast(value); + } else if (name == "writable") { + if (value == "true") { + m_writable = true; + } else if (value == "false") { + m_writable = false; + } else { + BOOST_THROW_EXCEPTION( error::bad_arg() << error::errinfo_arg_name(name) ); + } + } else { + BOOST_THROW_EXCEPTION( error::bad_arg() << error::errinfo_arg_name(name) ); + } +} + +void FileService::operator()(const http::request_ptr& http_request_ptr, const tcp::connection_ptr& tcp_conn) +{ + // get the relative resource path for the request + const std::string relative_path(get_relative_resource(http_request_ptr->get_resource())); + + // determine the path of the file being requested + boost::filesystem::path file_path; + if (relative_path.empty()) { + // request matches resource exactly + + if (m_file.empty()) { + // no file is specified, either in the request or in the options + PION_LOG_WARN(m_logger, "No file option defined (" + << get_resource() << ")"); + sendNotFoundResponse(http_request_ptr, tcp_conn); + return; + } else { + file_path = m_file; + } + } else { + // request does not match resource + + if (m_directory.empty()) { + // no directory is specified for the relative file + PION_LOG_WARN(m_logger, "No directory option defined (" + << get_resource() << "): " << relative_path); + sendNotFoundResponse(http_request_ptr, tcp_conn); + return; + } else { + file_path = m_directory / relative_path; + } + } + + // make sure that the requested file is within the configured directory + file_path.normalize(); +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + std::string file_string = file_path.string(); + if (file_string.find(m_directory.string()) != 0) { +#else + std::string file_string = file_path.file_string(); + if (file_string.find(m_directory.directory_string()) != 0) { +#endif + PION_LOG_WARN(m_logger, "Request for file outside of directory (" + << get_resource() << "): " << relative_path); + static const std::string FORBIDDEN_HTML_START = + "\n" + "403 Forbidden\n" + "\n" + "

Forbidden

\n" + "

The requested URL "; + static const std::string FORBIDDEN_HTML_FINISH = + " is not in the configured directory.

\n" + "\n"; + http::response_writer_ptr writer(http::response_writer::create(tcp_conn, *http_request_ptr, + boost::bind(&tcp::connection::finish, tcp_conn))); + writer->get_response().set_status_code(http::types::RESPONSE_CODE_FORBIDDEN); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_FORBIDDEN); + if (http_request_ptr->get_method() != http::types::REQUEST_METHOD_HEAD) { + writer->write_no_copy(FORBIDDEN_HTML_START); + writer << algorithm::xml_encode(http_request_ptr->get_resource()); + writer->write_no_copy(FORBIDDEN_HTML_FINISH); + } + writer->send(); + return; + } + + // requests specifying directories are not allowed + if (boost::filesystem::is_directory(file_path)) { + PION_LOG_WARN(m_logger, "Request for directory (" + << get_resource() << "): " << relative_path); + static const std::string FORBIDDEN_HTML_START = + "\n" + "403 Forbidden\n" + "\n" + "

Forbidden

\n" + "

The requested URL "; + static const std::string FORBIDDEN_HTML_FINISH = + " is a directory.

\n" + "\n"; + http::response_writer_ptr writer(http::response_writer::create(tcp_conn, *http_request_ptr, + boost::bind(&tcp::connection::finish, tcp_conn))); + writer->get_response().set_status_code(http::types::RESPONSE_CODE_FORBIDDEN); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_FORBIDDEN); + if (http_request_ptr->get_method() != http::types::REQUEST_METHOD_HEAD) { + writer->write_no_copy(FORBIDDEN_HTML_START); + writer << algorithm::xml_encode(http_request_ptr->get_resource()); + writer->write_no_copy(FORBIDDEN_HTML_FINISH); + } + writer->send(); + return; + } + + if (http_request_ptr->get_method() == http::types::REQUEST_METHOD_GET + || http_request_ptr->get_method() == http::types::REQUEST_METHOD_HEAD) + { + // the type of response we will send + enum ResponseType { + RESPONSE_UNDEFINED, // initial state until we know how to respond + RESPONSE_OK, // normal response that includes the file's content + RESPONSE_HEAD_OK, // response to HEAD request (would send file's content) + RESPONSE_NOT_FOUND, // Not Found (404) + RESPONSE_NOT_MODIFIED // Not Modified (304) response to If-Modified-Since + } response_type = RESPONSE_UNDEFINED; + + // used to hold our response information + DiskFile response_file; + + // get the If-Modified-Since request header + const std::string if_modified_since(http_request_ptr->get_header(http::types::HEADER_IF_MODIFIED_SINCE)); + + // check the cache for a corresponding entry (if enabled) + // note that m_cache_setting may equal 0 if m_scan_setting == 1 + if (m_cache_setting > 0 || m_scan_setting > 0) { + + // search for a matching cache entry + boost::mutex::scoped_lock cache_lock(m_cache_mutex); + CacheMap::iterator cache_itr = m_cache_map.find(relative_path); + + if (cache_itr == m_cache_map.end()) { + // no existing cache entries found + + if (m_scan_setting == 1 || m_scan_setting == 3) { + // do not allow files to be added; + // all requests must correspond with existing cache entries + // since no match was found, just return file not found + PION_LOG_WARN(m_logger, "Request for unknown file (" + << get_resource() << "): " << relative_path); + response_type = RESPONSE_NOT_FOUND; + } else { + PION_LOG_DEBUG(m_logger, "No cache entry for request (" + << get_resource() << "): " << relative_path); + } + + } else { + // found an existing cache entry + + PION_LOG_DEBUG(m_logger, "Found cache entry for request (" + << get_resource() << "): " << relative_path); + + if (m_cache_setting == 0) { + // cache is disabled + + // copy & re-use file_path and mime_type + response_file.setFilePath(cache_itr->second.getFilePath()); + response_file.setMimeType(cache_itr->second.getMimeType()); + + // get the file_size and last_modified timestamp + response_file.update(); + + // just compare strings for simplicity (parsing this date format sucks!) + if (response_file.getLastModifiedString() == if_modified_since) { + // no need to read the file; the modified times match! + response_type = RESPONSE_NOT_MODIFIED; + } else { + if (http_request_ptr->get_method() == http::types::REQUEST_METHOD_HEAD) { + response_type = RESPONSE_HEAD_OK; + } else { + response_type = RESPONSE_OK; + PION_LOG_DEBUG(m_logger, "Cache disabled, reading file (" + << get_resource() << "): " << relative_path); + } + } + + } else { + // cache is enabled + + // true if the entry was updated (used for log message) + bool cache_was_updated = false; + + if (cache_itr->second.getLastModified() == 0) { + + // cache file for the first time + cache_was_updated = true; + cache_itr->second.update(); + if (m_max_cache_size==0 || cache_itr->second.getFileSize() <= m_max_cache_size) { + // read the file (may throw exception) + cache_itr->second.read(); + } else { + cache_itr->second.resetFileContent(); + } + + } else if (m_cache_setting == 1) { + + // check if file has been updated (may throw exception) + cache_was_updated = cache_itr->second.checkUpdated(); + + } // else cache_setting == 2 (use existing values) + + // get the response type + if (cache_itr->second.getLastModifiedString() == if_modified_since) { + response_type = RESPONSE_NOT_MODIFIED; + } else if (http_request_ptr->get_method() == http::types::REQUEST_METHOD_HEAD) { + response_type = RESPONSE_HEAD_OK; + } else { + response_type = RESPONSE_OK; + } + + // copy cache contents so that we can release the mutex + response_file = cache_itr->second; + + // check if max size has been exceeded + if (cache_was_updated && m_max_cache_size > 0 && cache_itr->second.getFileSize() > m_max_cache_size) { + cache_itr->second.resetFileContent(); + } + + PION_LOG_DEBUG(m_logger, (cache_was_updated ? "Updated" : "Using") + << " cache entry for request (" + << get_resource() << "): " << relative_path); + } + } + } + + if (response_type == RESPONSE_UNDEFINED) { + // make sure that the file exists + if (! boost::filesystem::exists(file_path)) { + PION_LOG_WARN(m_logger, "File not found (" + << get_resource() << "): " << relative_path); + sendNotFoundResponse(http_request_ptr, tcp_conn); + return; + } + + response_file.setFilePath(file_path); + + PION_LOG_DEBUG(m_logger, "Found file for request (" + << get_resource() << "): " << relative_path); + + // determine the MIME type +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + response_file.setMimeType(findMIMEType( response_file.getFilePath().filename().string())); +#else + response_file.setMimeType(findMIMEType( response_file.getFilePath().leaf() )); +#endif + + // get the file_size and last_modified timestamp + response_file.update(); + + // just compare strings for simplicity (parsing this date format sucks!) + if (response_file.getLastModifiedString() == if_modified_since) { + // no need to read the file; the modified times match! + response_type = RESPONSE_NOT_MODIFIED; + } else if (http_request_ptr->get_method() == http::types::REQUEST_METHOD_HEAD) { + response_type = RESPONSE_HEAD_OK; + } else { + response_type = RESPONSE_OK; + if (m_cache_setting != 0) { + if (m_max_cache_size==0 || response_file.getFileSize() <= m_max_cache_size) { + // read the file (may throw exception) + response_file.read(); + } + // add new entry to the cache + PION_LOG_DEBUG(m_logger, "Adding cache entry for request (" + << get_resource() << "): " << relative_path); + boost::mutex::scoped_lock cache_lock(m_cache_mutex); + m_cache_map.insert( std::make_pair(relative_path, response_file) ); + } + } + } + + if (response_type == RESPONSE_OK) { + // use DiskFileSender to send a file + DiskFileSenderPtr sender_ptr(DiskFileSender::create(response_file, + http_request_ptr, tcp_conn, + m_max_chunk_size)); + sender_ptr->send(); + } else if (response_type == RESPONSE_NOT_FOUND) { + sendNotFoundResponse(http_request_ptr, tcp_conn); + } else { + // sending headers only -> use our own response object + + // prepare a response and set the Content-Type + http::response_writer_ptr writer(http::response_writer::create(tcp_conn, *http_request_ptr, + boost::bind(&tcp::connection::finish, tcp_conn))); + writer->get_response().set_content_type(response_file.getMimeType()); + + // set Last-Modified header to enable client-side caching + writer->get_response().add_header(http::types::HEADER_LAST_MODIFIED, + response_file.getLastModifiedString()); + + switch(response_type) { + case RESPONSE_UNDEFINED: + case RESPONSE_NOT_FOUND: + case RESPONSE_OK: + // this should never happen + BOOST_ASSERT(false); + break; + case RESPONSE_NOT_MODIFIED: + // set "Not Modified" response + writer->get_response().set_status_code(http::types::RESPONSE_CODE_NOT_MODIFIED); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_NOT_MODIFIED); + break; + case RESPONSE_HEAD_OK: + // set "OK" response (not really necessary since this is the default) + writer->get_response().set_status_code(http::types::RESPONSE_CODE_OK); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_OK); + break; + } + + // send the response + writer->send(); + } + } else if (http_request_ptr->get_method() == http::types::REQUEST_METHOD_POST + || http_request_ptr->get_method() == http::types::REQUEST_METHOD_PUT + || http_request_ptr->get_method() == http::types::REQUEST_METHOD_DELETE) + { + // If not writable, then send 405 (Method Not Allowed) response for POST, PUT or DELETE requests. + if (!m_writable) { + static const std::string NOT_ALLOWED_HTML_START = + "\n" + "405 Method Not Allowed\n" + "\n" + "

Not Allowed

\n" + "

The requested method "; + static const std::string NOT_ALLOWED_HTML_FINISH = + " is not allowed on this server.

\n" + "\n"; + http::response_writer_ptr writer(http::response_writer::create(tcp_conn, *http_request_ptr, + boost::bind(&tcp::connection::finish, tcp_conn))); + writer->get_response().set_status_code(http::types::RESPONSE_CODE_METHOD_NOT_ALLOWED); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED); + writer->write_no_copy(NOT_ALLOWED_HTML_START); + writer << algorithm::xml_encode(http_request_ptr->get_method()); + writer->write_no_copy(NOT_ALLOWED_HTML_FINISH); + writer->get_response().add_header("Allow", "GET, HEAD"); + writer->send(); + } else { + http::response_writer_ptr writer(http::response_writer::create(tcp_conn, *http_request_ptr, + boost::bind(&tcp::connection::finish, tcp_conn))); + if (http_request_ptr->get_method() == http::types::REQUEST_METHOD_POST + || http_request_ptr->get_method() == http::types::REQUEST_METHOD_PUT) + { + if (boost::filesystem::exists(file_path)) { + writer->get_response().set_status_code(http::types::RESPONSE_CODE_NO_CONTENT); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_NO_CONTENT); + } else { + // The file doesn't exist yet, so it will be created below, unless the + // directory of the requested file also doesn't exist. + if (!boost::filesystem::exists(file_path.branch_path())) { + static const std::string NOT_FOUND_HTML_START = + "\n" + "404 Not Found\n" + "\n" + "

Not Found

\n" + "

The directory of the requested URL "; + static const std::string NOT_FOUND_HTML_FINISH = + " was not found on this server.

\n" + "\n"; + writer->get_response().set_status_code(http::types::RESPONSE_CODE_NOT_FOUND); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_NOT_FOUND); + writer->write_no_copy(NOT_FOUND_HTML_START); + writer << algorithm::xml_encode(http_request_ptr->get_resource()); + writer->write_no_copy(NOT_FOUND_HTML_FINISH); + writer->send(); + return; + } + static const std::string CREATED_HTML_START = + "\n" + "201 Created\n" + "\n" + "

Created

\n" + "

"; + static const std::string CREATED_HTML_FINISH = + "

\n" + "\n"; + writer->get_response().set_status_code(http::types::RESPONSE_CODE_CREATED); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_CREATED); + writer->get_response().add_header(http::types::HEADER_LOCATION, http_request_ptr->get_resource()); + writer->write_no_copy(CREATED_HTML_START); + writer << algorithm::xml_encode(http_request_ptr->get_resource()); + writer->write_no_copy(CREATED_HTML_FINISH); + } + std::ios_base::openmode mode = http_request_ptr->get_method() == http::types::REQUEST_METHOD_POST? + std::ios::app : std::ios::out; + boost::filesystem::ofstream file_stream(file_path, mode); + file_stream.write(http_request_ptr->get_content(), http_request_ptr->get_content_length()); + file_stream.close(); + if (!boost::filesystem::exists(file_path)) { + static const std::string PUT_FAILED_HTML_START = + "\n" + "500 Server Error\n" + "\n" + "

Server Error

\n" + "

Error writing to "; + static const std::string PUT_FAILED_HTML_FINISH = + ".

\n" + "\n"; + writer->get_response().set_status_code(http::types::RESPONSE_CODE_SERVER_ERROR); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_SERVER_ERROR); + writer->write_no_copy(PUT_FAILED_HTML_START); + writer << algorithm::xml_encode(http_request_ptr->get_resource()); + writer->write_no_copy(PUT_FAILED_HTML_FINISH); + } + writer->send(); + } else if (http_request_ptr->get_method() == http::types::REQUEST_METHOD_DELETE) { + if (!boost::filesystem::exists(file_path)) { + sendNotFoundResponse(http_request_ptr, tcp_conn); + } else { + try { + boost::filesystem::remove(file_path); + writer->get_response().set_status_code(http::types::RESPONSE_CODE_NO_CONTENT); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_NO_CONTENT); + writer->send(); + } catch (std::exception& e) { + static const std::string DELETE_FAILED_HTML_START = + "\n" + "500 Server Error\n" + "\n" + "

Server Error

\n" + "

Could not delete "; + static const std::string DELETE_FAILED_HTML_FINISH = + ".

\n" + "\n"; + writer->get_response().set_status_code(http::types::RESPONSE_CODE_SERVER_ERROR); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_SERVER_ERROR); + writer->write_no_copy(DELETE_FAILED_HTML_START); + writer << algorithm::xml_encode(http_request_ptr->get_resource()) + << ".

" + << boost::diagnostic_information(e); + writer->write_no_copy(DELETE_FAILED_HTML_FINISH); + writer->send(); + } + } + } else { + // This should never be reached. + writer->get_response().set_status_code(http::types::RESPONSE_CODE_SERVER_ERROR); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_SERVER_ERROR); + writer->send(); + } + } + } + // Any method not handled above is unimplemented. + else { + static const std::string NOT_IMPLEMENTED_HTML_START = + "\n" + "501 Not Implemented\n" + "\n" + "

Not Implemented

\n" + "

The requested method "; + static const std::string NOT_IMPLEMENTED_HTML_FINISH = + " is not implemented on this server.

\n" + "\n"; + http::response_writer_ptr writer(http::response_writer::create(tcp_conn, *http_request_ptr, + boost::bind(&tcp::connection::finish, tcp_conn))); + writer->get_response().set_status_code(http::types::RESPONSE_CODE_NOT_IMPLEMENTED); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_NOT_IMPLEMENTED); + writer->write_no_copy(NOT_IMPLEMENTED_HTML_START); + writer << algorithm::xml_encode(http_request_ptr->get_method()); + writer->write_no_copy(NOT_IMPLEMENTED_HTML_FINISH); + writer->send(); + } +} + +void FileService::sendNotFoundResponse(const http::request_ptr& http_request_ptr, + const tcp::connection_ptr& tcp_conn) +{ + static const std::string NOT_FOUND_HTML_START = + "\n" + "404 Not Found\n" + "\n" + "

Not Found

\n" + "

The requested URL "; + static const std::string NOT_FOUND_HTML_FINISH = + " was not found on this server.

\n" + "\n"; + http::response_writer_ptr writer(http::response_writer::create(tcp_conn, *http_request_ptr, + boost::bind(&tcp::connection::finish, tcp_conn))); + writer->get_response().set_status_code(http::types::RESPONSE_CODE_NOT_FOUND); + writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_NOT_FOUND); + if (http_request_ptr->get_method() != http::types::REQUEST_METHOD_HEAD) { + writer->write_no_copy(NOT_FOUND_HTML_START); + writer << algorithm::xml_encode(http_request_ptr->get_resource()); + writer->write_no_copy(NOT_FOUND_HTML_FINISH); + } + writer->send(); } void FileService::start(void) { - PION_LOG_DEBUG(m_logger, "Starting up resource (" << getResource() << ')'); + PION_LOG_DEBUG(m_logger, "Starting up resource (" << get_resource() << ')'); - // scan directory/file if scan setting != 0 - if (m_scan_setting != 0) { - // force caching if scan == (2 | 3) - if (m_cache_setting == 0 && m_scan_setting > 1) - m_cache_setting = 1; - - boost::mutex::scoped_lock cache_lock(m_cache_mutex); - - // add entry for file if one is defined - if (! m_file.empty()) { - // use empty relative_path for file option - // use placeholder entry (do not pre-populate) if scan == 1 - addCacheEntry("", m_file, m_scan_setting == 1); - } - - // scan directory if one is defined - if (! m_directory.empty()) - scanDirectory(m_directory); - } + // scan directory/file if scan setting != 0 + if (m_scan_setting != 0) { + // force caching if scan == (2 | 3) + if (m_cache_setting == 0 && m_scan_setting > 1) + m_cache_setting = 1; + + boost::mutex::scoped_lock cache_lock(m_cache_mutex); + + // add entry for file if one is defined + if (! m_file.empty()) { + // use empty relative_path for file option + // use placeholder entry (do not pre-populate) if scan == 1 + addCacheEntry("", m_file, m_scan_setting == 1); + } + + // scan directory if one is defined + if (! m_directory.empty()) + scanDirectory(m_directory); + } } void FileService::stop(void) { - PION_LOG_DEBUG(m_logger, "Shutting down resource (" << getResource() << ')'); - // clear cached files (if started again, it will re-scan) - boost::mutex::scoped_lock cache_lock(m_cache_mutex); - m_cache_map.clear(); + PION_LOG_DEBUG(m_logger, "Shutting down resource (" << get_resource() << ')'); + // clear cached files (if started again, it will re-scan) + boost::mutex::scoped_lock cache_lock(m_cache_mutex); + m_cache_map.clear(); } void FileService::scanDirectory(const boost::filesystem::path& dir_path) { - PION_LOG_DEBUG(m_logger, "Scanning directory (" << getResource() << "): " - << dir_path.string()); - - // iterate through items in the directory - boost::filesystem::directory_iterator end_itr; - for ( boost::filesystem::directory_iterator itr( dir_path ); - itr != end_itr; ++itr ) - { - if ( boost::filesystem::is_directory(*itr) ) { - // item is a sub-directory - - // recursively call scanDirectory() - scanDirectory(*itr); - - } else { - // item is a regular file - - // figure out relative path to the file - std::string file_path_string( itr->path().string() ); - std::string relative_path( file_path_string.substr(m_directory.string().size() + 1) ); - - // add item to cache (use placeholder if scan == 1) - addCacheEntry(relative_path, *itr, m_scan_setting == 1); - } - } +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + PION_LOG_DEBUG(m_logger, "Scanning directory (" << get_resource() << "): " + << dir_path.string()); +#else + PION_LOG_DEBUG(m_logger, "Scanning directory (" << get_resource() << "): " + << dir_path.directory_string()); +#endif + + // iterate through items in the directory + boost::filesystem::directory_iterator end_itr; + for ( boost::filesystem::directory_iterator itr( dir_path ); + itr != end_itr; ++itr ) + { + if ( boost::filesystem::is_directory(*itr) ) { + // item is a sub-directory + + // recursively call scanDirectory() + scanDirectory(*itr); + + } else { + // item is a regular file + + // figure out relative path to the file +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + std::string file_path_string( itr->path().string() ); + std::string relative_path( file_path_string.substr(m_directory.string().size() + 1) ); +#else + std::string file_path_string( itr->path().file_string() ); + std::string relative_path( file_path_string.substr(m_directory.directory_string().size() + 1) ); +#endif + + // add item to cache (use placeholder if scan == 1) + addCacheEntry(relative_path, *itr, m_scan_setting == 1); + } + } } std::pair FileService::addCacheEntry(const std::string& relative_path, - const boost::filesystem::path& file_path, - const bool placeholder) + const boost::filesystem::path& file_path, + const bool placeholder) { - DiskFile cache_entry(file_path, NULL, 0, 0, findMIMEType(file_path.string())); - if (! placeholder) { - cache_entry.update(); - // only read the file if its size is <= max_cache_size - if (m_max_cache_size==0 || cache_entry.getFileSize() <= m_max_cache_size) { - try { cache_entry.read(); } - catch (std::exception&) { - PION_LOG_ERROR(m_logger, "Unable to add file to cache: " - << file_path.string()); - return std::make_pair(m_cache_map.end(), false); - } - } - } - - std::pair add_entry_result - = m_cache_map.insert( std::make_pair(relative_path, cache_entry) ); - - if (add_entry_result.second) { - PION_LOG_DEBUG(m_logger, "Added file to cache: " - << file_path.string()); - } else { - PION_LOG_ERROR(m_logger, "Unable to insert cache entry for file: " - << file_path.string()); - } +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + DiskFile cache_entry(file_path, NULL, 0, 0, findMIMEType(file_path.filename().string())); +#else + DiskFile cache_entry(file_path, NULL, 0, 0, findMIMEType(file_path.leaf())); +#endif + if (! placeholder) { + cache_entry.update(); + // only read the file if its size is <= max_cache_size + if (m_max_cache_size==0 || cache_entry.getFileSize() <= m_max_cache_size) { + try { cache_entry.read(); } + catch (std::exception&) { +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + PION_LOG_ERROR(m_logger, "Unable to add file to cache: " + << file_path.string()); +#else + PION_LOG_ERROR(m_logger, "Unable to add file to cache: " + << file_path.file_string()); +#endif + return std::make_pair(m_cache_map.end(), false); + } + } + } + + std::pair add_entry_result + = m_cache_map.insert( std::make_pair(relative_path, cache_entry) ); + + if (add_entry_result.second) { +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + PION_LOG_DEBUG(m_logger, "Added file to cache: " + << file_path.string()); +#else + PION_LOG_DEBUG(m_logger, "Added file to cache: " + << file_path.file_string()); +#endif + } else { +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + PION_LOG_ERROR(m_logger, "Unable to insert cache entry for file: " + << file_path.string()); +#else + PION_LOG_ERROR(m_logger, "Unable to insert cache entry for file: " + << file_path.file_string()); +#endif + } - return add_entry_result; + return add_entry_result; } std::string FileService::findMIMEType(const std::string& file_name) { - // initialize m_mime_types if it hasn't been done already - boost::call_once(FileService::createMIMETypes, m_mime_types_init_flag); + // initialize m_mime_types if it hasn't been done already + boost::call_once(FileService::createMIMETypes, m_mime_types_init_flag); - // determine the file's extension - std::string extension(file_name.substr(file_name.find_last_of('.') + 1)); - boost::algorithm::to_lower(extension); - - // search for the matching mime type and return the result - MIMETypeMap::iterator i = m_mime_types_ptr->find(extension); - return (i == m_mime_types_ptr->end() ? DEFAULT_MIME_TYPE : i->second); + // determine the file's extension + std::string extension(file_name.substr(file_name.find_last_of('.') + 1)); + boost::algorithm::to_lower(extension); + + // search for the matching mime type and return the result + MIMETypeMap::iterator i = m_mime_types_ptr->find(extension); + return (i == m_mime_types_ptr->end() ? DEFAULT_MIME_TYPE : i->second); } void FileService::createMIMETypes(void) { - // create the map - static MIMETypeMap mime_types; + // create the map + static MIMETypeMap mime_types; - // populate mime types - mime_types["js"] = "text/javascript"; - mime_types["txt"] = "text/plain"; - mime_types["xml"] = "text/xml"; - mime_types["css"] = "text/css"; - mime_types["htm"] = "text/html"; - mime_types["html"] = "text/html"; - mime_types["xhtml"] = "text/html"; - mime_types["gif"] = "image/gif"; - mime_types["png"] = "image/png"; - mime_types["jpg"] = "image/jpeg"; - mime_types["jpeg"] = "image/jpeg"; - // ... + // populate mime types + mime_types["js"] = "text/javascript"; + mime_types["txt"] = "text/plain"; + mime_types["xml"] = "text/xml"; + mime_types["css"] = "text/css"; + mime_types["htm"] = "text/html"; + mime_types["html"] = "text/html"; + mime_types["xhtml"] = "text/html"; + mime_types["gif"] = "image/gif"; + mime_types["png"] = "image/png"; + mime_types["jpg"] = "image/jpeg"; + mime_types["jpeg"] = "image/jpeg"; + mime_types["svg"] = "image/svg+xml"; + mime_types["eof"] = "application/vnd.ms-fontobject"; + mime_types["otf"] = "application/x-font-opentype"; + mime_types["ttf"] = "application/x-font-ttf"; + mime_types["woff"] = "application/font-woff"; + // ... - // set the static pointer - m_mime_types_ptr = &mime_types; + // set the static pointer + m_mime_types_ptr = &mime_types; } @@ -702,210 +758,237 @@ void DiskFile::update(void) { - // set file_size and last_modified - m_file_size = QFileInfo(QString::fromStdString(m_file_path.string())).size(); - m_last_modified = boost::filesystem::last_write_time( m_file_path ); - m_last_modified_string = HTTPTypes::get_date_string( m_last_modified ); + // set file_size and last_modified + m_file_size = boost::numeric_cast(boost::filesystem::file_size( m_file_path )); + m_last_modified = boost::filesystem::last_write_time( m_file_path ); + m_last_modified_string = http::types::get_date_string( m_last_modified ); } void DiskFile::read(void) { - // re-allocate storage buffer for the file's content - m_file_content.reset(new char[m_file_size]); + // re-allocate storage buffer for the file's content + m_file_content.reset(new char[m_file_size]); - // open the file for reading - boost::filesystem::ifstream file_stream; - file_stream.open(m_file_path, std::ios::in | std::ios::binary); - - // read the file into memory - if (!file_stream.is_open() || !file_stream.read(m_file_content.get(), m_file_size)) - throw FileService::FileReadException(m_file_path.string()); + // open the file for reading + boost::filesystem::ifstream file_stream; + file_stream.open(m_file_path, std::ios::in | std::ios::binary); + + // read the file into memory + if (!file_stream.is_open() || !file_stream.read(m_file_content.get(), m_file_size)) { +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + const std::string file_name = m_file_path.string(); +#else + const std::string file_name = m_file_path.file_string(); +#endif + BOOST_THROW_EXCEPTION( error::read_file() << error::errinfo_file_name(file_name) ); + } } bool DiskFile::checkUpdated(void) { - // get current values - unsigned long long cur_size = QFileInfo(QString::fromStdString(m_file_path.string())).size(); - time_t cur_modified = boost::filesystem::last_write_time( m_file_path ); + // get current values + std::streamsize cur_size = boost::numeric_cast(boost::filesystem::file_size( m_file_path )); + time_t cur_modified = boost::filesystem::last_write_time( m_file_path ); - // check if file has not been updated - if (cur_modified == m_last_modified && cur_size == m_file_size) - return false; + // check if file has not been updated + if (cur_modified == m_last_modified && cur_size == m_file_size) + return false; - // file has been updated + // file has been updated - // update file_size and last_modified timestamp - m_file_size = cur_size; - m_last_modified = cur_modified; - m_last_modified_string = HTTPTypes::get_date_string( m_last_modified ); + // update file_size and last_modified timestamp + m_file_size = cur_size; + m_last_modified = cur_modified; + m_last_modified_string = http::types::get_date_string( m_last_modified ); - // read new contents - read(); + // read new contents + read(); - return true; + return true; } // DiskFileSender member functions -DiskFileSender::DiskFileSender(DiskFile& file, pion::net::HTTPRequestPtr& request, - pion::net::TCPConnectionPtr& tcp_conn, - unsigned long max_chunk_size) - : m_logger(PION_GET_LOGGER("pion.FileService.DiskFileSender")), m_disk_file(file), - m_writer(pion::net::HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))), - m_max_chunk_size(max_chunk_size), m_file_bytes_to_send(0), m_bytes_sent(0) -{ - PION_LOG_DEBUG(m_logger, "Preparing to send file" - << (m_disk_file.hasFileContent() ? " (cached): " : ": ") - << m_disk_file.getFilePath().string()); - - // set the Content-Type HTTP header using the file's MIME type - m_writer->getResponse().setContentType(m_disk_file.getMimeType()); - - // set Last-Modified header to enable client-side caching - m_writer->getResponse().addHeader(HTTPTypes::HEADER_LAST_MODIFIED, - m_disk_file.getLastModifiedString()); - - // use "200 OK" HTTP response - m_writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_OK); - m_writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_OK); +DiskFileSender::DiskFileSender(DiskFile& file, const pion::http::request_ptr& http_request_ptr, + const pion::tcp::connection_ptr& tcp_conn, + unsigned long max_chunk_size) + : m_logger(PION_GET_LOGGER("pion.FileService.DiskFileSender")), m_disk_file(file), + m_writer(pion::http::response_writer::create(tcp_conn, *http_request_ptr, boost::bind(&tcp::connection::finish, tcp_conn))), + m_max_chunk_size(max_chunk_size), m_file_bytes_to_send(0), m_bytes_sent(0) +{ +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + PION_LOG_DEBUG(m_logger, "Preparing to send file" + << (m_disk_file.hasFileContent() ? " (cached): " : ": ") + << m_disk_file.getFilePath().string()); +#else + PION_LOG_DEBUG(m_logger, "Preparing to send file" + << (m_disk_file.hasFileContent() ? " (cached): " : ": ") + << m_disk_file.getFilePath().file_string()); +#endif + + // set the Content-Type HTTP header using the file's MIME type + m_writer->get_response().set_content_type(m_disk_file.getMimeType()); + + // set Last-Modified header to enable client-side caching + m_writer->get_response().add_header(http::types::HEADER_LAST_MODIFIED, + m_disk_file.getLastModifiedString()); + + // use "200 OK" HTTP response + m_writer->get_response().set_status_code(http::types::RESPONSE_CODE_OK); + m_writer->get_response().set_status_message(http::types::RESPONSE_MESSAGE_OK); } void DiskFileSender::send(void) { - // check if we have nothing to send (send 0 byte response content) - if (m_disk_file.getFileSize() <= m_bytes_sent) { - m_writer->send(); - return; - } - - // calculate the number of bytes to send (m_file_bytes_to_send) - m_file_bytes_to_send = m_disk_file.getFileSize() - m_bytes_sent; - if (m_max_chunk_size > 0 && m_file_bytes_to_send > m_max_chunk_size) - m_file_bytes_to_send = m_max_chunk_size; - - // get the content to send (file_content_ptr) - char *file_content_ptr; - - if (m_disk_file.hasFileContent()) { - - // the entire file IS cached in memory (m_disk_file.file_content) - file_content_ptr = m_disk_file.getFileContent() + m_bytes_sent; - - } else { - // the file is not cached in memory - - // check if the file has been opened yet - if (! m_file_stream.is_open()) { - // open the file for reading - m_file_stream.open(m_disk_file.getFilePath(), std::ios::in | std::ios::binary); - if (! m_file_stream.is_open()) { - PION_LOG_ERROR(m_logger, "Unable to open file: " - << m_disk_file.getFilePath().string()); - return; - } - } - - // check if the content buffer was initialized yet - if (! m_content_buf) { - // allocate memory for the new content buffer - m_content_buf.reset(new char[m_file_bytes_to_send]); - } - file_content_ptr = m_content_buf.get(); - - // read a block of data from the file into the content buffer - if (! m_file_stream.read(m_content_buf.get(), m_file_bytes_to_send)) { - if (m_file_stream.gcount() > 0) { - PION_LOG_ERROR(m_logger, "File size inconsistency: " - << m_disk_file.getFilePath().string()); - } else { - PION_LOG_ERROR(m_logger, "Unable to read file: " - << m_disk_file.getFilePath().string()); - } - return; - } - } - - // send the content - m_writer->writeNoCopy(file_content_ptr, m_file_bytes_to_send); - - if (m_bytes_sent + m_file_bytes_to_send >= m_disk_file.getFileSize()) { - // this is the last piece of data to send - if (m_bytes_sent > 0) { - // send last chunk in a series - m_writer->sendFinalChunk(boost::bind(&DiskFileSender::handleWrite, - shared_from_this(), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); - } else { - // sending entire file at once - m_writer->send(boost::bind(&DiskFileSender::handleWrite, - shared_from_this(), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); - } - } else { - // there will be more data -> send a chunk - m_writer->sendChunk(boost::bind(&DiskFileSender::handleWrite, - shared_from_this(), - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); - } -} - -void DiskFileSender::handleWrite(const boost::system::error_code& write_error, - std::size_t bytes_written) -{ - bool finished_sending = true; - - if (write_error) { - // encountered error sending response data - m_writer->getTCPConnection()->setLifecycle(TCPConnection::LIFECYCLE_CLOSE); // make sure it will get closed - PION_LOG_WARN(m_logger, "Error sending file (" << write_error.message() << ')'); - } else { - // response data sent OK - - // use m_file_bytes_to_send instead of bytes_written; bytes_written - // includes bytes for HTTP headers and chunking headers - m_bytes_sent += m_file_bytes_to_send; - - if (m_bytes_sent >= m_disk_file.getFileSize()) { - // finished sending - PION_LOG_DEBUG(m_logger, "Sent " - << (m_file_bytes_to_send < m_disk_file.getFileSize() ? "file chunk" : "complete file") - << " of " << m_file_bytes_to_send << " bytes (finished" - << (m_writer->getTCPConnection()->getKeepAlive() ? ", keeping alive)" : ", closing)") ); - } else { - // NOT finished sending - PION_LOG_DEBUG(m_logger, "Sent file chunk of " << m_file_bytes_to_send << " bytes"); - finished_sending = false; - m_writer->clear(); - } - } - - if (finished_sending) { - // TCPConnection::finish() calls TCPServer::finishConnection, which will either: - // a) call HTTPServer::handleConnection again if keep-alive is true; or, - // b) close the socket and remove it from the server's connection pool - m_writer->getTCPConnection()->finish(); - } else { - send(); - } + // check if we have nothing to send (send 0 byte response content) + if (m_disk_file.getFileSize() <= m_bytes_sent) { + m_writer->send(); + return; + } + + // calculate the number of bytes to send (m_file_bytes_to_send) + m_file_bytes_to_send = m_disk_file.getFileSize() - m_bytes_sent; + if (m_max_chunk_size > 0 && m_file_bytes_to_send > m_max_chunk_size) + m_file_bytes_to_send = m_max_chunk_size; + + // get the content to send (file_content_ptr) + char *file_content_ptr; + + if (m_disk_file.hasFileContent()) { + + // the entire file IS cached in memory (m_disk_file.file_content) + file_content_ptr = m_disk_file.getFileContent() + m_bytes_sent; + + } else { + // the file is not cached in memory + + // check if the file has been opened yet + if (! m_file_stream.is_open()) { + // open the file for reading + m_file_stream.open(m_disk_file.getFilePath(), std::ios::in | std::ios::binary); + if (! m_file_stream.is_open()) { +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + PION_LOG_ERROR(m_logger, "Unable to open file: " + << m_disk_file.getFilePath().string()); +#else + PION_LOG_ERROR(m_logger, "Unable to open file: " + << m_disk_file.getFilePath().file_string()); +#endif + return; + } + } + + // check if the content buffer was initialized yet + if (! m_content_buf) { + // allocate memory for the new content buffer + m_content_buf.reset(new char[m_file_bytes_to_send]); + } + file_content_ptr = m_content_buf.get(); + + // read a block of data from the file into the content buffer + if (! m_file_stream.read(m_content_buf.get(), m_file_bytes_to_send)) { + if (m_file_stream.gcount() > 0) { +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + PION_LOG_ERROR(m_logger, "File size inconsistency: " + << m_disk_file.getFilePath().string()); +#else + PION_LOG_ERROR(m_logger, "File size inconsistency: " + << m_disk_file.getFilePath().file_string()); +#endif + } else { +# if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3 + PION_LOG_ERROR(m_logger, "Unable to read file: " + << m_disk_file.getFilePath().string()); +#else + PION_LOG_ERROR(m_logger, "Unable to read file: " + << m_disk_file.getFilePath().file_string()); +#endif + } + return; + } + } + + // send the content + m_writer->write_no_copy(file_content_ptr, m_file_bytes_to_send); + + if (m_bytes_sent + m_file_bytes_to_send >= m_disk_file.getFileSize()) { + // this is the last piece of data to send + if (m_bytes_sent > 0) { + // send last chunk in a series + m_writer->send_final_chunk(boost::bind(&DiskFileSender::handle_write, + shared_from_this(), + boost::asio::placeholders::error, + boost::asio::placeholders::bytes_transferred)); + } else { + // sending entire file at once + m_writer->send(boost::bind(&DiskFileSender::handle_write, + shared_from_this(), + boost::asio::placeholders::error, + boost::asio::placeholders::bytes_transferred)); + } + } else { + // there will be more data -> send a chunk + m_writer->send_chunk(boost::bind(&DiskFileSender::handle_write, + shared_from_this(), + boost::asio::placeholders::error, + boost::asio::placeholders::bytes_transferred)); + } +} + +void DiskFileSender::handle_write(const boost::system::error_code& write_error, + std::size_t /* bytes_written */) +{ + bool finished_sending = true; + + if (write_error) { + // encountered error sending response data + m_writer->get_connection()->set_lifecycle(tcp::connection::LIFECYCLE_CLOSE); // make sure it will get closed + PION_LOG_WARN(m_logger, "Error sending file (" << write_error.message() << ')'); + } else { + // response data sent OK + + // use m_file_bytes_to_send instead of bytes_written; bytes_written + // includes bytes for HTTP headers and chunking headers + m_bytes_sent += m_file_bytes_to_send; + + if (m_bytes_sent >= m_disk_file.getFileSize()) { + // finished sending + PION_LOG_DEBUG(m_logger, "Sent " + << (m_file_bytes_to_send < m_disk_file.getFileSize() ? "file chunk" : "complete file") + << " of " << m_file_bytes_to_send << " bytes (finished" + << (m_writer->get_connection()->get_keep_alive() ? ", keeping alive)" : ", closing)") ); + } else { + // NOT finished sending + PION_LOG_DEBUG(m_logger, "Sent file chunk of " << m_file_bytes_to_send << " bytes"); + finished_sending = false; + m_writer->clear(); + } + } + + if (finished_sending) { + // connection::finish() calls tcp::server::finish_connection, which will either: + // a) call http::server::handle_connection again if keep-alive is true; or, + // b) close the socket and remove it from the server's connection pool + m_writer->get_connection()->finish(); + } else { + send(); + } } -} // end namespace plugins -} // end namespace pion +} // end namespace plugins +} // end namespace pion /// creates new FileService objects -extern "C" PION_SERVICE_API pion::plugins::FileService *pion_create_FileService(void) +extern "C" PION_PLUGIN pion::plugins::FileService *pion_create_FileService(void) { - return new pion::plugins::FileService(); + return new pion::plugins::FileService(); } /// destroys FileService objects -extern "C" PION_SERVICE_API void pion_destroy_FileService(pion::plugins::FileService *service_ptr) +extern "C" PION_PLUGIN void pion_destroy_FileService(pion::plugins::FileService *service_ptr) { - delete service_ptr; + delete service_ptr; } diff -Nru fatrat-1.2.0~beta2/src/remote/pion/FileService.hpp fatrat-1.2.0+git20180628/src/remote/pion/FileService.hpp --- fatrat-1.2.0~beta2/src/remote/pion/FileService.hpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/pion/FileService.hpp 2018-07-05 18:20:27.000000000 +0000 @@ -1,7 +1,7 @@ -// ------------------------------------------------------------------ -// pion-net: a C++ framework for building lightweight HTTP interfaces -// ------------------------------------------------------------------ -// Copyright (C) 2007-2008 Atomic Labs, Inc. (http://www.atomiclabs.com) +// --------------------------------------------------------------------- +// pion: a Boost C++ framework for building lightweight HTTP interfaces +// --------------------------------------------------------------------- +// Copyright (C) 2007-2014 Splunk Inc. (https://github.com/splunk/pion) // // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt @@ -16,18 +16,19 @@ #include #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include -namespace pion { // begin namespace pion -namespace plugins { // begin namespace plugins + +namespace pion { // begin namespace pion +namespace plugins { // begin namespace plugins /// @@ -35,94 +36,94 @@ /// class DiskFile { public: - /// default constructor - DiskFile(void) - : m_file_size(0), m_last_modified(0) {} - - /// used to construct new disk file objects - DiskFile(const boost::filesystem::path& path, - char *content, unsigned long size, - std::time_t modified, const std::string& mime) - : m_file_path(path), m_file_content(content), m_file_size(size), - m_last_modified(modified), m_mime_type(mime) - {} - - /// copy constructor - DiskFile(const DiskFile& f) - : m_file_path(f.m_file_path), m_file_content(f.m_file_content), - m_file_size(f.m_file_size), m_last_modified(f.m_last_modified), - m_last_modified_string(f.m_last_modified_string), m_mime_type(f.m_mime_type) - {} - - /// updates the file_size and last_modified timestamp to disk - void update(void); - - /// reads content from disk into file_content buffer (may throw) - void read(void); - - /** - * checks if the file has been updated and updates vars if it has (may throw) - * - * @return true if the file was updated - */ - bool checkUpdated(void); - - /// return path to the cached file - inline const boost::filesystem::path& getFilePath(void) const { return m_file_path; } - - /// returns content of the cached file - inline char *getFileContent(void) { return m_file_content.get(); } - - /// returns true if there is cached file content - inline bool hasFileContent(void) const { return m_file_content; } - - /// returns size of the file's content - inline unsigned long long getFileSize(void) const { return m_file_size; } - - /// returns timestamp that the cached file was last modified (0 = cache disabled) - inline std::time_t getLastModified(void) const { return m_last_modified; } - - /// returns timestamp that the cached file was last modified (string format) - inline const std::string& getLastModifiedString(void) const { return m_last_modified_string; } - - /// returns mime type for the cached file - inline const std::string& getMimeType(void) const { return m_mime_type; } - - /// sets the path to the cached file - inline void setFilePath(const boost::filesystem::path& p) { m_file_path = p; } - - /// appends to the path of the cached file - inline void appendFilePath(const std::string& p) { m_file_path /= p; } - - /// sets the mime type for the cached file - inline void setMimeType(const std::string& t) { m_mime_type = t; } - - /// resets the size of the file content buffer - inline void resetFileContent(unsigned long n = 0) { - if (n == 0) m_file_content.reset(); - else m_file_content.reset(new char[n]); - } + /// default constructor + DiskFile(void) + : m_file_size(0), m_last_modified(0) {} + + /// used to construct new disk file objects + DiskFile(const boost::filesystem::path& path, + char *content, unsigned long size, + std::time_t modified, const std::string& mime) + : m_file_path(path), m_file_content(content), m_file_size(size), + m_last_modified(modified), m_mime_type(mime) + {} + + /// copy constructor + DiskFile(const DiskFile& f) + : m_file_path(f.m_file_path), m_file_content(f.m_file_content), + m_file_size(f.m_file_size), m_last_modified(f.m_last_modified), + m_last_modified_string(f.m_last_modified_string), m_mime_type(f.m_mime_type) + {} + + /// updates the file_size and last_modified timestamp to disk + void update(void); + + /// reads content from disk into file_content buffer (may throw) + void read(void); + + /** + * checks if the file has been updated and updates vars if it has (may throw) + * + * @return true if the file was updated + */ + bool checkUpdated(void); + + /// return path to the cached file + inline const boost::filesystem::path& getFilePath(void) const { return m_file_path; } + + /// returns content of the cached file + inline char *getFileContent(void) { return m_file_content.get(); } + + /// returns true if there is cached file content + inline bool hasFileContent(void) const { return static_cast(m_file_content); } + + /// returns size of the file's content + inline unsigned long getFileSize(void) const { return m_file_size; } + + /// returns timestamp that the cached file was last modified (0 = cache disabled) + inline std::time_t getLastModified(void) const { return m_last_modified; } + + /// returns timestamp that the cached file was last modified (string format) + inline const std::string& getLastModifiedString(void) const { return m_last_modified_string; } + + /// returns mime type for the cached file + inline const std::string& getMimeType(void) const { return m_mime_type; } + + /// sets the path to the cached file + inline void setFilePath(const boost::filesystem::path& p) { m_file_path = p; } + + /// appends to the path of the cached file + inline void appendFilePath(const std::string& p) { m_file_path /= p; } + + /// sets the mime type for the cached file + inline void setMimeType(const std::string& t) { m_mime_type = t; } + + /// resets the size of the file content buffer + inline void resetFileContent(unsigned long n = 0) { + if (n == 0) m_file_content.reset(); + else m_file_content.reset(new char[n]); + } protected: - /// path to the cached file - boost::filesystem::path m_file_path; + /// path to the cached file + boost::filesystem::path m_file_path; - /// content of the cached file - boost::shared_array m_file_content; + /// content of the cached file + boost::shared_array m_file_content; - /// size of the file's content - unsigned long long m_file_size; + /// size of the file's content + std::streamsize m_file_size; - /// timestamp that the cached file was last modified (0 = cache disabled) - std::time_t m_last_modified; + /// timestamp that the cached file was last modified (0 = cache disabled) + std::time_t m_last_modified; - /// timestamp that the cached file was last modified (string format) - std::string m_last_modified_string; + /// timestamp that the cached file was last modified (string format) + std::string m_last_modified_string; - /// mime type for the cached file - std::string m_mime_type; + /// mime type for the cached file + std::string m_mime_type; }; @@ -130,333 +131,270 @@ /// DiskFileSender: class used to send files to clients using HTTP responses /// class DiskFileSender : - public boost::enable_shared_from_this, - private boost::noncopyable + public boost::enable_shared_from_this, + private boost::noncopyable { public: - /** - * creates new DiskFileSender objects - * - * @param file disk file object that should be sent - * @param request HTTP request that we are responding to - * @param tcp_conn TCP connection used to send the file - * @param max_chunk_size sets the maximum chunk size (default=0, unlimited) - */ - static inline boost::shared_ptr - create(DiskFile& file, - pion::net::HTTPRequestPtr& request, - pion::net::TCPConnectionPtr& tcp_conn, - unsigned long max_chunk_size = 0) - { - return boost::shared_ptr(new DiskFileSender(file, request, - tcp_conn, max_chunk_size)); - } - - /// default virtual destructor - virtual ~DiskFileSender() {} - - /// Begins sending the file to the client. Following a call to this - /// function, it is not thread safe to use your reference to the - /// DiskFileSender object. - void send(void); - - /// sets the logger to be used - inline void setLogger(PionLogger log_ptr) { m_logger = log_ptr; } - - /// returns the logger currently in use - inline PionLogger getLogger(void) { return m_logger; } - inline pion::net::HTTPResponseWriterPtr getWriter() { return m_writer; } + /** + * creates new DiskFileSender objects + * + * @param file disk file object that should be sent + * @param http_request_ptr HTTP request that we are responding to + * @param tcp_conn TCP connection used to send the file + * @param max_chunk_size sets the maximum chunk size (default=0, unlimited) + */ + static inline boost::shared_ptr + create(DiskFile& file, + const pion::http::request_ptr& http_request_ptr, + const pion::tcp::connection_ptr& tcp_conn, + unsigned long max_chunk_size = 0) + { + return boost::shared_ptr(new DiskFileSender(file, http_request_ptr, + tcp_conn, max_chunk_size)); + } + + /// default virtual destructor + virtual ~DiskFileSender() {} + + /// Begins sending the file to the client. Following a call to this + /// function, it is not thread safe to use your reference to the + /// DiskFileSender object. + void send(void); + + /// sets the logger to be used + inline void set_logger(logger log_ptr) { m_logger = log_ptr; } + + /// returns the logger currently in use + inline logger get_logger(void) { return m_logger; } + + pion::http::response_writer_ptr get_writer() { return m_writer; } protected: - /** - * protected constructor restricts creation of objects (use create()) - * - * @param file disk file object that should be sent - * @param request HTTP request that we are responding to - * @param tcp_conn TCP connection used to send the file - * @param max_chunk_size sets the maximum chunk size - */ - DiskFileSender(DiskFile& file, - pion::net::HTTPRequestPtr& request, - pion::net::TCPConnectionPtr& tcp_conn, - unsigned long max_chunk_size); - - /** - * handler called after a send operation has completed - * - * @param write_error error status from the last write operation - * @param bytes_written number of bytes sent by the last write operation - */ - void handleWrite(const boost::system::error_code& write_error, - std::size_t bytes_written); + /** + * protected constructor restricts creation of objects (use create()) + * + * @param file disk file object that should be sent + * @param http_request_ptr HTTP request that we are responding to + * @param tcp_conn TCP connection used to send the file + * @param max_chunk_size sets the maximum chunk size + */ + DiskFileSender(DiskFile& file, + const pion::http::request_ptr& http_request_ptr, + const pion::tcp::connection_ptr& tcp_conn, + unsigned long max_chunk_size); + + /** + * handler called after a send operation has completed + * + * @param write_error error status from the last write operation + * @param bytes_written number of bytes sent by the last write operation + */ + void handle_write(const boost::system::error_code& write_error, + std::size_t bytes_written); - /// primary logging interface used by this class - PionLogger m_logger; + /// primary logging interface used by this class + logger m_logger; private: - /// the disk file we are sending - DiskFile m_disk_file; + /// the disk file we are sending + DiskFile m_disk_file; - /// the HTTP response we are sending - pion::net::HTTPResponseWriterPtr m_writer; + /// the HTTP response we are sending + pion::http::response_writer_ptr m_writer; - /// used to read the file from disk if it is not already cached in memory - boost::filesystem::ifstream m_file_stream; + /// used to read the file from disk if it is not already cached in memory + boost::filesystem::ifstream m_file_stream; - /// buffer used to send file content - boost::shared_array m_content_buf; - - /** - * maximum chunk size (in bytes): files larger than this size will be - * delivered to clients using HTTP chunked responses. A value of - * zero means that the size is unlimited (chunking is disabled). - */ - unsigned long m_max_chunk_size; + /// buffer used to send file content + boost::shared_array m_content_buf; + + /** + * maximum chunk size (in bytes): files larger than this size will be + * delivered to clients using HTTP chunked responses. A value of + * zero means that the size is unlimited (chunking is disabled). + */ + unsigned long m_max_chunk_size; - /// the number of file bytes send in the last operation - unsigned long m_file_bytes_to_send; + /// the number of file bytes send in the last operation + unsigned long m_file_bytes_to_send; - /// the number of bytes we have sent so far - unsigned long long m_bytes_sent; + /// the number of bytes we have sent so far + unsigned long m_bytes_sent; }; /// data type for a DiskFileSender pointer -typedef boost::shared_ptr DiskFileSenderPtr; +typedef boost::shared_ptr DiskFileSenderPtr; /// /// FileService: web service that serves regular files /// class FileService : - public pion::net::WebService + public pion::http::plugin_service { public: - /// exception thrown if the directory configured is not found - class DirectoryNotFoundException : public PionException { - public: - DirectoryNotFoundException(const std::string& dir) - : PionException("FileService directory not found: ", dir) {} - }; - - /// exception thrown if the directory configuration option is not a directory - class NotADirectoryException : public PionException { - public: - NotADirectoryException(const std::string& dir) - : PionException("FileService option is not a directory: ", dir) {} - }; - - /// exception thrown if the file configured is not found - class FileNotFoundException : public PionException { - public: - FileNotFoundException(const std::string& file) - : PionException("FileService file not found: ", file) {} - }; - - /// exception thrown if the file configuration option is not a file - class NotAFileException : public PionException { - public: - NotAFileException(const std::string& file) - : PionException("FileService option is not a file: ", file) {} - }; - - /// exception thrown if the cache option is set to an invalid value - class InvalidCacheException : public PionException { - public: - InvalidCacheException(const std::string& value) - : PionException("FileService invalid value for cache option: ", value) {} - }; - - /// exception thrown if the scan option is set to an invalid value - class InvalidScanException : public PionException { - public: - InvalidScanException(const std::string& value) - : PionException("FileService invalid value for scan option: ", value) {} - }; - - /// exception thrown if an option is set to an invalid value - class InvalidOptionValueException : public PionException { - public: - InvalidOptionValueException(const std::string& option, const std::string& value) - : PionException("FileService invalid value for " + option + " option: ", value) {} - }; - - /// exception thrown if we are unable to read a file from disk - class FileReadException : public PionException { - public: - FileReadException(const std::string& value) - : PionException("FileService unable to read file: ", value) {} - }; - - /// exception thrown if we do not know how to respond (should never happen) - class UndefinedResponseException : public PionException { - public: - UndefinedResponseException(const std::string& value) - : PionException("FileService has an undefined response: ", value) {} - }; - - - // default constructor and destructor - FileService(void); - virtual ~FileService() {} - - /** - * configuration options supported by FileService: - * - * directory: all files within the directory will be made available - * file: - * cache: - * scan: - * max_chunk_size: - * writable: - */ - virtual void setOption(const std::string& name, const std::string& value); - - /// handles requests for FileService - virtual void operator()(pion::net::HTTPRequestPtr& request, - pion::net::TCPConnectionPtr& tcp_conn); - - /// called when the web service's server is starting - virtual void start(void); + // default constructor and destructor + FileService(void); + virtual ~FileService() {} + + /** + * configuration options supported by FileService: + * + * directory: all files within the directory will be made available + * file: + * cache: + * scan: + * max_chunk_size: + * writable: + */ + virtual void set_option(const std::string& name, const std::string& value); + + /// handles requests for FileService + virtual void operator()(const pion::http::request_ptr& http_request_ptr, + const pion::tcp::connection_ptr& tcp_conn); + + /// called when the web service's server is starting + virtual void start(void); - /// called when the web service's server is stopping - virtual void stop(void); + /// called when the web service's server is stopping + virtual void stop(void); - /// sets the logger to be used - inline void setLogger(PionLogger log_ptr) { m_logger = log_ptr; } + /// sets the logger to be used + inline void set_logger(logger log_ptr) { m_logger = log_ptr; } - /// returns the logger currently in use - inline PionLogger getLogger(void) { return m_logger; } + /// returns the logger currently in use + inline logger get_logger(void) { return m_logger; } protected: - /// data type for map of file names to cache entries - typedef PION_HASH_MAP CacheMap; + /// data type for map of file names to cache entries + typedef PION_HASH_MAP CacheMap; - /// data type for map of file extensions to MIME types - typedef PION_HASH_MAP MIMETypeMap; + /// data type for map of file extensions to MIME types + typedef PION_HASH_MAP MIMETypeMap; - /** - * adds all files within a directory to the cache - * - * @param dir_path the directory to scan (sub-directories are included) - */ - void scanDirectory(const boost::filesystem::path& dir_path); - - /** - * adds a single file to the cache - * - * @param relative_path path for the file relative to the root directory - * @param file_path actual path to the file on disk - * @param placeholder if true, the file's contents are not cached - * - * @return std::pair if an entry is added to the - * cache, second will be true and first will point to the new entry - */ - std::pair - addCacheEntry(const std::string& relative_path, - const boost::filesystem::path& file_path, - const bool placeholder); - - /** - * searches for a MIME type that matches a file - * - * @param file_name name of the file to search for - * @return MIME type corresponding with the file, or DEFAULT_MIME_TYPE if none found - */ - static std::string findMIMEType(const std::string& file_name); + /** + * adds all files within a directory to the cache + * + * @param dir_path the directory to scan (sub-directories are included) + */ + void scanDirectory(const boost::filesystem::path& dir_path); + + /** + * adds a single file to the cache + * + * @param relative_path path for the file relative to the root directory + * @param file_path actual path to the file on disk + * @param placeholder if true, the file's contents are not cached + * + * @return std::pair if an entry is added to the + * cache, second will be true and first will point to the new entry + */ + std::pair + addCacheEntry(const std::string& relative_path, + const boost::filesystem::path& file_path, + const bool placeholder); + + /** + * searches for a MIME type that matches a file + * + * @param file_name name of the file to search for + * @return MIME type corresponding with the file, or DEFAULT_MIME_TYPE if none found + */ + static std::string findMIMEType(const std::string& file_name); - void sendNotFoundResponse(pion::net::HTTPRequestPtr& http_request, - pion::net::TCPConnectionPtr& tcp_conn); + void sendNotFoundResponse(const pion::http::request_ptr& http_request_ptr, + const pion::tcp::connection_ptr& tcp_conn); - /// primary logging interface used by this class - PionLogger m_logger; + /// primary logging interface used by this class + logger m_logger; private: - /// function called once to initialize the map of MIME types - static void createMIMETypes(void); + /// function called once to initialize the map of MIME types + static void createMIMETypes(void); - /// mime type used if no others are found for the file's extension - static const std::string DEFAULT_MIME_TYPE; + /// mime type used if no others are found for the file's extension + static const std::string DEFAULT_MIME_TYPE; - /// default setting for cache configuration option - static const unsigned int DEFAULT_CACHE_SETTING; - - /// default setting for scan configuration option - static const unsigned int DEFAULT_SCAN_SETTING; - - /// default setting for the maximum cache size option - static const unsigned long DEFAULT_MAX_CACHE_SIZE; - - /// default setting for the maximum chunk size option - static const unsigned long DEFAULT_MAX_CHUNK_SIZE; - - /// flag used to make sure that createMIMETypes() is called only once - static boost::once_flag m_mime_types_init_flag; - - /// map of file extensions to MIME types - static MIMETypeMap * m_mime_types_ptr; - - - /// directory containing files that will be made available - boost::filesystem::path m_directory; - - /// single file served by the web service - boost::filesystem::path m_file; - - /// used to cache file contents and metadata in memory - CacheMap m_cache_map; - - /// mutex used to make the file cache thread-safe - boost::mutex m_cache_mutex; - - /** - * cache configuration setting: - * 0 = do not cache files in memory - * 1 = cache files in memory when requested, check for any updates - * 2 = cache files in memory when requested, ignore any updates - */ - unsigned int m_cache_setting; - - /** - * scan configuration setting (only applies to directories): - * 0 = do not scan the directory; allow files to be added at any time - * 1 = scan directory when started, and do not allow files to be added - * 2 = scan directory and pre-populate cache; allow new files - * 3 = scan directory and pre-populate cache; ignore new files - */ - unsigned int m_scan_setting; - - /** - * maximum cache size (in bytes): files larger than this size will never be - * cached in memory. A value of zero means that the size is unlimited. - */ - unsigned long m_max_cache_size; - - /** - * maximum chunk size (in bytes): files larger than this size will be - * delivered to clients using HTTP chunked responses. A value of - * zero means that the size is unlimited (chunking is disabled). - */ - unsigned long m_max_chunk_size; - - /** - * Whether the file and/or directory served are writable. - */ - bool m_writable; + /// default setting for cache configuration option + static const unsigned int DEFAULT_CACHE_SETTING; + + /// default setting for scan configuration option + static const unsigned int DEFAULT_SCAN_SETTING; + + /// default setting for the maximum cache size option + static const unsigned long DEFAULT_MAX_CACHE_SIZE; + + /// default setting for the maximum chunk size option + static const unsigned long DEFAULT_MAX_CHUNK_SIZE; + + /// flag used to make sure that createMIMETypes() is called only once + static boost::once_flag m_mime_types_init_flag; + + /// map of file extensions to MIME types + static MIMETypeMap * m_mime_types_ptr; + + + /// directory containing files that will be made available + boost::filesystem::path m_directory; + + /// single file served by the web service + boost::filesystem::path m_file; + + /// used to cache file contents and metadata in memory + CacheMap m_cache_map; + + /// mutex used to make the file cache thread-safe + boost::mutex m_cache_mutex; + + /** + * cache configuration setting: + * 0 = do not cache files in memory + * 1 = cache files in memory when requested, check for any updates + * 2 = cache files in memory when requested, ignore any updates + */ + unsigned int m_cache_setting; + + /** + * scan configuration setting (only applies to directories): + * 0 = do not scan the directory; allow files to be added at any time + * 1 = scan directory when started, and do not allow files to be added + * 2 = scan directory and pre-populate cache; allow new files + * 3 = scan directory and pre-populate cache; ignore new files + */ + unsigned int m_scan_setting; + + /** + * maximum cache size (in bytes): files larger than this size will never be + * cached in memory. A value of zero means that the size is unlimited. + */ + unsigned long m_max_cache_size; + + /** + * maximum chunk size (in bytes): files larger than this size will be + * delivered to clients using HTTP chunked responses. A value of + * zero means that the size is unlimited (chunking is disabled). + */ + unsigned long m_max_chunk_size; + + /** + * Whether the file and/or directory served are writable. + */ + bool m_writable; }; -} // end namespace plugins -} // end namespace pion +} // end namespace plugins +} // end namespace pion #endif diff -Nru fatrat-1.2.0~beta2/src/remote/SettingsJabberForm.cpp fatrat-1.2.0+git20180628/src/remote/SettingsJabberForm.cpp --- fatrat-1.2.0~beta2/src/remote/SettingsJabberForm.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/SettingsJabberForm.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/remote/SettingsJabberForm.h fatrat-1.2.0+git20180628/src/remote/SettingsJabberForm.h --- fatrat-1.2.0~beta2/src/remote/SettingsJabberForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/SettingsJabberForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/remote/SettingsWebForm.cpp fatrat-1.2.0+git20180628/src/remote/SettingsWebForm.cpp --- fatrat-1.2.0~beta2/src/remote/SettingsWebForm.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/SettingsWebForm.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/remote/SettingsWebForm.h fatrat-1.2.0+git20180628/src/remote/SettingsWebForm.h --- fatrat-1.2.0~beta2/src/remote/SettingsWebForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/SettingsWebForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/remote/TransferHttpService.h fatrat-1.2.0+git20180628/src/remote/TransferHttpService.h --- fatrat-1.2.0~beta2/src/remote/TransferHttpService.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/TransferHttpService.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/remote/XmlRpcService.cpp fatrat-1.2.0+git20180628/src/remote/XmlRpcService.cpp --- fatrat-1.2.0~beta2/src/remote/XmlRpcService.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/XmlRpcService.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -37,10 +36,10 @@ #include #include #include -#include +#include #include -using namespace pion::net; +using namespace pion::http; extern QList g_queues; extern QReadWriteLock g_queuesLock; @@ -151,9 +150,9 @@ } -void XmlRpcService::operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn) +void XmlRpcService::operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) { - if (request->getMethod() != pion::net::HTTPTypes::REQUEST_METHOD_POST) + if (request->get_method() != pion::http::types::REQUEST_METHOD_POST) { static const std::string NOT_ALLOWED_HTML_START = "\n" @@ -164,20 +163,20 @@ static const std::string NOT_ALLOWED_HTML_FINISH = " is not allowed on this server.

\n" "\n"; - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))); - writer->getResponse().setStatusCode(HTTPTypes::RESPONSE_CODE_METHOD_NOT_ALLOWED); - writer->getResponse().setStatusMessage(HTTPTypes::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED); - writer->writeNoCopy(NOT_ALLOWED_HTML_START); - writer << request->getMethod(); - writer->writeNoCopy(NOT_ALLOWED_HTML_FINISH); - writer->getResponse().addHeader("Allow", "GET, HEAD"); + pion::http::response_writer_ptr writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn))); + writer->get_response().set_status_code(types::RESPONSE_CODE_METHOD_NOT_ALLOWED); + writer->get_response().set_status_message(types::RESPONSE_MESSAGE_METHOD_NOT_ALLOWED); + writer->write_no_copy(NOT_ALLOWED_HTML_START); + writer << request->get_method(); + writer->write_no_copy(NOT_ALLOWED_HTML_FINISH); + writer->get_response().add_header("Allow", "GET, HEAD"); writer->send(); return; } QByteArray data; - qDebug() << "XML-RPC call:" << request->getContent(); + qDebug() << "XML-RPC call:" << request->get_content(); try { @@ -185,7 +184,7 @@ QList args; QVariant returnValue; - XmlRpc::parseCall(request->getContent(), function, args); + XmlRpc::parseCall(request->get_content(), function, args); if(function == "Queue.getTransfers") { @@ -240,7 +239,7 @@ throw "400 Bad Request"; } - HTTPResponseWriterPtr writer(HTTPResponseWriter::create(tcp_conn, *request, boost::bind(&TCPConnection::finish, tcp_conn))); + pion::http::response_writer_ptr writer(pion::http::response_writer::create(tcp_conn, *request, boost::bind(&pion::tcp::connection::finish, tcp_conn))); writer->write(data.data(), data.size()); writer->send(); } @@ -638,6 +637,7 @@ QVariant XmlRpcService::Queue_moveTransfers(QString uuidQueue, QStringList uuidTransfers, QString direction) { Queue* q; + QReadLocker r(&g_queuesLock); HttpService::findQueue(uuidQueue, &q); if (!q) @@ -661,7 +661,6 @@ if (!uuidTransfers.empty()) { q->unlock(); - g_queuesLock.unlock(); throw XmlRpcError(102, "One or more invalid transfer UUIDs"); } @@ -695,12 +694,10 @@ else { q->unlock(); - g_queuesLock.unlock(); throw XmlRpcError(105, "Invalid move direction"); } q->unlock(); - g_queuesLock.unlock(); return QVariant(); } diff -Nru fatrat-1.2.0~beta2/src/remote/XmlRpcService.h fatrat-1.2.0+git20180628/src/remote/XmlRpcService.h --- fatrat-1.2.0~beta2/src/remote/XmlRpcService.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/remote/XmlRpcService.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -34,7 +33,8 @@ #include #include #include -#include +#include +#include #ifndef WITH_WEBINTERFACE # error This file is not supposed to be included! @@ -43,12 +43,12 @@ class Queue; class Transfer; -class XmlRpcService : public QObject, public pion::net::WebService +class XmlRpcService : public QObject, public pion::http::plugin_service { Q_OBJECT public: XmlRpcService(); - void operator()(pion::net::HTTPRequestPtr &request, pion::net::TCPConnectionPtr &tcp_conn); + void operator()(const pion::http::request_ptr &request, const pion::tcp::connection_ptr &tcp_conn) override; static void globalInit(); static void registerFunction(QString name, QVariant (*func)(QList&), QVector arguments); static void deregisterFunction(QString name); diff -Nru fatrat-1.2.0~beta2/src/ReportBugDlg.cpp fatrat-1.2.0+git20180628/src/ReportBugDlg.cpp --- fatrat-1.2.0~beta2/src/ReportBugDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/ReportBugDlg.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -/* -FatRat download manager -http://fatrat.dolezel.info - -Copyright (C) 2006-2009 Lubos Dolezel - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. - -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. - -In addition, as a special exemption, Luboš Doležel gives permission -to link the code of FatRat with the OpenSSL project's -"OpenSSL" library (or with modified versions of it that use the; same -license as the "OpenSSL" library), and distribute the linked -executables. You must obey the GNU General Public License in all -respects for all of the code used other than "OpenSSL". -*/ - -#include "ReportBugDlg.h" -#include -#include -#include -#include -#include -#include - -ReportBugDlg::ReportBugDlg(QWidget* parent) - : QDialog(parent) -{ - setupUi(this); -} - -void ReportBugDlg::accept() -{ - QString from = lineFrom->text(); - QString sender = lineSender->text(); - QString subject = lineSubject->text(); - QString desc = textDescription->toPlainText(); - QString strData; - - if(subject.isEmpty()) - { - QMessageBox::warning(this, "FatRat", tr("The summary is mandatory!")); - return; - } - if(!QRegExp("[^@]+@[^\\.]+\\..{2,6}").exactMatch(sender)) - { - QMessageBox::warning(this, "FatRat", tr("Your e-mail address is mandatory!")); - return; - } - if(desc.isEmpty()) - { - QMessageBox::warning(this, "FatRat", tr("The problem description is mandatory!")); - return; - } - - QHttpRequestHeader hdr("POST", "/report-bugs-submit"); - - QHttp* http = new QHttp("fatrat.dolezel.info", 80, this); - connect(http, SIGNAL(done(bool)), this, SLOT(done(bool))); - - hdr.addValue("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); - hdr.addValue("Host", "fatrat.dolezel.info"); - - strData = "name="+mimeEncode(from)+"&sender="+QUrl::toPercentEncoding(sender)+"&subject="+mimeEncode(subject) - +"&text="+QUrl::toPercentEncoding(desc); - - http->request(hdr, strData.toUtf8()); -} - -QString ReportBugDlg::escapeUtf8(QString str) -{ - QString out; - for(int i=0;i - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. - -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. - -In addition, as a special exemption, Luboš Doležel gives permission -to link the code of FatRat with the OpenSSL project's -"OpenSSL" library (or with modified versions of it that use the; same -license as the "OpenSSL" library), and distribute the linked -executables. You must obey the GNU General Public License in all -respects for all of the code used other than "OpenSSL". -*/ - -#ifndef REPORTBUGDLG_H -#define REPORTBUGDLG_H -#include -#include "ui_ReportBugDlg.h" - -class ReportBugDlg : public QDialog, Ui_ReportBugDlg -{ -Q_OBJECT -public: - ReportBugDlg(QWidget* parent); - virtual void accept(); - static QString escapeUtf8(QString str); - static QByteArray mimeEncode(QString str); -public slots: - void done(bool error); -}; - -#endif // REPORTBUGDLG_H diff -Nru fatrat-1.2.0~beta2/src/ReportBugDlg.ui fatrat-1.2.0+git20180628/src/ReportBugDlg.ui --- fatrat-1.2.0~beta2/src/ReportBugDlg.ui 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/ReportBugDlg.ui 1970-01-01 00:00:00.000000000 +0000 @@ -1,128 +0,0 @@ - - - ReportBugDlg - - - - 0 - 0 - 413 - 372 - - - - Report a bug - - - - - - Thank you for your interest in reporting bugs in FatRat. Note that the bug report must be written in <b>English, Czech or Slovak</b>! - - - true - - - - - - - Qt::Horizontal - - - - - - - Your name - - - - - - - - - - Your e-mail - - - - - - - - - - Qt::Horizontal - - - - - - - Summary - - - - - - - - - - Description - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - ReportBugDlg - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - ReportBugDlg - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff -Nru fatrat-1.2.0~beta2/src/rss/RssDownloadedDlg.cpp fatrat-1.2.0+git20180628/src/rss/RssDownloadedDlg.cpp --- fatrat-1.2.0~beta2/src/rss/RssDownloadedDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/rss/RssDownloadedDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/rss/RssDownloadedDlg.h fatrat-1.2.0+git20180628/src/rss/RssDownloadedDlg.h --- fatrat-1.2.0~beta2/src/rss/RssDownloadedDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/rss/RssDownloadedDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/rss/RssFeedDlg.h fatrat-1.2.0+git20180628/src/rss/RssFeedDlg.h --- fatrat-1.2.0~beta2/src/rss/RssFeedDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/rss/RssFeedDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/rss/RssFetcher.cpp fatrat-1.2.0+git20180628/src/rss/RssFetcher.cpp --- fatrat-1.2.0~beta2/src/rss/RssFetcher.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/rss/RssFetcher.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -30,13 +29,14 @@ #include "Logger.h" #include "Queue.h" #include "Transfer.h" -#include #include #include #include #include #include #include +#include +#include #include extern QSettings* g_settings; @@ -50,6 +50,7 @@ { m_instance = this; connect(&m_timer, SIGNAL(timeout()), this, SLOT(refresh())); + connect(&m_network, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*))); applySettings(); } @@ -91,7 +92,7 @@ for(int i=0;isetArrayIndex(i); - RssFeed f = { g_settings->value("name").toString(), g_settings->value("url").toString(), -1 }; + RssFeed f = { g_settings->value("name").toString(), g_settings->value("url").toString(), 0 }; items << f; } @@ -108,44 +109,32 @@ for(int i=0;iopen(QIODevice::ReadWrite); - - http->setHost(url.host(), url.port(80)); - - QString path = url.path(); - - if(url.hasQuery()) - path += "?" + QString(url.encodedQuery()); + QNetworkRequest request; - m_feeds[i].request = http->get(path, buffer); + request.setUrl(m_feeds[i].url); + m_feeds[i].reply = m_network.get(request); } } -void RssFetcher::requestFinished(int id, bool error) +void RssFetcher::requestFinished(QNetworkReply* reply) { RssFeed* feed = 0; bool bLast = true; for(int i=0;ierror() == QNetworkReply::NoError) { - QIODevice* device = static_cast(sender())->currentDestinationDevice(); + QIODevice* device = reply; device->seek(0); @@ -174,7 +163,7 @@ } - feed->request = -1; + feed->reply = 0; if(bLast) processItems(); diff -Nru fatrat-1.2.0~beta2/src/rss/RssFetcher.h fatrat-1.2.0+git20180628/src/rss/RssFetcher.h --- fatrat-1.2.0~beta2/src/rss/RssFetcher.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/rss/RssFetcher.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -31,11 +30,12 @@ #include #include #include +#include struct RssFeed { QString name, url; - int request; + QNetworkReply* reply; }; struct RssItem @@ -90,7 +90,7 @@ static void dayMonthHeuristics(int& day, int& month); public slots: void refresh(); - void requestFinished(int id, bool error); + void requestFinished(QNetworkReply*); private: static RssFetcher* m_instance; @@ -104,6 +104,7 @@ RssItem m_itemNext; RssItem::Next m_itemNextType; QString m_strCurrentSource; + QNetworkAccessManager m_network; }; #endif diff -Nru fatrat-1.2.0~beta2/src/rss/RssRegexpDlg.cpp fatrat-1.2.0+git20180628/src/rss/RssRegexpDlg.cpp --- fatrat-1.2.0~beta2/src/rss/RssRegexpDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/rss/RssRegexpDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/rss/RssRegexpDlg.h fatrat-1.2.0+git20180628/src/rss/RssRegexpDlg.h --- fatrat-1.2.0~beta2/src/rss/RssRegexpDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/rss/RssRegexpDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/rss/SettingsRssForm.cpp fatrat-1.2.0+git20180628/src/rss/SettingsRssForm.cpp --- fatrat-1.2.0~beta2/src/rss/SettingsRssForm.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/rss/SettingsRssForm.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/rss/SettingsRssForm.h fatrat-1.2.0+git20180628/src/rss/SettingsRssForm.h --- fatrat-1.2.0~beta2/src/rss/SettingsRssForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/rss/SettingsRssForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/RuntimeException.h fatrat-1.2.0+git20180628/src/RuntimeException.h --- fatrat-1.2.0~beta2/src/RuntimeException.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/RuntimeException.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/ScheduledActionDlg.cpp fatrat-1.2.0+git20180628/src/ScheduledActionDlg.cpp --- fatrat-1.2.0~beta2/src/ScheduledActionDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/ScheduledActionDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -49,7 +48,7 @@ comboQueue->addItem(g_queues[i]->name()); comboQueue->setItemData(i, g_queues[i]->uuid()); - if(g_queues[i]->uuid() == m_action.queue) + if(g_queues[i]->uuid() == m_action.queue.toString()) comboQueue->setCurrentIndex(i); } g_queuesLock.unlock(); diff -Nru fatrat-1.2.0~beta2/src/ScheduledActionDlg.h fatrat-1.2.0+git20180628/src/ScheduledActionDlg.h --- fatrat-1.2.0~beta2/src/ScheduledActionDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/ScheduledActionDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Scheduler.cpp fatrat-1.2.0+git20180628/src/Scheduler.cpp --- fatrat-1.2.0~beta2/src/Scheduler.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Scheduler.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -136,7 +135,7 @@ for(int i=0;iuuid() == action.queue) + if(q->uuid() == action.queue.toString()) { Logger::global()->enterLogMessage(tr("Scheduler"), tr("Executing a scheduled action: %1").arg(action.name)); diff -Nru fatrat-1.2.0~beta2/src/Scheduler.h fatrat-1.2.0+git20180628/src/Scheduler.h --- fatrat-1.2.0~beta2/src/Scheduler.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Scheduler.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsClipboardMonitorForm.cpp fatrat-1.2.0+git20180628/src/SettingsClipboardMonitorForm.cpp --- fatrat-1.2.0~beta2/src/SettingsClipboardMonitorForm.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsClipboardMonitorForm.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsClipboardMonitorForm.h fatrat-1.2.0+git20180628/src/SettingsClipboardMonitorForm.h --- fatrat-1.2.0~beta2/src/SettingsClipboardMonitorForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsClipboardMonitorForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Settings.cpp fatrat-1.2.0+git20180628/src/Settings.cpp --- fatrat-1.2.0~beta2/src/Settings.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Settings.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsDlg.cpp fatrat-1.2.0+git20180628/src/SettingsDlg.cpp --- fatrat-1.2.0~beta2/src/SettingsDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsDlg.h fatrat-1.2.0+git20180628/src/SettingsDlg.h --- fatrat-1.2.0~beta2/src/SettingsDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsDropBoxForm.h fatrat-1.2.0+git20180628/src/SettingsDropBoxForm.h --- fatrat-1.2.0~beta2/src/SettingsDropBoxForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsDropBoxForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsGeneralForm.cpp fatrat-1.2.0+git20180628/src/SettingsGeneralForm.cpp --- fatrat-1.2.0~beta2/src/SettingsGeneralForm.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsGeneralForm.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsGeneralForm.h fatrat-1.2.0+git20180628/src/SettingsGeneralForm.h --- fatrat-1.2.0~beta2/src/SettingsGeneralForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsGeneralForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Settings.h fatrat-1.2.0+git20180628/src/Settings.h --- fatrat-1.2.0~beta2/src/Settings.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Settings.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsNetworkForm.cpp fatrat-1.2.0+git20180628/src/SettingsNetworkForm.cpp --- fatrat-1.2.0~beta2/src/SettingsNetworkForm.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsNetworkForm.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsNetworkForm.h fatrat-1.2.0+git20180628/src/SettingsNetworkForm.h --- fatrat-1.2.0~beta2/src/SettingsNetworkForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsNetworkForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsQueueForm.cpp fatrat-1.2.0+git20180628/src/SettingsQueueForm.cpp --- fatrat-1.2.0~beta2/src/SettingsQueueForm.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsQueueForm.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsQueueForm.h fatrat-1.2.0+git20180628/src/SettingsQueueForm.h --- fatrat-1.2.0~beta2/src/SettingsQueueForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsQueueForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsSchedulerForm.cpp fatrat-1.2.0+git20180628/src/SettingsSchedulerForm.cpp --- fatrat-1.2.0~beta2/src/SettingsSchedulerForm.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsSchedulerForm.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SettingsSchedulerForm.h fatrat-1.2.0+git20180628/src/SettingsSchedulerForm.h --- fatrat-1.2.0~beta2/src/SettingsSchedulerForm.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SettingsSchedulerForm.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SimpleEmail.cpp fatrat-1.2.0+git20180628/src/SimpleEmail.cpp --- fatrat-1.2.0~beta2/src/SimpleEmail.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SimpleEmail.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SimpleEmail.h fatrat-1.2.0+git20180628/src/SimpleEmail.h --- fatrat-1.2.0~beta2/src/SimpleEmail.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SimpleEmail.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SpeedGraph.cpp fatrat-1.2.0+git20180628/src/SpeedGraph.cpp --- fatrat-1.2.0~beta2/src/SpeedGraph.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SpeedGraph.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SpeedGraph.h fatrat-1.2.0+git20180628/src/SpeedGraph.h --- fatrat-1.2.0~beta2/src/SpeedGraph.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SpeedGraph.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SpeedLimitWidget.cpp fatrat-1.2.0+git20180628/src/SpeedLimitWidget.cpp --- fatrat-1.2.0~beta2/src/SpeedLimitWidget.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SpeedLimitWidget.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/SpeedLimitWidget.h fatrat-1.2.0+git20180628/src/SpeedLimitWidget.h --- fatrat-1.2.0~beta2/src/SpeedLimitWidget.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/SpeedLimitWidget.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/StatsWidget.cpp fatrat-1.2.0+git20180628/src/StatsWidget.cpp --- fatrat-1.2.0~beta2/src/StatsWidget.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/StatsWidget.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/StatsWidget.h fatrat-1.2.0+git20180628/src/StatsWidget.h --- fatrat-1.2.0~beta2/src/StatsWidget.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/StatsWidget.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/ContextListWidget.cpp fatrat-1.2.0+git20180628/src/tools/ContextListWidget.cpp --- fatrat-1.2.0~beta2/src/tools/ContextListWidget.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/ContextListWidget.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/ContextListWidget.h fatrat-1.2.0+git20180628/src/tools/ContextListWidget.h --- fatrat-1.2.0~beta2/src/tools/ContextListWidget.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/ContextListWidget.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/CreateTorrentDlg.cpp fatrat-1.2.0+git20180628/src/tools/CreateTorrentDlg.cpp --- fatrat-1.2.0~beta2/src/tools/CreateTorrentDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/CreateTorrentDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -39,6 +38,7 @@ #include #include #include +#include CreateTorrentDlg::CreateTorrentDlg(QWidget* parent) : QDialog(parent), m_hasher(0) @@ -242,6 +242,7 @@ m_hasher = 0; } + HasherThread::HasherThread(QByteArray baseDir, libtorrent::create_torrent* info, QObject* parent) : QThread(parent), m_baseDir(baseDir), m_info(info), m_bAbort(false) { @@ -253,32 +254,26 @@ wait(); } +class abort_exception : public std::exception +{ +}; + void HasherThread::run() { - int num = m_info->num_pieces(); - char* buf = new char[m_info->piece_length()]; - try { - libtorrent::file_pool fp; - libtorrent::storage_interface* st = libtorrent::default_storage_constructor(m_info->files(), 0, m_baseDir.data(), fp, std::vector()); - - for(int i=0;iread(buf, i, 0, m_info->piece_size(i)); - libtorrent::hasher h(buf, m_info->piece_size(i)); - m_info->set_hash(i, h.final()); - - emit progress(i); - } + libtorrent::set_piece_hashes(*m_info, m_baseDir.data(), [&](int p) { + if (m_bAbort) + throw abort_exception(); + + emit progress(p); + }); } - catch(const std::exception& e) + catch (const abort_exception& e) { - std::string err = e.what(); - m_strError = QString::fromUtf8(err.c_str()); } - - //delete st; - delete [] buf; + catch (const std::exception& e) + { + m_strError = QString::fromStdString(e.what()); + } } - diff -Nru fatrat-1.2.0~beta2/src/tools/CreateTorrentDlg.h fatrat-1.2.0+git20180628/src/tools/CreateTorrentDlg.h --- fatrat-1.2.0~beta2/src/tools/CreateTorrentDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/CreateTorrentDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/FileSharingSearch.cpp fatrat-1.2.0+git20180628/src/tools/FileSharingSearch.cpp --- fatrat-1.2.0~beta2/src/tools/FileSharingSearch.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/FileSharingSearch.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/FileSharingSearch.h fatrat-1.2.0+git20180628/src/tools/FileSharingSearch.h --- fatrat-1.2.0~beta2/src/tools/FileSharingSearch.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/FileSharingSearch.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/HashDlg.cpp fatrat-1.2.0+git20180628/src/tools/HashDlg.cpp --- fatrat-1.2.0~beta2/src/tools/HashDlg.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/HashDlg.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/HashDlg.h fatrat-1.2.0+git20180628/src/tools/HashDlg.h --- fatrat-1.2.0~beta2/src/tools/HashDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/HashDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/HelpBrowser.cpp fatrat-1.2.0+git20180628/src/tools/HelpBrowser.cpp --- fatrat-1.2.0~beta2/src/tools/HelpBrowser.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/HelpBrowser.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/HelpBrowser.h fatrat-1.2.0+git20180628/src/tools/HelpBrowser.h --- fatrat-1.2.0~beta2/src/tools/HelpBrowser.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/HelpBrowser.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/HelpTextBrowser.cpp fatrat-1.2.0+git20180628/src/tools/HelpTextBrowser.cpp --- fatrat-1.2.0~beta2/src/tools/HelpTextBrowser.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/HelpTextBrowser.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/HelpTextBrowser.h fatrat-1.2.0+git20180628/src/tools/HelpTextBrowser.h --- fatrat-1.2.0~beta2/src/tools/HelpTextBrowser.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/HelpTextBrowser.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/TorrentSearch.cpp fatrat-1.2.0+git20180628/src/tools/TorrentSearch.cpp --- fatrat-1.2.0~beta2/src/tools/TorrentSearch.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/TorrentSearch.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -373,7 +372,7 @@ QString TorrentSearch::completeUrl(QString surl, QString complete) { - if(surl.startsWith("http://")) + if(surl.startsWith("http://") || surl.startsWith("magnet:")) return surl; QUrl url(complete); diff -Nru fatrat-1.2.0~beta2/src/tools/TorrentSearch.h fatrat-1.2.0+git20180628/src/tools/TorrentSearch.h --- fatrat-1.2.0~beta2/src/tools/TorrentSearch.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/TorrentSearch.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tools/TorrentWebView.cpp fatrat-1.2.0+git20180628/src/tools/TorrentWebView.cpp --- fatrat-1.2.0~beta2/src/tools/TorrentWebView.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/TorrentWebView.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -29,16 +28,47 @@ #include "engines/TorrentDownload.h" #include "MainWindow.h" #include "fatrat.h" +#include +#include #include +class MyWebPage : public QWebEnginePage +{ +public: + MyWebPage(QObject* parent = nullptr) + : QWebEnginePage(parent) + { + } + + bool acceptNavigationRequest(const QUrl& url, QWebEnginePage::NavigationType type, bool) override + { + if (type == QWebEnginePage::NavigationTypeLinkClicked) + { + QString s = url.toString(); + + qDebug() << "Clicked" << s; + + if (TorrentDownload::acceptable(s, false) >= 3) + { + MainWindow* wnd = (MainWindow*) getMainWindow(); + wnd->addTransfer(s, Transfer::Download, "TorrentDownload"); + return false; + } + + } + return true; + } + +}; + TorrentWebView::TorrentWebView(QTabWidget* w) : m_tab(w) { setupUi(this); + browser->setPage(new MyWebPage(browser)); connect(browser, SIGNAL(titleChanged(const QString&)), this, SLOT(titleChanged(QString))); connect(browser, SIGNAL(loadProgress(int)), this, SLOT(progressChanged(int))); - connect(browser, SIGNAL(iconChanged()), this, SLOT(iconChanged())); - connect(browser, SIGNAL(linkClicked(const QUrl&)), this, SLOT(linkClicked(const QUrl&))); + connect(browser, SIGNAL(iconUrlChanged(const QUrl&)), this, SLOT(iconUrlChanged(const QUrl&))); } void TorrentWebView::titleChanged(QString title) @@ -66,29 +96,40 @@ } else { - browser->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); statusbar->hide(); } } -void TorrentWebView::iconChanged() +void TorrentWebView::iconChanged(const QUrl& iconUrl) { int i = m_tab->indexOf(this); - if(i != -1) - m_tab->setTabIcon(i, browser->icon()); + if (i != -1) + { + if (!iconUrl.isValid()) + m_tab->setTabIcon(i, QIcon()); + else + { + QNetworkRequest request(iconUrl); + QNetworkReply* reply = m_net.get(request); + + connect(reply, SIGNAL(finished()), this, SLOT(iconDownloaded())); + } + } else qDebug() << "Warning: cannot find my own index"; } -void TorrentWebView::linkClicked(const QUrl& u) +void TorrentWebView::iconDownloaded() { - QString url = u.toString(); - qDebug() << "Clicked" << url; - if(TorrentDownload::acceptable(url, false) >= 3) + QNetworkReply* reply = static_cast(sender()); + QByteArray ba = reply->readAll(); + QPixmap pm; + int i = m_tab->indexOf(this); + + if (i != -1) { - MainWindow* wnd = (MainWindow*) getMainWindow(); - wnd->addTransfer(url, Transfer::Download, "TorrentDownload"); + if (pm.loadFromData(ba)) + m_tab->setTabIcon(i, QIcon(pm)); } - else - browser->load(u); } + diff -Nru fatrat-1.2.0~beta2/src/tools/TorrentWebView.h fatrat-1.2.0+git20180628/src/tools/TorrentWebView.h --- fatrat-1.2.0~beta2/src/tools/TorrentWebView.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/TorrentWebView.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -29,6 +28,7 @@ #define TORRENTWEBVIEW_H #include #include +#include #include "ui_TorrentWebView.h" class TorrentWebView : public QWidget, public Ui_TorrentWebView @@ -39,12 +39,13 @@ public slots: void titleChanged(QString title); void progressChanged(int p); - void iconChanged(); - void linkClicked(const QUrl&); + void iconChanged(const QUrl&); + void iconDownloaded(); signals: void changeTabTitle(QString); private: QTabWidget* m_tab; + QNetworkAccessManager m_net; }; #endif diff -Nru fatrat-1.2.0~beta2/src/tools/TorrentWebView.ui fatrat-1.2.0+git20180628/src/tools/TorrentWebView.ui --- fatrat-1.2.0~beta2/src/tools/TorrentWebView.ui 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tools/TorrentWebView.ui 2018-07-05 18:20:27.000000000 +0000 @@ -23,7 +23,7 @@ 0 - + 0 @@ -39,9 +39,9 @@ - QWebView + QWebEngineView QWidget -
QtWebKit/QWebView
+
QtWebEngineWidgets/QWebEngineView
diff -Nru fatrat-1.2.0~beta2/src/tooltips/BaseToolTip.cpp fatrat-1.2.0+git20180628/src/tooltips/BaseToolTip.cpp --- fatrat-1.2.0~beta2/src/tooltips/BaseToolTip.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tooltips/BaseToolTip.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tooltips/BaseToolTip.h fatrat-1.2.0+git20180628/src/tooltips/BaseToolTip.h --- fatrat-1.2.0~beta2/src/tooltips/BaseToolTip.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tooltips/BaseToolTip.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tooltips/QueueToolTip.cpp fatrat-1.2.0+git20180628/src/tooltips/QueueToolTip.cpp --- fatrat-1.2.0~beta2/src/tooltips/QueueToolTip.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tooltips/QueueToolTip.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tooltips/QueueToolTip.h fatrat-1.2.0+git20180628/src/tooltips/QueueToolTip.h --- fatrat-1.2.0~beta2/src/tooltips/QueueToolTip.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tooltips/QueueToolTip.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tooltips/TrayToolTip.cpp fatrat-1.2.0+git20180628/src/tooltips/TrayToolTip.cpp --- fatrat-1.2.0~beta2/src/tooltips/TrayToolTip.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tooltips/TrayToolTip.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/tooltips/TrayToolTip.h fatrat-1.2.0+git20180628/src/tooltips/TrayToolTip.h --- fatrat-1.2.0~beta2/src/tooltips/TrayToolTip.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/tooltips/TrayToolTip.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Transfer.cpp fatrat-1.2.0+git20180628/src/Transfer.cpp --- fatrat-1.2.0~beta2/src/Transfer.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Transfer.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/TransferFactory.cpp fatrat-1.2.0+git20180628/src/TransferFactory.cpp --- fatrat-1.2.0~beta2/src/TransferFactory.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/TransferFactory.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/TransferFactory.h fatrat-1.2.0+git20180628/src/TransferFactory.h --- fatrat-1.2.0~beta2/src/TransferFactory.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/TransferFactory.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/Transfer.h fatrat-1.2.0+git20180628/src/Transfer.h --- fatrat-1.2.0~beta2/src/Transfer.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/Transfer.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/TransfersModel.cpp fatrat-1.2.0+git20180628/src/TransfersModel.cpp --- fatrat-1.2.0~beta2/src/TransfersModel.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/TransfersModel.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/TransfersModel.h fatrat-1.2.0+git20180628/src/TransfersModel.h --- fatrat-1.2.0~beta2/src/TransfersModel.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/TransfersModel.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/TransfersView.h fatrat-1.2.0+git20180628/src/TransfersView.h --- fatrat-1.2.0~beta2/src/TransfersView.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/TransfersView.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/UserAuthDlg.h fatrat-1.2.0+git20180628/src/UserAuthDlg.h --- fatrat-1.2.0~beta2/src/UserAuthDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/UserAuthDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/util/ExtendedAttributes.cpp fatrat-1.2.0+git20180628/src/util/ExtendedAttributes.cpp --- fatrat-1.2.0~beta2/src/util/ExtendedAttributes.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/util/ExtendedAttributes.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/util/ExtendedAttributes.h fatrat-1.2.0+git20180628/src/util/ExtendedAttributes.h --- fatrat-1.2.0~beta2/src/util/ExtendedAttributes.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/util/ExtendedAttributes.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/WidgetHostChild.h fatrat-1.2.0+git20180628/src/WidgetHostChild.h --- fatrat-1.2.0~beta2/src/WidgetHostChild.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/WidgetHostChild.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/WidgetHostDlg.h fatrat-1.2.0+git20180628/src/WidgetHostDlg.h --- fatrat-1.2.0~beta2/src/WidgetHostDlg.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/WidgetHostDlg.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/src/XmlRpc.cpp fatrat-1.2.0+git20180628/src/XmlRpc.cpp --- fatrat-1.2.0~beta2/src/XmlRpc.cpp 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/XmlRpc.cpp 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's @@ -356,7 +355,7 @@ QDomElement methodName = root.firstChildElement("methodName"); if(methodName.isNull()) throw RuntimeException(QObject::tr("Not a valid XML-RPC call")); - function = methodName.firstChild().toText().data().toAscii(); + function = methodName.firstChild().toText().data().toUtf8(); QDomElement e = root.firstChildElement("params"); if(!e.isNull()) diff -Nru fatrat-1.2.0~beta2/src/XmlRpc.h fatrat-1.2.0+git20180628/src/XmlRpc.h --- fatrat-1.2.0~beta2/src/XmlRpc.h 2012-07-14 11:44:27.000000000 +0000 +++ fatrat-1.2.0+git20180628/src/XmlRpc.h 2018-07-05 18:20:27.000000000 +0000 @@ -6,7 +6,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License -version 2 as published by the Free Software Foundation. +version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,8 +14,7 @@ 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. +along with this program; if not, see . In addition, as a special exemption, Luboš Doležel gives permission to link the code of FatRat with the OpenSSL project's diff -Nru fatrat-1.2.0~beta2/.travis.yml fatrat-1.2.0+git20180628/.travis.yml --- fatrat-1.2.0~beta2/.travis.yml 1970-01-01 00:00:00.000000000 +0000 +++ fatrat-1.2.0+git20180628/.travis.yml 2018-07-05 18:20:27.000000000 +0000 @@ -0,0 +1,18 @@ +language: cpp +dist: trusty +sudo: required + +before_install: + - sudo add-apt-repository ppa:deluge-team/ppa -y + - sudo apt-get update -q + - wget http://cz.archive.ubuntu.com/ubuntu/pool/universe/p/pion/libpion-5.0_5.0.6+dfsg-1build1_amd64.deb + - wget http://cz.archive.ubuntu.com/ubuntu/pool/universe/p/pion/libpion-dev_5.0.6+dfsg-1build1_amd64.deb + - sudo dpkg -i libpion-5.0_5.0.6+dfsg-1build1_amd64.deb libpion-dev_5.0.6+dfsg-1build1_amd64.deb + +install: + - sudo apt-get -y install cmake libtorrent-rasterbar-dev libgloox-dev libasio-dev openjdk-7-jdk qt5-default libqt5webkit5-dev libqt5svg5-dev qttools5-dev + +script: + - cmake . -DCMAKE_INSTALL_PREFIX=_install-root -DWITH_EVERYTHING=On + - cmake --build . --target install +