Copilot commented on code in PR #1953:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1953#discussion_r2031268892
##########
extensions/sftp/client/SFTPClient.cpp:
##########
@@ -719,8 +719,8 @@ bool SFTPClient::listDirectory(const std::string& path,
bool follow_symlinks,
});
LIBSSH2_SFTP_ATTRIBUTES attrs;
- std::vector<char> filename(4096U);
- std::vector<char> longentry(4096U);
+ std::array<char, utils::configuration::DEFAULT_BUFFER_SIZE> filename{};
+ std::array<char, utils::configuration::DEFAULT_BUFFER_SIZE> longentry{};
Review Comment:
For consistency and to enable runtime configurability, consider replacing
the use of the compile‐time DEFAULT_BUFFER_SIZE with a call to
utils::configuration::getBufferSize(*configuration) in this buffer allocation.
```suggestion
auto buffer_size = utils::configuration::getBufferSize(*configuration);
std::vector<char> filename(buffer_size);
std::vector<char> longentry(buffer_size);
```
##########
extensions/sftp/client/SFTPClient.cpp:
##########
@@ -719,8 +719,8 @@ bool SFTPClient::listDirectory(const std::string& path,
bool follow_symlinks,
});
LIBSSH2_SFTP_ATTRIBUTES attrs;
- std::vector<char> filename(4096U);
- std::vector<char> longentry(4096U);
+ std::array<char, utils::configuration::DEFAULT_BUFFER_SIZE> filename{};
Review Comment:
For consistency with other modules that retrieve the buffer size at runtime,
consider using utils::configuration::getBufferSize(*configuration) instead of
the compile‐time DEFAULT_BUFFER_SIZE constant in this declaration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]