Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

file-transfers and printing: read files as needed #4308

Open
totaam opened this issue Jul 26, 2024 · 0 comments
Open

file-transfers and printing: read files as needed #4308

totaam opened this issue Jul 26, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@totaam
Copy link
Collaborator

totaam commented Jul 26, 2024

Even reading from stdin is handled as one big blob:

if self.filename == "-":
# replace with filename proposed
self.filename = command[2]
# read file from stdin
with open(sys.stdin.fileno(), mode="rb", closefd=False) as stdin_binary:
self.file_data = stdin_binary.read()
log("read %i bytes from stdin", len(self.file_data))
else:
if not self.validate_file_size(os.path.getsize(self.filename)):
return
from xpra.util.io import load_binary_file
self.file_data = load_binary_file(self.filename)
log("read %i bytes from %s", len(self.file_data), self.filename)

Instead, we should be using Gio.InputStream instead.

See also #2990, #3329

@totaam totaam added the enhancement New feature or request label Jul 26, 2024
totaam added a commit that referenced this issue Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant