diff options
| author | Bitflash <admin@bitflash.network> | 2026-08-13 16:52:59 -0300 |
|---|---|---|
| committer | Bitflash <admin@bitflash.network> | 2026-08-13 16:52:59 -0300 |
| commit | 54908b8bc42cc7886eef2ed913f1745eba5a8cca (patch) | |
| tree | 8afbe2bea9f9f68d142535ddf96b0096d4f01871 /src/tor.cpp | |
| parent | 111da0606d0a82703dacba815fdf809ad86e3f6a (diff) | |
| parent | a49ee4206735ac16876a01064e5438c719161b17 (diff) | |
Merge pull request 'net: auto-start bundled managed Tor' (#37) from auto-managed-tor into main
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, |