Skip to content

Commit

Permalink
Re-define an undefined endpoint (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 authored Jan 8, 2024
1 parent 51be942 commit 49a2710
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMake/build-from-src.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function(build_from_src [dep])
BUILD_IN_SOURCE ON
CONFIGURE_COMMAND ./config -fPIC --prefix=${BINARY_DIR} --openssldir=${BINARY_DIR} shared
BUILD_COMMAND make -j 1 # https://github.com/openssl/openssl/issues/5762#issuecomment-376622684
INSTALL_COMMAND $(MAKE) install
INSTALL_COMMAND make install
LOG_CONFIGURE ON
LOG_BUILD ON
LOG_INSTALL ON
Expand Down
4 changes: 2 additions & 2 deletions net/kernel_socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,8 +1035,8 @@ extern "C" ISocketServer* new_fstack_dpdk_socket_server() {

/* Implementations in socket.h */

EndPoint::EndPoint(const char* s) {
estring_view ep(s);
EndPoint::EndPoint(const char* _ep) {
estring_view ep(_ep);
auto pos = ep.find_last_of(':');
if (pos == estring::npos)
return;
Expand Down
5 changes: 3 additions & 2 deletions net/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ namespace net {
uint16_t port = 0;
EndPoint() = default;
EndPoint(IPAddr ip, uint16_t port) : addr(ip), port(port) {}
explicit EndPoint(const char* s);
explicit EndPoint(const char* ep);
EndPoint(const char* ip, uint16_t port) : addr(ip), port(port) {}
bool is_ipv4() const {
return addr.is_ipv4();
};
Expand All @@ -161,7 +162,7 @@ namespace net {
return !operator==(rhs);
}
bool undefined() const {
return addr.undefined() && port == 0;
return addr.undefined();
}
};

Expand Down

0 comments on commit 49a2710

Please sign in to comment.