Skip to content

Commit fb0bc80

Browse files
committed
fix cpu hour reporting
1 parent 6510ff1 commit fb0bc80

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ To install or update LODA, please follow the [installation instructions](https:/
22

33
## [Unreleased]
44

5+
### Bugfixes
6+
7+
* Fix CPU hour reporting using `wget`
8+
59
### Enhancements
610

711
* Increase max number of interpreter cycles to 10 million

src/web_client.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ bool WebClient::postFile(const std::string &url, const std::string &file_path,
6767
} else {
6868
cmd += " --data-binary \"@" + file_path + "\"";
6969
}
70-
cmd += " " + url;
7170
break;
7271
}
7372
case WC_WGET: {
@@ -77,12 +76,17 @@ bool WebClient::postFile(const std::string &url, const std::string &file_path,
7776
cmd += " --user '" + auth.substr(0, colon) + "' --password '" +
7877
auth.substr(colon + 1) + "'";
7978
}
80-
cmd += " --post-file \"" + file_path + "\" " + url;
79+
if (file_path.empty()) {
80+
cmd += " --post-data \"\"";
81+
} else {
82+
cmd += " --post-file \"" + file_path + "\"";
83+
}
8184
break;
8285
}
8386
default:
8487
Log::get().error("Unsupported web client for POST request", true);
8588
}
89+
cmd += " " + url;
8690
const std::string msg = "Executing command: " + cmd;
8791
if (enable_debug) {
8892
Log::get().info(msg);

0 commit comments

Comments
 (0)