From 3af646a584561733269920c0f7713e2f8d5c8470 Mon Sep 17 00:00:00 2001 From: Ilya Fedin <fedin-ilja2010@ya.ru> Date: Sat, 17 Feb 2024 23:12:12 +0400 Subject: [PATCH] Disable system proxy support on Linux Reading system proxy on Linux reads to massive crashes in system libraries. Since those crashes are unreproducible in development environment, it's not possible to find the root cause. Workarounds #27482. --- Telegram/SourceFiles/core/sandbox.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index 6feacdb5b..fb145f7f1 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -33,6 +33,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include <QtGui/QSessionManager> #include <QtGui/QScreen> #include <QtGui/qpa/qplatformscreen.h> +#include <ksandbox.h> namespace Core { namespace { @@ -517,8 +518,10 @@ void Sandbox::refreshGlobalProxy() { || proxy.type == MTP::ProxyData::Type::Http) { QNetworkProxy::setApplicationProxy( MTP::ToNetworkProxy(MTP::ToDirectIpProxy(proxy))); - } else if (!Core::IsAppLaunched() - || Core::App().settings().proxy().isSystem()) { + } else if ((!Core::IsAppLaunched() + || Core::App().settings().proxy().isSystem()) + // this works stable only in sandboxed environment where it works through portal + && (!Platform::IsLinux() || KSandbox::isInside() || cDebugMode())) { QNetworkProxyFactory::setUseSystemConfiguration(true); } else { QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);