mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-12 16:02:43 +00:00
Merge remote-tracking branch 'origin/master' into 3957-mutable-over-http-speed
This commit is contained in:
commit
28ca5abe3c
0
newsfragments/3967.minor
Normal file
0
newsfragments/3967.minor
Normal file
@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"mach-nix": {
|
"mach-nix": {
|
||||||
"branch": "master",
|
"branch": "switch-to-nix-pypi-fetcher-2",
|
||||||
"description": "Create highly reproducible python environments",
|
"description": "Create highly reproducible python environments",
|
||||||
"homepage": "",
|
"homepage": "",
|
||||||
"owner": "davhau",
|
"owner": "PrivateStorageio",
|
||||||
"repo": "mach-nix",
|
"repo": "mach-nix",
|
||||||
"rev": "bdc97ba6b2ecd045a467b008cff4ae337b6a7a6b",
|
"rev": "f6d1a1841d8778c199326f95d0703c16bee2f8c4",
|
||||||
"sha256": "12b3jc0g0ak6s93g3ifvdpwxbyqx276k1kl66bpwz8a67qjbcbwf",
|
"sha256": "0krc4yhnpbzc4yhja9frnmym2vqm5zyacjnqb3fq9z9gav8vs9ls",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/davhau/mach-nix/archive/bdc97ba6b2ecd045a467b008cff4ae337b6a7a6b.tar.gz",
|
"url": "https://github.com/PrivateStorageio/mach-nix/archive/f6d1a1841d8778c199326f95d0703c16bee2f8c4.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
},
|
},
|
||||||
"niv": {
|
"niv": {
|
||||||
@ -53,10 +53,10 @@
|
|||||||
"homepage": "",
|
"homepage": "",
|
||||||
"owner": "DavHau",
|
"owner": "DavHau",
|
||||||
"repo": "pypi-deps-db",
|
"repo": "pypi-deps-db",
|
||||||
"rev": "5fe7d2d1c85cd86d64f4f079eef3f1ff5653bcd6",
|
"rev": "5440c9c76f6431f300fb6a1ecae762a5444de5f6",
|
||||||
"sha256": "0pc6mj7rzvmhh303rvj5wf4hrksm4h2rf4fsvqs0ljjdmgxrqm3f",
|
"sha256": "08r3iiaxzw9v2gq15y1m9bwajshyyz9280g6aia7mkgnjs9hnd1n",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://github.com/DavHau/pypi-deps-db/archive/5fe7d2d1c85cd86d64f4f079eef3f1ff5653bcd6.tar.gz",
|
"url": "https://github.com/DavHau/pypi-deps-db/archive/5440c9c76f6431f300fb6a1ecae762a5444de5f6.tar.gz",
|
||||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
9
setup.py
9
setup.py
@ -139,11 +139,10 @@ install_requires = [
|
|||||||
"werkzeug != 2.2.0",
|
"werkzeug != 2.2.0",
|
||||||
"treq",
|
"treq",
|
||||||
"cbor2",
|
"cbor2",
|
||||||
# Ideally we want 0.4+ to be able to pass in mmap(), but it's not strictly
|
|
||||||
# necessary yet until we fix the workaround to
|
# 0.4 adds the ability to pass in mmap() values which greatly reduces the
|
||||||
# https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3963 in
|
# amount of copying involved.
|
||||||
# allmydata.storage.http_server.
|
"pycddl >= 0.4",
|
||||||
"pycddl",
|
|
||||||
|
|
||||||
# for pid-file support
|
# for pid-file support
|
||||||
"psutil",
|
"psutil",
|
||||||
|
@ -11,7 +11,6 @@ import binascii
|
|||||||
from tempfile import TemporaryFile
|
from tempfile import TemporaryFile
|
||||||
from os import SEEK_END, SEEK_SET
|
from os import SEEK_END, SEEK_SET
|
||||||
import mmap
|
import mmap
|
||||||
from importlib.metadata import version as get_package_version, PackageNotFoundError
|
|
||||||
|
|
||||||
from cryptography.x509 import Certificate as CryptoCertificate
|
from cryptography.x509 import Certificate as CryptoCertificate
|
||||||
from zope.interface import implementer
|
from zope.interface import implementer
|
||||||
@ -63,20 +62,6 @@ from ..util.deferredutil import async_to_deferred
|
|||||||
from allmydata.interfaces import BadWriteEnablerError
|
from allmydata.interfaces import BadWriteEnablerError
|
||||||
|
|
||||||
|
|
||||||
# Until we figure out Nix (https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3963),
|
|
||||||
# need to support old pycddl which can only take bytes:
|
|
||||||
from distutils.version import LooseVersion
|
|
||||||
|
|
||||||
try:
|
|
||||||
PYCDDL_BYTES_ONLY = LooseVersion(get_package_version("pycddl")) < LooseVersion(
|
|
||||||
"0.4"
|
|
||||||
)
|
|
||||||
except PackageNotFoundError:
|
|
||||||
# This can happen when building PyInstaller distribution. We'll just assume
|
|
||||||
# you installed a modern pycddl, cause why wouldn't you?
|
|
||||||
PYCDDL_BYTES_ONLY = False
|
|
||||||
|
|
||||||
|
|
||||||
class ClientSecretsException(Exception):
|
class ClientSecretsException(Exception):
|
||||||
"""The client did not send the appropriate secrets."""
|
"""The client did not send the appropriate secrets."""
|
||||||
|
|
||||||
@ -576,7 +561,7 @@ class HTTPServer(object):
|
|||||||
fd = request.content.fileno()
|
fd = request.content.fileno()
|
||||||
except (ValueError, OSError):
|
except (ValueError, OSError):
|
||||||
fd = -1
|
fd = -1
|
||||||
if fd >= 0 and not PYCDDL_BYTES_ONLY:
|
if fd >= 0:
|
||||||
# It's a file, so we can use mmap() to save memory.
|
# It's a file, so we can use mmap() to save memory.
|
||||||
message = mmap.mmap(fd, 0, access=mmap.ACCESS_READ)
|
message = mmap.mmap(fd, 0, access=mmap.ACCESS_READ)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user