MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / addHosts

Function addHosts

src/helper/windows/process_command.cpp:558–575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

556}
557
558std::string addHosts(const std::string &pars)
559{
560 std::wstring ip, hostname;
561 deserializePars(pars, ip, hostname);
562
563 if (!NetworkValidation::isValidIpAddress(ip)) {
564 spdlog::error(L"addHosts invalid IP address: \"{}\"", ip);
565 return serializeResult(false);
566 }
567 if (!NetworkValidation::isValidHostname(hostname)) {
568 spdlog::error(L"addHosts invalid hostname: \"{}\"", hostname);
569 return serializeResult(false);
570 }
571
572 spdlog::debug("addHosts");
573 bool success = HostsEdit::instance().addHosts(ip, hostname);
574 return serializeResult(success);
575}
576
577std::string removeHosts(const std::string &pars)
578{

Callers

nothing calls this directly

Calls 5

deserializeParsFunction · 0.85
serializeResultFunction · 0.85
isValidHostnameFunction · 0.85
isValidIpAddressFunction · 0.70
addHostsMethod · 0.45

Tested by

no test coverage detected