Add setting for turning off HTTP/2

This commit is contained in:
Jonas Kvinge
2022-08-24 20:34:10 +02:00
parent 27b01d3642
commit d347e6fc5f
4 changed files with 21 additions and 0 deletions

View File

@@ -30,6 +30,7 @@
#include <QUrl>
#include <QSettings>
#include "core/utilities.h"
#include "core/timeconstants.h"
#include "core/networkproxyfactory.h"
#include "engine_fwd.h"
@@ -68,6 +69,7 @@ Engine::Base::Base(const EngineType type, QObject *parent)
channels_enabled_(false),
channels_(0),
bs2b_enabled_(false),
http2_enabled_(true),
about_to_end_emitted_(false) {}
Engine::Base::~Base() = default;
@@ -145,6 +147,13 @@ void Engine::Base::ReloadSettings() {
bs2b_enabled_ = s.value("bs2b", false).toBool();
bool http2_enabled = s.value("http2", false).toBool();
if (http2_enabled != http2_enabled_) {
http2_enabled_ = http2_enabled;
Utilities::SetEnv("SOUP_FORCE_HTTP1", http2_enabled_ ? "" : "1");
qLog(Debug) << "SOUP_FORCE_HTTP1:" << (http2_enabled_ ? "OFF" : "ON");
}
s.endGroup();
s.beginGroup(NetworkProxySettingsPage::kSettingsGroup);

View File

@@ -212,6 +212,7 @@ class Base : public QObject {
// Options
bool bs2b_enabled_;
bool http2_enabled_;
private:
bool about_to_end_emitted_;