Skip to content

Commit

Permalink
Disable system proxy support on Linux
Browse files Browse the repository at this point in the history
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 telegramdesktop#27482.
  • Loading branch information
ilya-fedin authored and john-preston committed Feb 17, 2024
1 parent 89c7147 commit 3af646a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Telegram/SourceFiles/core/sandbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ For license and copyright information please follow this link:
#include <QtGui/QSessionManager>
#include <QtGui/QScreen>
#include <QtGui/qpa/qplatformscreen.h>
#include <ksandbox.h>

namespace Core {
namespace {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3af646a

Please sign in to comment.