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

Issue 29, check for bad client version #40

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dreamer-dead
Copy link
Contributor

Hi!

Here is my initial version of client version validation (#29), so we can discuss this approach.
Constant 100 for version is a sample only.
Should we expose that minimal version value to C++ code and keep it sync with the default value in proto file?
Please, take a look.

@@ -13,6 +13,17 @@ using namespace std::placeholders;
namespace dist_clang {
namespace daemon {

namespace {

bool ValidateClientVersion(ui32 client_version) {
Copy link
Owner

Choose a reason for hiding this comment

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

Looking at this function only I can say that this approach is not anticipated. The backward-compatible version should be the field in the Absorber config. Since the usual situation is when the clients (Emitters) are updated much more often than Absorbers, it's convenient to update this field without redistributing the new package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, will do.

@dreamer-dead dreamer-dead force-pushed the issue-29 branch 2 times, most recently from 89dee14 to 4b056fd Compare November 11, 2015 16:23
@dreamer-dead
Copy link
Contributor Author

Added a new field in Absorber config with tests.
Check for minimum version is quite straightforward, and we can add a max_version to check version in some interval.

@@ -7,6 +7,7 @@ package dist_clang.daemon.proto;
message Remote {
optional base.proto.Flags flags = 1;
optional string source = 2;
optional uint32 emitter_version = 3 [ default = 100 ];
Copy link
Owner

Choose a reason for hiding this comment

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

Let it be simply "version" - and the default value should be real, i.e. the current version (790.0). Also the real version is complex and consists of two numbers: better to reflect it as a separate message type, like:

message Version {
  optional uint32 major = 1 [ default = 790 ];
  optional uint32 minor = 2 [ default = 0];
}

This message type should be shared with a its counterpart in Absorber message.

@abyss7
Copy link
Owner

abyss7 commented Nov 11, 2015

Done with review.

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.

2 participants