diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd/Destination.cpp /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd/Destination.cpp --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd/Destination.cpp 2026-08-19 21:54:11.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd/Destination.cpp 2026-08-19 20:14:21.000000000 +0000 @@ -13,5 +13,4 @@ #include #include -#include #include #include "Crypto.h" @@ -1682,18 +1681,5 @@ if (IsRunning ()) { - // the destination's own thread may still be handling packets of this - // very destination, so tear it down there rather than under the caller - if (GetIOService ().get_executor ().running_in_this_thread ()) - ClientDestination::Stop (); - else - { - std::promise done; - boost::asio::post (GetIOService (), [this, &done]() - { - ClientDestination::Stop (); - done.set_value (); - }); - done.get_future ().wait (); - } + ClientDestination::Stop (); StopIOService (); } diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/TorrentsRPC.cpp /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/TorrentsRPC.cpp --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/TorrentsRPC.cpp 2026-08-19 21:54:11.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/TorrentsRPC.cpp 2026-08-19 20:14:21.000000000 +0000 @@ -47,5 +47,4 @@ int64_t GetTag (boost::json::object& jsonRequest) const; std::string GetNewFieldName (std::string_view fieldName) const; - boost::json::value GetFieldValue (std::string_view field, std::shared_ptr torrent); std::string HandleTorrrentAdd (boost::json::object&& jsonRequest); @@ -189,4 +188,5 @@ } + static boost::json::value GetFieldValue (std::string_view field, std::shared_ptr torrent); std::string JSONRPCHandler::HandleTorrrentGet (boost::json::object&& jsonRequest) { @@ -215,8 +215,9 @@ { boost::json::object t; - t["id"] = id; for (const auto& field: fields) { - if (field != "id") + if (field == "id") + t["id"] = id; + else { auto fieldValue = GetFieldValue (field.as_string (), torrent); @@ -232,5 +233,5 @@ } - boost::json::value JSONRPCHandler::GetFieldValue (std::string_view field, std::shared_ptr torrent) + static boost::json::value GetFieldValue (std::string_view field, std::shared_ptr torrent) { const static std::map)> > fields = @@ -255,15 +256,6 @@ } }, - { "pieces", [](std::shared_ptr torrent) - { - auto [bitfield, empry] = torrent->CreateBitfield (); - std::string b64pieces; - b64pieces.resize (boost::beast::detail::base64::encoded_size (bitfield.size())); - boost::beast::detail::base64::encode (b64pieces.data (), bitfield.data(), bitfield.size()); - return boost::json::value(b64pieces); - } - }, { "error", [](std::shared_ptr torrent) { return boost::json::value(0); } }, // no error - { "eta", [](std::shared_ptr torrent) { return boost::json::value(600); } }, // TODO: + { "eta", [](std::shared_ptr torrent) { return boost::json::value(0); } }, // TODO: { "uploadRatio", [](std::shared_ptr torrent) { return boost::json::value(1); } } // TODO: };