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

client.version() < mMinSupportedServer does not work for Client 2.11 & Min 2.3 #65

Open
jleima opened this issue Jun 24, 2024 · 0 comments

Comments

@jleima
Copy link

jleima commented Jun 24, 2024

I fixed this by making all the float, strings. Everywhere there is something like

  • float mServerVersion;
  • std::string mServerVersion;
  • mServerVersion(-1.0)
  • mServerVersion("0")

-SpeedTest::SpeedTest(float minServerVersion) :
+SpeedTest::SpeedTest(std::string minServerVersion) :

+bool version_ok (std::string client, std::string min_ver) {

  • unsigned maj = 0, min = 0, bug = 0;
  • unsigned maj2 = 0, min2 = 0, bug2 = 0;
  • sscanf(client.c_str(), "%u.%u.%u", &maj, &min, &bug);
  • sscanf(min_ver.c_str(), "%u.%u.%u", &maj2, &min2, &bug2);
  • if (maj < maj2) return false;
  • if (maj > maj2) return true;
  • if (min < min2) return false;
  • if (min > min2) return true;
  • if (bug < bug2) return false;
  • if (bug > bug2) return true;
  • return true;
    +}
  • if (client.connect() && client.version() >= mMinSupportedServer) {
  • if (client.connect() && (version_ok (client.version() , mMinSupportedServer))) {
  •    if (client.version() < mMinSupportedServer) {
    
  •    if (!version_ok (client.version() , mMinSupportedServer)) {
    
@jleima jleima changed the title client.version() and mMinSupportedServer do not work for Client 2.11 & Min 2.3 client.version() < mMinSupportedServer do not work for Client 2.11 & Min 2.3 Jun 24, 2024
@jleima jleima changed the title client.version() < mMinSupportedServer do not work for Client 2.11 & Min 2.3 client.version() < mMinSupportedServer does not work for Client 2.11 & Min 2.3 Jun 24, 2024
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

No branches or pull requests

1 participant