aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/src/meshbay_node/transport/quic_server.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/transport/quic_server.py')
-rw-r--r--packages/meshbay-node/src/meshbay_node/transport/quic_server.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/transport/quic_server.py b/packages/meshbay-node/src/meshbay_node/transport/quic_server.py
index 715448f..3974a2f 100644
--- a/packages/meshbay-node/src/meshbay_node/transport/quic_server.py
+++ b/packages/meshbay-node/src/meshbay_node/transport/quic_server.py
@@ -48,6 +48,7 @@ from meshbay_common.handshake import (
quic_binding,
verify_proof,
)
+from meshbay_common.paths import long_path
from meshbay_common.protocol import MNP, file_chunk_wire
from meshbay_node.indexer import GroupIndex
@@ -434,7 +435,7 @@ class _MNPServerProtocol(QuicConnectionProtocol):
if file_path is None:
self._send(stream_id, {"type": "error", "detail": ROOT_NOT_SERVED})
return
- if not file_path.exists():
+ if not os.path.exists(long_path(file_path)):
self._send(stream_id, {"type": "error", "detail": "File not on disk"})
return
@@ -463,7 +464,7 @@ def _read_and_encrypt(
file_id: str = "",
) -> dict:
"""Read one chunk off disk and encrypt it, in the one shape every transport uses."""
- with open(file_path, "rb") as f:
+ with open(long_path(file_path), "rb") as f:
f.seek(chunk_index * CHUNK_SIZE)
plaintext = f.read(CHUNK_SIZE)
return file_chunk_wire(gek, plaintext, chunk_index, file_hash, file_id)