Skip to content

Commit

Permalink
Remove uniqueID from client_t
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Feb 10, 2024
1 parent fbd26d0 commit 5ff80ad
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/nvhttp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ namespace nvhttp {
};

struct client_t {
std::string uniqueID;
std::vector<std::string> certs;
std::vector<named_cert_t> named_devices;
};
Expand Down Expand Up @@ -193,8 +192,6 @@ namespace nvhttp {
client_t &client = client_root;
pt::ptree node;

node.put("uniqueid"s, client.uniqueID);

pt::ptree named_cert_nodes;
for (auto &named_cert : client.named_devices) {
pt::ptree named_cert_node;
Expand Down Expand Up @@ -242,7 +239,6 @@ namespace nvhttp {

auto root = tree.get_child("root");
client_t client;
client.uniqueID = "0123456789ABCDEF"s;

// Import from old format
if (root.get_child_optional("devices")) {
Expand Down Expand Up @@ -282,11 +278,9 @@ namespace nvhttp {
case op_e::ADD: {
client_t &client = client_root;
client.certs.emplace_back(std::move(cert));
client.uniqueID = uniqueID;
} break;
case op_e::REMOVE:
client_t client;
client.uniqueID = uniqueID;
client_root = client;
break;
}
Expand Down Expand Up @@ -665,9 +659,7 @@ namespace nvhttp {
auto clientID = args.find("uniqueid"s);

if (clientID != std::end(args)) {
if (client_root.uniqueID == clientID->second) {
pair_status = 1;
}
pair_status = 1;
}
}

Expand Down Expand Up @@ -1151,7 +1143,6 @@ namespace nvhttp {
void
erase_all_clients() {
client_t client;
client.uniqueID = "0123456789ABCDEF"s;
client_root = client;
save_state();
}
Expand Down

0 comments on commit 5ff80ad

Please sign in to comment.