Changeset View
Changeset View
Standalone View
Standalone View
src/netbase.cpp
| Show First 20 Lines • Show All 752 Lines • ▼ Show 20 Lines | if (!ConnectToSocket(*sock, (struct sockaddr *)&sockaddr, len, | ||||
| return {}; | return {}; | ||||
| } | } | ||||
| return sock; | return sock; | ||||
| } | } | ||||
| std::unique_ptr<Sock> Proxy::Connect() const { | std::unique_ptr<Sock> Proxy::Connect() const { | ||||
| if (!IsValid()) { | if (!IsValid()) { | ||||
| LogPrintf("Cannot connect to invalid Proxy\n"); | |||||
| return {}; | return {}; | ||||
| } | } | ||||
| if (!m_is_unix_socket) { | if (!m_is_unix_socket) { | ||||
| return ConnectDirectly(proxy, /*manual_connection=*/true); | return ConnectDirectly(proxy, /*manual_connection=*/true); | ||||
| } | } | ||||
| #if HAVE_SOCKADDR_UN | #if HAVE_SOCKADDR_UN | ||||
| Show All 13 Lines | #if HAVE_SOCKADDR_UN | ||||
| addrun.sun_family = AF_UNIX; | addrun.sun_family = AF_UNIX; | ||||
| // leave the last char in addrun.sun_path[] to be always '\0' | // leave the last char in addrun.sun_path[] to be always '\0' | ||||
| memcpy(addrun.sun_path, path.c_str(), | memcpy(addrun.sun_path, path.c_str(), | ||||
| std::min(sizeof(addrun.sun_path) - 1, path.length())); | std::min(sizeof(addrun.sun_path) - 1, path.length())); | ||||
| socklen_t len = sizeof(addrun); | socklen_t len = sizeof(addrun); | ||||
| if (!ConnectToSocket(*sock, (struct sockaddr *)&addrun, len, path, | if (!ConnectToSocket(*sock, (struct sockaddr *)&addrun, len, path, | ||||
| /*manual_connection=*/true)) { | /*manual_connection=*/true)) { | ||||
| LogPrintf("Cannot connect to socket for %s\n", path); | |||||
| return {}; | return {}; | ||||
| } | } | ||||
| return sock; | return sock; | ||||
| #else | #else | ||||
| return {}; | return {}; | ||||
| #endif | #endif | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 209 Lines • Show Last 20 Lines | |||||