Philipp Hörist pushed to branch master at gajim / gajim


Commits:
bdf8e32c by Philipp Hörist at 2026-06-04T19:49:57+02:00
imprv: Disable http2 by default

As it seems either our library or servers have compatibility problems

- - - - -


5 changed files:

- gajim/common/file_transfer_manager.py
- gajim/common/multiprocess/http.py
- gajim/common/multiprocess/url_preview.py
- gajim/common/setting_values.py
- gajim/gtk/message_url_previews.py


Changes:

=====================================
gajim/common/file_transfer_manager.py
=====================================
@@ -146,6 +146,7 @@ def http_request(
                 encryption_data=encryption_data,
                 decryption_data=decryption_data,
                 proxy=None if proxy is None else proxy.get_uri(),
+                http2=app.settings.get("use_http2"),
             )
         except Exception as error:
             log.exception(error)


=====================================
gajim/common/multiprocess/http.py
=====================================
@@ -143,6 +143,7 @@ def http_request(
     encryption_data: AESKeyData | None = None,
     decryption_data: AESKeyData | None = None,
     proxy: str | None = None,
+    http2: bool = False,
 ) -> HTTPResult:
     trust_env = True
     if proxy == "direct://":
@@ -153,7 +154,7 @@ def http_request(
     client = httpx.Client(
         timeout=timeout,
         verify=ctx,
-        http2=True,
+        http2=http2,
         proxy=proxy,
         trust_env=trust_env,
         follow_redirects=True,


=====================================
gajim/common/multiprocess/url_preview.py
=====================================
@@ -22,6 +22,7 @@ def generate_url_preview(
     url: str,
     event: threading.Event,
     proxy: str | None,
+    http2: bool,
 ) -> OpenGraphData | None:
     result = http_request(
         event=event,
@@ -31,6 +32,7 @@ def generate_url_preview(
         timeout=5,
         max_download_size=1024 * 150,
         proxy=proxy,
+        http2=http2,
     )
 
     html_content, _ = utf8_decode(result.content)
@@ -48,6 +50,7 @@ def generate_url_preview(
             url=og_data.image,
             timeout=5,
             proxy=proxy,
+            http2=http2,
         )
 
         og_data.thumbnail = _make_thumbnail(image_result.content)


=====================================
gajim/common/setting_values.py
=====================================
@@ -79,6 +79,7 @@ class _ACCOUNTDEFAULT:
     "sounddnd",
     "sounds_on",
     "trayicon_notification_on_events",
+    "use_http2",
     "use_keyring",
     "use_kib_mib",
     "use_speller",
@@ -245,6 +246,7 @@ class _ACCOUNTDEFAULT:
     "stun_server": "",
     "time_format": "%H:%M",
     "trayicon_notification_on_events": True,
+    "use_http2": False,
     "use_keyring": True,
     "use_kib_mib": False,
     "use_speller": True,
@@ -589,6 +591,7 @@ class WorkspaceSettings(TypedDict):
         "search_engine": "",
         "stun_server": _("STUN server to use when using Jingle"),
         "time_format": 
"https://docs.python.org/3/library/time.html#time.strftime";,  # noqa: E501
+        "use_http2": _("Use HTTP2 for requests if there is server support"),
         "use_kib_mib": _("IEC standard says KiB = 1024 bytes, KB = 1000 
bytes."),
         "use_stun_server": _(
             "If enabled, Gajim will try to use a STUN server when using 
Jingle."


=====================================
gajim/gtk/message_url_previews.py
=====================================
@@ -136,6 +136,7 @@ def _request_url_preview(self, url: str) -> None:
                 url,
                 event,
                 None if proxy is None else proxy.get_uri(),
+                app.settings.get("use_http2"),
             )
         except Exception as error:
             log.warning("Unable to generate preview: %s %s", url, error)



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/bdf8e32ce1d9a665c1ffb18e3289311a89483e94

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/bdf8e32ce1d9a665c1ffb18e3289311a89483e94
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to