Skip to content

Commit b968803

Browse files
committed
cr comments
1 parent 0e3b8af commit b968803

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,7 @@ elseif(NOT WIN32 OR (CMAKE_SYSTEM_PROCESSOR STREQUAL "X86") OR (CMAKE_SYSTEM_PRO
270270
set(lvru_system_name ${CMAKE_SYSTEM_NAME})
271271
if (CMAKE_SYSTEM_NAME STREQUAL "Cygwin")
272272
set(lvru_system_name "windows")
273-
endif()
274-
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
273+
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
275274
set(lvru_system_name "macosx")
276275
endif()
277276
set(lvru_system_processor ${CMAKE_SYSTEM_PROCESSOR})

src/viam/sdk/rpc/dial.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#include <algorithm>
21
#include <viam/sdk/rpc/dial.hpp>
32

3+
#include <algorithm>
44
#include <istream>
55
#include <string>
66

@@ -151,17 +151,16 @@ std::shared_ptr<ViamChannel> ViamChannel::dial(const char* uri,
151151
}
152152
char* proxy_path = ::dial(
153153
uri, entity, type, payload, opts.allows_insecure_downgrade(), float_timeout.count(), ptr);
154-
if (proxy_path == NULL) {
154+
if (!proxy_path) {
155155
free_rust_runtime(ptr);
156156
throw Exception(ErrorCondition::k_connection, "Unable to establish connecting path");
157157
}
158158

159159
std::string localhost_prefix("127.0.0.1");
160-
auto tcp_check = std::mismatch(localhost_prefix.begin(), localhost_prefix.end(), proxy_path);
161160
std::string address;
162-
if (tcp_check.first != localhost_prefix.end()) {
163-
// proxy path is not a localhost address and is therefore a UDS socket
164-
address += "unix://";
161+
if (std::string(proxy_path).find(localhost_prefix) == std::string::npos) {
162+
// proxy path is not a localhost address and is therefore a unix domain socket (UDS)
163+
address += "unix:";
165164
}
166165
address += proxy_path;
167166

0 commit comments

Comments
 (0)