Add FTP and magnet backends, tracker and proxy settings, and organize client modules

Integrate pinned libcurl, libtorrent and static OpenSSL dependencies with license notices. Enable verified HTTPS trackers and authenticated HTTP/SOCKS5 proxies, add tracker TXT import without arbitrary list caps, and allow resizing the main window.

Organize client sources by responsibility and update Visual Studio projects, filters and tests. Debug and Release builds passed, along with UI, HTTP, tracker import and browser bridge regressions. Full protocol tests have an unresolved intermittent HTTPS tracker wait timeout; Windows 7 runtime validation remains outstanding.
This commit is contained in:
tongtong committed 2026-11-27 11:28:30 +08:00
1 parent a787f470ed
commit eb3df9aa3d
63 files changed
+2185 -100

No files matched your search

+5 -3
View File
@@ -1,4 +1,5 @@
#include "http_transport.h"
#include "settings/proxy_settings.h"
#include "transport/http_transport.h"
#include <future>
#include <chrono>
#include <array>
@@ -22,7 +23,7 @@ static void Run(const std::wstring& base) {
http::UrlParts parts;
Check(transport->ParseUrl(L"https://example.test:8443/path?x=1",parts) && parts.https && parts.port==8443
&& parts.host==L"example.test" && parts.path==L"/path?x=1","backend URL parsing");
Check(!transport->ParseUrl(L"ftp://example.test/file",parts),"reject unsupported scheme");
Check(!transport->ParseUrl(L"sftp://example.test/file",parts),"reject unsupported scheme");
std::vector<char> payload;
for (int i=0;i<256*257;++i) payload.push_back(static_cast<char>(i%256));
const std::string tail="TTDownloader-http"; payload.insert(payload.end(),tail.begin(),tail.end());
@@ -83,7 +84,7 @@ static void Run(const std::wstring& base) {
context.user_agent=L"bad\r\nInjected: yes";
Check(transport->Open(context).kind==http::OpenError::kInvalidRequest,"browser headers cannot inject additional headers");
}
http::Request invalid; invalid.url=L"ftp://example.test/file";
http::Request invalid; invalid.url=L"sftp://example.test/file";
Check(transport->Open(invalid).kind==http::OpenError::kInvalidRequest,"invalid URL classification");
invalid.url=base+L"/plain"; invalid.range_offset=-1;
Check(transport->Open(invalid).kind==http::OpenError::kInvalidRequest,"negative range offset classification");
@@ -93,6 +94,7 @@ static void Run(const std::wstring& base) {
int wmain(int argc,wchar_t** argv) {
if (argc!=2) { std::cerr<<"Expected loopback server URL\n"; return 2; }
try {
SetCurrentProxy({});
// All transport I/O runs on a worker, without UI, user tasks or SQLite.
std::async(std::launch::async,Run,std::wstring(argv[1])).get();
std::cout<<"PASS: HTTP full/range/ignored range, status errors, redirects, chunked data, 64-bit length, timeout and stream lifetime\n";