mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
remove debug macros
This commit is contained in:
@@ -52,26 +52,19 @@ bool Xray::startXray(const QString &cfg)
|
|||||||
// Temporary aid for manual verification of SOCKS auth (inbounds.settings.accounts).
|
// Temporary aid for manual verification of SOCKS auth (inbounds.settings.accounts).
|
||||||
// Debug: always writes. Release: set env AMNEZIA_SAVE_XRAY_CONFIG=1 (if the daemon inherits it).
|
// Debug: always writes. Release: set env AMNEZIA_SAVE_XRAY_CONFIG=1 (if the daemon inherits it).
|
||||||
{
|
{
|
||||||
#if defined(MZ_DEBUG)
|
|
||||||
const bool saveForTest = true;
|
|
||||||
#else
|
|
||||||
const bool saveForTest = !qgetenv("AMNEZIA_SAVE_XRAY_CONFIG").isEmpty();
|
|
||||||
#endif
|
|
||||||
if (saveForTest) {
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
const QString debugPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation)
|
const QString debugPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation)
|
||||||
+ QStringLiteral("/amnezia-xray-config.json");
|
+ QStringLiteral("/amnezia-xray-config.json");
|
||||||
#else
|
#else
|
||||||
const QString debugPath = QStringLiteral("/tmp/amnezia-xray-config.json");
|
const QString debugPath = QStringLiteral("/tmp/amnezia-xray-config.json");
|
||||||
#endif
|
#endif
|
||||||
QFile f(debugPath);
|
QFile f(debugPath);
|
||||||
if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
|
||||||
f.write(bytes);
|
f.write(bytes);
|
||||||
f.close();
|
f.close();
|
||||||
qDebug() << "[xray] wrote last config for testing:" << debugPath;
|
qDebug() << "[xray] wrote last config for testing:" << debugPath;
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "[xray] failed to write test config to" << debugPath;
|
qWarning() << "[xray] failed to write test config to" << debugPath;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (auto err = amnezia_xray_configure(bytes.data()); err != nullptr) {
|
if (auto err = amnezia_xray_configure(bytes.data()); err != nullptr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user