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 <morten.sorvig@qt.io>
This commit is contained in:
parent
75e10a0656
commit
caa0aa3fb4
@ -1,12 +0,0 @@
|
||||
[[source]]
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
netifaces = "*"
|
||||
|
||||
[dev-packages]
|
||||
|
||||
[requires]
|
||||
python_version = "3.9"
|
@ -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
|
||||
|
3
util/wasm/qtwasmserver/requirements.txt
Normal file
3
util/wasm/qtwasmserver/requirements.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Brotli==1.1.0
|
||||
httpcompressionserver==0.5
|
||||
netifaces==0.11.0
|
Loading…
x
Reference in New Issue
Block a user