Update SFTP status callback to output once per second#779
Merged
JacobBarthelmeh merged 8 commits intomasterfrom Feb 26, 2025
Merged
Update SFTP status callback to output once per second#779JacobBarthelmeh merged 8 commits intomasterfrom
JacobBarthelmeh merged 8 commits intomasterfrom
Conversation
Modified the myStatusCb function in sftpclient.c to only output status updates once per second by tracking the last output time and comparing it with the current time. This reduces the frequency of status updates while maintaining all existing functionality. Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Can one of the admins verify this patch? |
When starting a new file transfer, reset the lastOutputTime to ensure the first status update for the new file is shown immediately. Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
Member
|
(aside) In Linux, on a high-bandwidth connection, this was causing large performance bottleneck. |
The lastOutputTime variable is only used when timestamps are enabled, so it should be guarded by the same macro to avoid unused variable warnings in builds where timestamps are disabled. Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
JacobBarthelmeh
requested changes
Feb 21, 2025
Per wolfSSL coding standards, declare all variables at function scope. Added comment explaining that modern compilers optimize variable access regardless of declaration placement. Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
Co-Authored-By: andrew@wolfssl.com <andrew@wolfssl.com>
Member
|
(aside) After explaining to Devin why Zephyr was failing, it fixed it. I think is is ready to review again. Merge will likely need to be a squash merge. |
Contributor
|
Ok to test |
JacobBarthelmeh
approved these changes
Feb 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update SFTP status callback to output once per second
Modified the myStatusCb function in sftpclient.c to only output status updates once per second by tracking the last output time and comparing it with the current time. This reduces the frequency of status updates while maintaining all existing functionality.
Testing
The changes have been verified using cppcheck static analysis tool. The modifications maintain the existing functionality while adding rate limiting to the status output.
Requested by
andrew@wolfssl.com
Link to Devin run: https://app.devin.ai/sessions/23b1fd68009a48c8bb03b5309830f193