Skip to content

Commit

Permalink
Reset speed info on network error
Browse files Browse the repository at this point in the history
  • Loading branch information
zenden2k committed Oct 7, 2022
1 parent bec0c32 commit 87e8fc5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions KeeneticPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class Worker
}

void loadData() {
bool success = false;
nc_->setUrl(settings_->routerUrl + "/rci/");
std::string s =
R"({"show":{"interface":{"rrd":[{"name":"ISP","attribute":"rxspeed","detail":0},{"name":"ISP","attribute":"txspeed","detail":0}]}}})";
Expand All @@ -212,6 +213,7 @@ class Worker
Json::Value upload = *data3.begin();
uploadSpeed_ = upload["v"].asDouble() / 1000000.0;
}
success = true;
}
}
else {
Expand All @@ -223,6 +225,11 @@ class Worker

RmLog(rm_, LOG_ERROR, msg.c_str());
}

if (!success) {
downloadSpeed_ = 0.0;
uploadSpeed_ = 0.0;
}
}
};

Expand Down
4 changes: 2 additions & 2 deletions KeeneticPlugin.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,3,0
FILEVERSION 1,0,4,0
PRODUCTVERSION 3,0,2,2161
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
Expand All @@ -24,7 +24,7 @@ BEGIN
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileVersion", "1.0.3.0"
VALUE "FileVersion", "1.0.4.0"
VALUE "LegalCopyright", "� 2021 - Sergey Svistunov"

// Don't change the entries below!
Expand Down

0 comments on commit 87e8fc5

Please sign in to comment.