Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor-perf: move tcp listener address shared ptr #38348

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/common/network/tcp_listener_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ absl::Status TcpListenerImpl::onSocketEvent(short flags) {
if (!local_address) {
auto address_or_error = io_handle->localAddress();
RETURN_IF_NOT_OK_REF(address_or_error.status());
local_address = *address_or_error;
local_address = std::move(address_or_error.value());
}

// The accept() call that filled in remote_addr doesn't fill in more than the sa_family field
Expand All @@ -106,12 +106,12 @@ absl::Status TcpListenerImpl::onSocketEvent(short flags) {
if (remote_addr.ss_family == AF_UNIX) {
auto address_or_error = io_handle->peerAddress();
RETURN_IF_NOT_OK_REF(address_or_error.status());
remote_address = *address_or_error;
remote_address = std::move(address_or_error.value());
} else {
auto address_or_error = Address::addressFromSockAddr(
remote_addr, remote_addr_len, local_address->ip()->version() == Address::IpVersion::v6);
RETURN_IF_NOT_OK_REF(address_or_error.status());
remote_address = *address_or_error;
remote_address = std::move(address_or_error.value());
}

cb_.onAccept(std::make_unique<AcceptedSocketImpl>(std::move(io_handle), local_address,
Expand Down
Loading