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

Reduce SCP Allocations #717

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Reduce SCP Allocations #717

merged 1 commit into from
Jul 16, 2024

Conversation

ejohnstown
Copy link
Contributor

DESCRIPTION

wolfSCP allocates a few buffers as needed and frees them immediately when done. It also checks at shutdown if the buffers need to be freed and frees them. When copying a large file (sink action), it will alloc and free the file buffer for each chunk of file sent by the peer. This could lead to fragmentation. Change the file receive and command buffers to be allocated when needed, and don't free them until cleanup.

TESTING

./examples/scpclient/wolfscp -u john -i ~/.ssh/id_ecdsa -j ~/.ssh/id_ecdsa.pub -S $PWD/configure:$HOME/configure -p 22
sha256sum configure ~/configure

1. Create the SCP file and recv msg buffer once, and just keep it.
2. Whitespace.
@douzzer douzzer merged commit 9054adf into wolfSSL:master Jul 16, 2024
24 checks passed
@ejohnstown ejohnstown deleted the scp-alloc branch July 16, 2024 20:43
jefferyq2 pushed a commit to jefferyq2/wolfssh that referenced this pull request Sep 24, 2024
jefferyq2 pushed a commit to jefferyq2/wolfssh that referenced this pull request Oct 18, 2024
jefferyq2 pushed a commit to jefferyq2/wolfssh that referenced this pull request Oct 29, 2024
jefferyq2 pushed a commit to jefferyq2/wolfssh that referenced this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants