-
Notifications
You must be signed in to change notification settings - Fork 186
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
ENT-12414: Use librsync
's Stream API in GET <FILENAME>
requests
#5629
base: master
Are you sure you want to change the base?
Conversation
c29dfd8
to
937589a
Compare
37a8af2
to
9cb3c14
Compare
fafd971
to
af5bd02
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me otherwise. Very nice! Thanks for taking the hard road! 👏 🍻 I'm very excited about this!
b627503
to
2e808ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if it works! 😁 🤞 🍻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments and little typos.
libcfnet/file_stream.c
Outdated
/* librsync has rs_file_size() which basically does the same thing. | ||
* However, it is only available in the most recent versions of the | ||
* library. Hence, we provide our own implementation in order to have | ||
* some backwards compatibility in terms of librsync versions. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you be specific here about the version in which rs_file_size() was added?
Are there any minimum version notes in INSTALL and configure.ac that prevent problems with the code as-is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some more info in the comment. When it comes to minimum version checks, it does not seem like we have this for any of the other dependencies. If you think we should have these checks, then we should probably make a separate ticket for this.
f728290
to
8ad0742
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
Just tested this manually on Windows and it works like a charm.
Did however find a separate (surprisingly unrelated) issue in |
This commit was added while working on implementing the File Stream API in ticket ENT-12414. The File Stream API utilizes librsync. To begin with I had `AC_CHECK_HEADERS([librsync_export.h], [], AC_MSG_ERROR(Cannot find librsync))` in configure.ac. This file did not exist in earlier versions of librync. Hence, I upgraded the Ubuntu platforms in GitHub CI to make configure work. Later a realized that I should remove that line enirely to make CFEngine compatible with earlier versions. However, it does not hurt to upgrade the Ubuntu platforms, so decided on keeping this commit. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
After upgrading GitHub CI platorms to Ubuntu 24, the ASAN Unit Tests started complaining about One Definition Rule (ODR) violations. Hence, I disabled ODR and created a follow-up ticket (see CFE-4454) to fix the violations and enable ODR again. Ticket: None Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Ticket: ENT-12414 Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
Added API for streaming file contents over the network using the RSYNC algorithm from librsync. Ticket: ENT-12414 Changelog: None Signed-off-by: Lars Erik Wik <[email protected]> Co-authored-by: Craig Comstock <[email protected]>
Ticket: ENT-12414 Changelog: Title Signed-off-by: Lars Erik Wik <[email protected]> Co-authored-by: Craig Comstock <[email protected]>
The implementation is based on the previous protocol for `GET <FILENAME>` requests that used sparse files. Ticket: ENT-12414 Changelog: Title Signed-off-by: Lars Erik Wik <[email protected]>
Apparently there are functions called `SendMessage()` and `GetFileSize()` in the Win32 API. I fixed these name conflicts by adding a `Protocol` prefix to all functions related to the simple network protocol for file stream communication. Furthermore, I changed the name of `GetFileSize()` to `GetSizeOfFile()`. Ticket: ENT-12414 Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
TODO:
librsync
as dependency in CI