diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/Torrents.cpp /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/Torrents.cpp --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/Torrents.cpp 2026-09-01 01:51:30.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/Torrents.cpp 2026-08-31 23:57:45.000000000 +0000 @@ -162,5 +162,5 @@ if (!name.empty () && !value.empty ()) { - s << CreateByteString (name); s << value; + s << name; s << value; } s << 'e'; @@ -1630,5 +1630,5 @@ void PeerConnection::AddExtendedMsgHandler (std::string_view extensionName, int64_t msgID) { - if (extensionName == EXTENSION_NAME_UT_METADATA) + if (extensionName == "ut_metadata") m_ExtendedMessageHandlers.emplace (msgID, &PeerConnection::HandleUtMetadataExtension); } @@ -1639,11 +1639,5 @@ if (!extendedMsgID) // handshake { - str = CreateDictionary ({ - { "m", CreateDictionary ({ - { EXTENSION_NAME_UT_METADATA, CreateInteger (EXTENSION_MSGID_UT_METADATA) } - }) }, - { "metadata_size", CreateInteger (m_Torrent->GetInfo ().size ()) }, - { "v", CreateByteString ("i2pd") } - }); + str = CreateDictionary ({{ CreateByteString ("v"), CreateByteString ("i2pd") }}); payload = str; } @@ -1690,8 +1684,8 @@ { size_t totalSize = std::min (info.size () - offset, REQUEST_BLOCK_SIZE); - SendExtendedMsg (EXTENSION_MSGID_UT_METADATA, - CreateDictionary ({{ "msg_type", CreateInteger (1) }, - { "piece", CreateInteger (piece) }, - { "total_size", CreateInteger (totalSize) } }), + SendExtendedMsg (3, // TODO: msgID from table + CreateDictionary ({{ CreateByteString ("msg_type"), CreateInteger (1) }, + { CreateByteString ("piece"), CreateInteger (piece) }, + { CreateByteString ("total_size"), CreateInteger (totalSize) } }), std::string_view ((const char *)info.data () + offset, totalSize)); } diff -U2 -r /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/Torrents.h /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/Torrents.h --- /var/lib/copr-rpmbuild/results/i2pd-git/upstream-unpacked/Source0/i2pd-openssl/libi2pd_client/Torrents.h 2026-09-01 01:51:30.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/Torrents.h 2026-08-31 23:57:45.000000000 +0000 @@ -54,8 +54,4 @@ constexpr size_t HAVE_MSG_PAYLOAD_LENGTH = 4; - // extensions - constexpr std::string_view EXTENSION_NAME_UT_METADATA { "ut_metadata" }; - constexpr uint8_t EXTENSION_MSGID_UT_METADATA = 1; - enum MessageType { 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-09-01 01:51:30.000000000 +0000 +++ /var/lib/copr-rpmbuild/results/i2pd-git/srpm-unpacked/i2pd-openssl.tar.gz-extract/i2pd-openssl/libi2pd_client/TorrentsRPC.cpp 2026-08-31 23:57:45.000000000 +0000 @@ -540,6 +540,5 @@ if (tunnel) { - static constexpr std::string_view appjson { "application/json" }; - if (m_Request[boost::beast::http::field::content_type].compare (0, appjson.size (), appjson) || // starts with + if (m_Request[boost::beast::http::field::content_type] == "application/json" || m_Request[boost::beast::http::field::content_type] == "application/x-www-form-urlencoded") { @@ -618,8 +617,5 @@ if (!path.empty ()) rpcPath += std::string (path) + "/"; - // insert both pathes rpc and rpc/ - rpcPath += "rpc"; - m_Tunnels.emplace (rpcPath, tunnel); - rpcPath += "/"; + rpcPath += "rpc/"; m_Tunnels.emplace (rpcPath, tunnel); }