diff options
| author | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-13 16:37:08 -0300 |
|---|---|---|
| committer | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-13 16:37:08 -0300 |
| commit | a49ee4206735ac16876a01064e5438c719161b17 (patch) | |
| tree | e7ce26e9ec3b6c65602193237e9d8feea80d2682 /src/tor.cpp | |
| parent | ea08342aba66400f588c6a03685a6f39927cb062 (diff) | |
net: auto-start bundled managed Tor
Diffstat (limited to 'src/tor.cpp')
| -rw-r--r-- | src/tor.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tor.cpp b/src/tor.cpp index e47ee44..20b4577 100644 --- a/src/tor.cpp +++ b/src/tor.cpp | |||
| @@ -500,6 +500,21 @@ static std::string ResolveTorPath(const std::string& torPathOpt) | |||
| 500 | #endif | 500 | #endif |
| 501 | } | 501 | } |
| 502 | 502 | ||
| 503 | bool BtfBundledTorPath(std::string& torPathOut) | ||
| 504 | { | ||
| 505 | torPathOut.clear(); | ||
| 506 | std::string exeDir = ExecutableDir(); | ||
| 507 | #ifdef _WIN32 | ||
| 508 | std::string path = PathJoin(exeDir, "tor/tor.exe"); | ||
| 509 | #else | ||
| 510 | std::string path = PathJoin(exeDir, "tor/tor"); | ||
| 511 | #endif | ||
| 512 | if (!FileIsExecutableCandidate(path)) | ||
| 513 | return false; | ||
| 514 | torPathOut = path; | ||
| 515 | return true; | ||
| 516 | } | ||
| 517 | |||
| 503 | std::string BtfBuildManagedTorrcForTest(const std::string& dataDir, | 518 | std::string BtfBuildManagedTorrcForTest(const std::string& dataDir, |
| 504 | const std::string& hiddenServiceDir, | 519 | const std::string& hiddenServiceDir, |
| 505 | unsigned short socksPort, | 520 | unsigned short socksPort, |