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

Use the block size determined by asyncssh if nothing is specified #52

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mxmlnkn
Copy link
Contributor

@mxmlnkn mxmlnkn commented Oct 3, 2024

Fixes #49

Note that the limits property will be added with this commit, which has not been released yet. It would be prudent to wait for this API to stabilize with the next version release of asyncssh.

This implementation checks for the existence of this property anyway, so that it also works with older versions of asyncssh.

I also need to check how it should behave / behaves with a server not supporting the limits query. Probably simply check max_read_len for None.

@mxmlnkn mxmlnkn force-pushed the use-larger-blocks branch from 80f3285 to f8443c3 Compare October 3, 2024 10:54

self.kwargs = kwargs

self._file = sync(self.loop, self._open_file)
self._closed = False

def _determine_block_size(self, channel):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be cached? should it be async?

@@ -81,6 +90,9 @@ async def _open_file(self):
def readable(self):
return "r" in self.mode

def seekable(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs rebase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use the default block size of asyncssh instead of overwriting it to 48 KiB
2 participants