Skip to content

Commit

Permalink
Merge pull request #471 from airdcpp-web/develop
Browse files Browse the repository at this point in the history
2.12.2
  • Loading branch information
maksis authored Jul 7, 2024
2 parents a5fa83c + d95b502 commit 79fdb87
Show file tree
Hide file tree
Showing 524 changed files with 1,924 additions and 30,269 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install cmake nodejs python3 pkg-config libbz2-dev zlib1g-dev libssl-dev libstdc++6 libminiupnpc-dev libnatpmp-dev libtbb-dev \
libmaxminddb-dev libleveldb-dev libboost1.74-dev libboost-regex1.74 libboost-thread1.74 libboost-system1.74
libmaxminddb-dev libleveldb-dev libboost1.74-dev libboost-regex1.74 libboost-thread1.74 libboost-system1.74 nlohmann-json3-dev
- name: Install dependencies on macOS
if: ${{ runner.os == 'macOS' }}
run: |
brew upgrade
brew install boost libmaxminddb leveldb libnatpmp miniupnpc openssl pkg-config tbb
brew install boost libmaxminddb leveldb libnatpmp miniupnpc openssl pkg-config tbb nlohmann-json
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl/
- name: Install websocketpp
run: |
git clone https://github.com/zaphoyd/websocketpp.git
git clone -b develop https://github.com/zaphoyd/websocketpp.git
cd websocketpp
cmake .
sudo make install
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Output
airdcppd/airdcppd
node_modules
package-lock.json
trace.txt

*.o
*.so
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.12)
cmake_minimum_required (VERSION 3.16)
project (airdcpp-webclient)

if (APPLE)
Expand All @@ -10,8 +10,8 @@ endif (APPLE)
set (PROJECT_NAME "AirDC++ Web Client")
set (TAG_APPLICATION "AirDC++w")
set (APPLICATION_ID "airdcpp-web")
set (VERSION "2.12.1") # NOTE: the minor version must match the lastest UI version
set (SOVERSION "2.12.1" )
set (VERSION "2.12.2") # NOTE: the minor version must match the lastest UI version
set (SOVERSION "2.12.2" )

set (GNUCXX_MINIMUM_VERSION "7.0")

Expand All @@ -22,7 +22,6 @@ include (CheckFunctionExists)
include (FindPkgConfig)
include (CheckCXXSourceCompiles)
include (cmake/CheckAtomic.cmake)
include (cmake/cotire.cmake)


# PRE-CHECKS
Expand Down Expand Up @@ -97,6 +96,7 @@ find_package (OpenSSL REQUIRED)
find_package (Threads REQUIRED)
find_package (Iconv REQUIRED)
find_package (Miniupnpc REQUIRED)
find_package (nlohmann_json 3.0.0 REQUIRED)
if(ENABLE_NATPMP)
find_package (LibNatpmp)
endif()
Expand Down Expand Up @@ -210,7 +210,7 @@ add_definitions (-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT
-D_DATADIR="${CLIENT_DATA_DIR}" -DLOCALE_DIR="${LOCALE_DIR}" -DBUILDING_AIRDCPP)

if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pipe")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20 -pipe")
if (USE_GOLD)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-linker-plugin")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-linker-plugin")
Expand Down
10 changes: 4 additions & 6 deletions airdcpp-core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project (airdcpp)
include_directories(${PROJECT_BINARY_DIR})
cmake_minimum_required (VERSION 3.0.2)
cmake_minimum_required (VERSION 3.16)

aux_source_directory(${PROJECT_SOURCE_DIR}/airdcpp airdcpp_srcs)
file (GLOB airdcpp_hdrs ${PROJECT_SOURCE_DIR}/airdcpp/*.h)
Expand Down Expand Up @@ -88,11 +88,9 @@ ${OPENSSL_LIBRARIES} ${ICONV_LIBRARIES} ${airdcpp_extra_libs} ${UPNP} ${Boost_LI

set_target_properties(airdcpp PROPERTIES VERSION ${SOVERSION} OUTPUT_NAME "airdcpp")

set_target_properties(airdcpp PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "airdcpp/stdinc.h")
if (COMMAND cotire)
cotire(airdcpp)
endif()

target_precompile_headers(airdcpp PUBLIC
"$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/airdcpp/stdinc.h>"
)


#if (WIN32)
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/ActionHook.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/ActivityManager.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2011-2023 AirDC++ Project
* Copyright (C) 2011-2024 AirDC++ Project
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/ActivityManager.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2011-2023 AirDC++ Project
* Copyright (C) 2011-2024 AirDC++ Project
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/AdcCommand.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/AdcCommand.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
18 changes: 10 additions & 8 deletions airdcpp-core/airdcpp/AdcHub.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down Expand Up @@ -92,7 +92,7 @@ size_t AdcHub::getUserCount() const noexcept {
size_t userCount = 0;

RLock l(cs);
for (const auto& u: users | map_values) {
for (const auto& u: users | views::values) {
if (!u->isHidden()) {
++userCount;
}
Expand Down Expand Up @@ -126,7 +126,7 @@ OnlineUser* AdcHub::findUser(const uint32_t aSID) const noexcept {

OnlineUser* AdcHub::findUser(const CID& aCID) const noexcept {
RLock l(cs);
for(const auto& ou: users | map_values) {
for(const auto& ou: users | views::values) {
if(ou->getUser()->getCID() == aCID) {
return ou;
}
Expand Down Expand Up @@ -273,14 +273,16 @@ void AdcHub::handle(AdcCommand::INF, AdcCommand& c) noexcept {

//we have to update the modes in case our connectivity changed

if (oldState != STATE_NORMAL || any_of(c.getParameters().begin(), c.getParameters().end(), [](const string& p) { return p.substr(0, 2) == "SU" || p.substr(0, 2) == "I4" || p.substr(0, 2) == "I6"; })) {
if (oldState != STATE_NORMAL || ranges::any_of(c.getParameters(), [](const string& p) {
return p.substr(0, 2) == "SU" || p.substr(0, 2) == "I4" || p.substr(0, 2) == "I6";
})) {
fire(ClientListener::HubUpdated(), this);

OnlineUserList ouList;

{
RLock l(cs);
boost::algorithm::copy_if(users | map_values, back_inserter(ouList), [this](OnlineUser* ou) {
ranges::copy_if(users | views::values, back_inserter(ouList), [this](OnlineUser* ou) {
return ou->getIdentity().getTcpConnectMode() != Identity::MODE_ME && ou->getIdentity().updateAdcConnectModes(getMyIdentity(), this);
});
}
Expand Down Expand Up @@ -882,7 +884,7 @@ void AdcHub::handle(AdcCommand::TCP, AdcCommand& c) noexcept {

statusMessage(STRING_F(HBRI_VALIDATING_X, (v6 ? "IPv6" : "IPv4")), LogMessage::SEV_INFO);
stopValidation = false;
hbriThread.reset(new std::thread([=] { sendHBRI(hbriHubUrl, hbriPort, token, v6); }));
hbriThread.reset(new std::thread([=, this] { sendHBRI(hbriHubUrl, hbriPort, token, v6); }));
}

void AdcHub::sendHBRI(const string& aIP, const string& aPort, const string& aToken, bool v6) {
Expand Down Expand Up @@ -1632,7 +1634,7 @@ void AdcHub::on(Second s, uint64_t aTick) noexcept {

OnlineUserPtr AdcHub::findUser(const string& aNick) const noexcept {
RLock l(cs);
for(const auto& ou: users | map_values) {
for(const auto& ou: users | views::values) {
if(ou->getIdentity().getNick() == aNick) {
return ou;
}
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/AdcHub.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/AddressInfo.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
8 changes: 4 additions & 4 deletions airdcpp-core/airdcpp/AirUtil.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2011-2023 AirDC++ Project
* Copyright (C) 2011-2024 AirDC++ Project
*
* 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,
Expand Down Expand Up @@ -234,7 +234,7 @@ int AirUtil::adapterSort(const AdapterInfo& lhs, const AdapterInfo& rhs) noexcep
}

void AirUtil::ensureBindAddress(AdapterInfoList& adapters_, const string& aBindAddress) noexcept {
auto cur = boost::find_if(adapters_, [&aBindAddress](const AdapterInfo& aInfo) { return aInfo.ip == aBindAddress; });
auto cur = ranges::find_if(adapters_, [&aBindAddress](const AdapterInfo& aInfo) { return aInfo.ip == aBindAddress; });
if (cur == adapters_.end()) {
adapters_.emplace_back(STRING(UNKNOWN), aBindAddress, static_cast<uint8_t>(0));
cur = adapters_.end() - 1;
Expand Down Expand Up @@ -341,7 +341,7 @@ string AirUtil::getLocalIp(bool v6) noexcept {
return Util::emptyString;
}

auto p = boost::find_if(adapters, [v6](const AdapterInfo& aAdapterInfo) { return Util::isPublicIp(aAdapterInfo.ip, v6); });
auto p = ranges::find_if(adapters, [v6](const AdapterInfo& aAdapterInfo) { return Util::isPublicIp(aAdapterInfo.ip, v6); });
if (p != adapters.end()) {
return p->ip;
}
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/AirUtil.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2011-2023 AirDC++ Project
* Copyright (C) 2011-2024 AirDC++ Project
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/BZUtils.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/BZUtils.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/BloomFilter.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/BufferedSocket.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/BufferedSocket.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
4 changes: 2 additions & 2 deletions airdcpp-core/airdcpp/BufferedSocketListener.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* Copyright (C) 2001-2023 Jacek Sieka, arnetheduck on gmail point com
* Copyright (C) 2001-2024 Jacek Sieka, arnetheduck on gmail point com
*
* 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,
Expand Down
Loading

0 comments on commit 79fdb87

Please sign in to comment.