Skip to content

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

Description

@jleima

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)) {
    

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions