diff options
| author | Piotr Wiercinski <[email protected]> | 2025-03-24 12:59:29 +0100 |
|---|---|---|
| committer | Piotr Wiercinski <[email protected]> | 2025-03-26 19:35:48 +0100 |
| commit | caa0aa3fb4463322691664130332d570529c46b6 (patch) | |
| tree | cc83e59a5ea7bedce5c0f00c8301dc9c59a5cc57 /util | |
| parent | 75e10a0656eca0fb8dee71be1ad504707be1f9b1 (diff) | |
wasm: Fix Brotli compression in qtwasmserver.py
There is not compress() function in brotli.Compressor API.
Use process().
Use requirements.txt instead of Pipfile.
Change-Id: I55a0263f16f36bcb4b96e443f85925b7d5dd15af
Reviewed-by: Morten Johan Sørvig <[email protected]>
Diffstat (limited to 'util')
| -rw-r--r-- | util/wasm/qtwasmserver/Pipfile | 12 | ||||
| -rwxr-xr-x | util/wasm/qtwasmserver/qtwasmserver.py | 6 | ||||
| -rw-r--r-- | util/wasm/qtwasmserver/requirements.txt | 3 |
3 files changed, 4 insertions, 17 deletions
diff --git a/util/wasm/qtwasmserver/Pipfile b/util/wasm/qtwasmserver/Pipfile deleted file mode 100644 index ef542c10487..00000000000 --- a/util/wasm/qtwasmserver/Pipfile +++ /dev/null @@ -1,12 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -netifaces = "*" - -[dev-packages] - -[requires] -python_version = "3.9" diff --git a/util/wasm/qtwasmserver/qtwasmserver.py b/util/wasm/qtwasmserver/qtwasmserver.py index 208717a0bad..07ea1c6a249 100755 --- a/util/wasm/qtwasmserver/qtwasmserver.py +++ b/util/wasm/qtwasmserver/qtwasmserver.py @@ -4,15 +4,11 @@ import argparse import os -import pathlib -import socket import ssl import subprocess -import sys import tempfile import threading from enum import Enum -from http import HTTPStatus from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer from subprocess import run from functools import partial @@ -110,7 +106,7 @@ class CompressionHttpRequesthandler(HTTPCompressionRequestHandler): if not buf: yield compressor.finish() return - yield compressor.compress(buf) + yield compressor.process(buf) # must flush compressor state to work around crash/assert in brotlicffi, # see https://github.com/python-hyper/brotlicffi/issues/167 diff --git a/util/wasm/qtwasmserver/requirements.txt b/util/wasm/qtwasmserver/requirements.txt new file mode 100644 index 00000000000..3a30de1264d --- /dev/null +++ b/util/wasm/qtwasmserver/requirements.txt @@ -0,0 +1,3 @@ +Brotli==1.1.0 +httpcompressionserver==0.5 +netifaces==0.11.0 |
