This commit is contained in:
Timur A. Fatkhullin
2024-10-29 01:21:24 +03:00
parent 1047b57013
commit 4e3e3ec60e
7 changed files with 109 additions and 87 deletions

View File

@@ -15,7 +15,7 @@ int main(int argc, char* argv[])
options.add_options()("h,help", "Print usage");
options.add_options()(
"endpoints", "endpoints server will be listening for",
cxxopts::value<std::vector<std::string>>()->default_value("local://stream/tmp/ADC_ASIO_TEST_SERVER"));
cxxopts::value<std::vector<std::string>>()->default_value("local://stream/@ADC_ASIO_TEST_SERVER"));
options.parse_positional({"endpoints"});
@@ -37,11 +37,10 @@ int main(int argc, char* argv[])
adc::AdcEndpointParser epn(ep);
if (epn.isValid()) {
if (epn.isLocalSeqpacket() || epn.isLocalStream()) {
if (opt_result["abstract"].as<bool>()) {
auto s = epn.path<std::span<char>>();
if (s[0] == '@') { // replace '@' to '\0' (use of UNIX abstract namespace)
s[0] = '\0';
}
if (epn.path()[0] == '@') { // replace '@' to '\0' (use of UNIX abstract namespace)
auto it = std::ranges::find(ep, '@');
*it = '\0';
epn = adc::AdcEndpointParser(ep);
}
}