Add setting for turning off HTTP/2
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
|
#include "core/utilities.h"
|
||||||
#include "core/timeconstants.h"
|
#include "core/timeconstants.h"
|
||||||
#include "core/networkproxyfactory.h"
|
#include "core/networkproxyfactory.h"
|
||||||
#include "engine_fwd.h"
|
#include "engine_fwd.h"
|
||||||
@@ -68,6 +69,7 @@ Engine::Base::Base(const EngineType type, QObject *parent)
|
|||||||
channels_enabled_(false),
|
channels_enabled_(false),
|
||||||
channels_(0),
|
channels_(0),
|
||||||
bs2b_enabled_(false),
|
bs2b_enabled_(false),
|
||||||
|
http2_enabled_(true),
|
||||||
about_to_end_emitted_(false) {}
|
about_to_end_emitted_(false) {}
|
||||||
|
|
||||||
Engine::Base::~Base() = default;
|
Engine::Base::~Base() = default;
|
||||||
@@ -145,6 +147,13 @@ void Engine::Base::ReloadSettings() {
|
|||||||
|
|
||||||
bs2b_enabled_ = s.value("bs2b", false).toBool();
|
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.endGroup();
|
||||||
|
|
||||||
s.beginGroup(NetworkProxySettingsPage::kSettingsGroup);
|
s.beginGroup(NetworkProxySettingsPage::kSettingsGroup);
|
||||||
|
|||||||
@@ -212,6 +212,7 @@ class Base : public QObject {
|
|||||||
|
|
||||||
// Options
|
// Options
|
||||||
bool bs2b_enabled_;
|
bool bs2b_enabled_;
|
||||||
|
bool http2_enabled_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool about_to_end_emitted_;
|
bool about_to_end_emitted_;
|
||||||
|
|||||||
@@ -166,6 +166,8 @@ void BackendSettingsPage::Load() {
|
|||||||
|
|
||||||
ui_->checkbox_bs2b->setChecked(s.value("bs2b", false).toBool());
|
ui_->checkbox_bs2b->setChecked(s.value("bs2b", false).toBool());
|
||||||
|
|
||||||
|
ui_->checkbox_http2->setChecked(s.value("http2", false).toBool());
|
||||||
|
|
||||||
ui_->spinbox_bufferduration->setValue(s.value("bufferduration", kDefaultBufferDuration).toInt());
|
ui_->spinbox_bufferduration->setValue(s.value("bufferduration", kDefaultBufferDuration).toInt());
|
||||||
ui_->spinbox_low_watermark->setValue(s.value("bufferlowwatermark", kDefaultBufferLowWatermark).toDouble());
|
ui_->spinbox_low_watermark->setValue(s.value("bufferlowwatermark", kDefaultBufferLowWatermark).toDouble());
|
||||||
ui_->spinbox_high_watermark->setValue(s.value("bufferhighwatermark", kDefaultBufferHighWatermark).toDouble());
|
ui_->spinbox_high_watermark->setValue(s.value("bufferhighwatermark", kDefaultBufferHighWatermark).toDouble());
|
||||||
@@ -476,6 +478,8 @@ void BackendSettingsPage::Save() {
|
|||||||
|
|
||||||
s.setValue("bs2b", ui_->checkbox_bs2b->isChecked());
|
s.setValue("bs2b", ui_->checkbox_bs2b->isChecked());
|
||||||
|
|
||||||
|
s.setValue("http2", ui_->checkbox_http2->isChecked());
|
||||||
|
|
||||||
s.setValue("bufferduration", ui_->spinbox_bufferduration->value());
|
s.setValue("bufferduration", ui_->spinbox_bufferduration->value());
|
||||||
s.setValue("bufferlowwatermark", ui_->spinbox_low_watermark->value());
|
s.setValue("bufferlowwatermark", ui_->spinbox_low_watermark->value());
|
||||||
s.setValue("bufferhighwatermark", ui_->spinbox_high_watermark->value());
|
s.setValue("bufferhighwatermark", ui_->spinbox_high_watermark->value());
|
||||||
|
|||||||
@@ -252,6 +252,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkbox_http2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable HTTP/2 for streaming</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user