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

+43 -4
View File
@@ -1,10 +1,13 @@
#include "settings/proxy_settings.h"
#include "ui/proxy_form.h"
#include "ttui/application.h"
#include "ttui/window.h"
#include "ttui/virtual_list.h"
#include "platform.h"
#include "task_store.h"
#include "settings_form.h"
#include "add_task_form.h"
#include "platform/platform.h"
#include "storage/task_store.h"
#include "ui/settings_form.h"
#include "ui/add_task_form.h"
#include "ui/tracker_form.h"
#include <future>
#include <commctrl.h>
#include <iostream>
@@ -44,6 +47,7 @@ private:
};
int main() {
try {
SetCurrentProxy({});
ttui::VirtualList list;
list.Configure(100000,10); list.ScrollTo(999999);
auto [first,last]=list.Visible(); Check(first==99990 && last==100000,"viewport end clamp");
@@ -143,6 +147,41 @@ int main() {
settings.Close(); Check(closed==1,"appearance close callback once");
int proxy_applies=0;
ProxyForm proxy(&appearance,[&] { ++proxy_applies; });
Check(proxy.Create(window.GetHWND(),ProxyForm::kClassName.c_str(),L"Proxy test",620,380),"create proxy settings page");
SendMessageW(proxy.GetHWND(),WM_COMMAND,12,0);
Check(IsWindowEnabled(GetDlgItem(proxy.GetHWND(),100)),"SOCKS5 enables proxy fields");
Check(SendMessageW(GetDlgItem(proxy.GetHWND(),103),EM_GETPASSWORDCHAR,0,0)!=0,"proxy password is masked");
SetWindowTextW(GetDlgItem(proxy.GetHWND(),100),L"bad/host");
SendMessageW(proxy.GetHWND(),WM_COMMAND,1,0);
Check(proxy_applies==0,"invalid proxy cannot be saved or applied");
proxy.Close();
Check(proxy.Create(window.GetHWND(),ProxyForm::kClassName.c_str(),L"Proxy reopen",620,380) && GetDlgItem(proxy.GetHWND(),103),"proxy fields survive recreation");
proxy.Close();
int tracker_applies=0;
TrackerForm trackers(&appearance,[&](const auto&) { ++tracker_applies; });
Check(trackers.Create(window.GetHWND(),TrackerForm::kClassName.c_str(),L"Tracker settings test",680,480),"create tracker settings page");
auto tracker_edit=GetDlgItem(trackers.GetHWND(),100);
Check((GetWindowLongPtrW(tracker_edit,GWL_STYLE)&ES_MULTILINE)!=0,"tracker editor is native multiline edit");
std::wstring long_edit(40000,L'x');
SetWindowTextW(tracker_edit,L"");
SendMessageW(tracker_edit,EM_REPLACESEL,FALSE,reinterpret_cast<LPARAM>(long_edit.c_str()));
Check(ttui::Window::EditText(tracker_edit)==long_edit,"tracker editor accepts typing and paste beyond 32767 characters");
SetWindowTextW(tracker_edit,L"http://127.0.0.1:8080/announce");
SendMessageW(tracker_edit,EM_SETSEL,-1,-1); SendMessageW(tracker_edit,WM_KEYDOWN,VK_RETURN,0); SendMessageW(tracker_edit,WM_CHAR,VK_RETURN,0);
Check(ttui::Window::EditText(tracker_edit).find(L'\n')!=std::wstring::npos && tracker_applies==0,"Return inserts newline instead of saving tracker page");
SetWindowTextW(tracker_edit,L"file:///example.test/announce"); SendMessageW(trackers.GetHWND(),WM_COMMAND,1,0);
Check(tracker_applies==0 && trackers.IsOpen(),"invalid trackers cannot be silently saved");
auto import_source=GetDlgItem(trackers.GetHWND(),101); Check(import_source!=nullptr,"online TXT source input exists");
SetWindowTextW(import_source,L"http://127.0.0.1:1/trackers.txt");
SendMessageW(trackers.GetHWND(),WM_COMMAND,4,0);
Check(!IsWindowEnabled(tracker_edit),"import runs in background and protects the editor from conflicting changes");
trackers.Close();
Check(trackers.Create(window.GetHWND(),TrackerForm::kClassName.c_str(),L"Tracker settings reopen",680,480) && GetDlgItem(trackers.GetHWND(),100),"tracker controls survive window recreation");
Check(IsWindowEnabled(GetDlgItem(trackers.GetHWND(),100)) && GetDlgItem(trackers.GetHWND(),101),"closing an import cannot disable the next window instance");
trackers.Close();
int submissions=0;
std::wstring submitted_url,submitted_directory;
AddTaskForm add(&appearance,[&](const std::wstring& url,const std::wstring& directory) {
+3 -2
View File
@@ -23,7 +23,8 @@
</ClCompile>
<Link><SubSystem>Console</SubSystem><AdditionalDependencies>uuid.lib;%(AdditionalDependencies)</AdditionalDependencies></Link>
</ItemDefinitionGroup>
<ItemGroup><ClCompile Include="smoke.cpp" /><ClCompile Include="..\..\..\client\src\add_task_form.cpp" /><ClCompile Include="..\..\..\client\src\settings_form.cpp" /><ClCompile Include="..\..\..\client\src\task_store.cpp" /><ClCompile Include="..\..\..\third_party\sqlite3\sqlite3.c"><WarningLevel>TurnOffAllWarnings</WarningLevel></ClCompile></ItemGroup>
<ItemGroup><ClCompile Include="smoke.cpp" /><ClCompile Include="..\..\..\client\src\ui\proxy_form.cpp" /><ClCompile Include="..\..\..\client\src\ui\tracker_form.cpp" /><ClCompile Include="..\..\..\client\src\settings\tracker_import.cpp" /><ClCompile Include="..\..\..\client\src\transport\winhttp_transport.cpp" /><ClCompile Include="..\..\..\client\src\transport\http_transport.cpp" /><ClCompile Include="..\..\..\client\src\transport\ftp_transport.cpp" /><ClCompile Include="..\..\..\client\src\ui\add_task_form.cpp" /><ClCompile Include="..\..\..\client\src\ui\settings_form.cpp" /><ClCompile Include="..\..\..\client\src\storage\task_store.cpp" /><ClCompile Include="..\..\..\third_party\sqlite3\sqlite3.c"><WarningLevel>TurnOffAllWarnings</WarningLevel></ClCompile></ItemGroup>
<ItemGroup><ProjectReference Include="..\ttui.vcxproj"><Project>{19F8F655-C0F5-4AD9-B999-58D23F95AB43}</Project></ProjectReference></ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="..\..\..\third_party\dependencies.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>