Update comment following #31108 (#31947)

For UNIX sockets, code has been fixed but comment and log were not.
pull/32014/head^2
Frédéric Nadeau 2 years ago committed by GitHub
parent bbce3cc643
commit 96bb8b9c5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/core/lib/iomgr/tcp_server_posix.cc

@ -230,13 +230,13 @@ static void on_read(void* arg, grpc_error_handle err) {
}
// For UNIX sockets, the accept call might not fill up the member sun_path
// of sockaddr_un, so explicitly call getsockname to get it.
// of sockaddr_un, so explicitly call getpeername to get it.
if (grpc_is_unix_socket(&addr)) {
memset(&addr, 0, sizeof(addr));
addr.len = static_cast<socklen_t>(sizeof(struct sockaddr_storage));
if (getpeername(fd, reinterpret_cast<struct sockaddr*>(addr.addr),
&(addr.len)) < 0) {
gpr_log(GPR_ERROR, "Failed getsockname: %s",
gpr_log(GPR_ERROR, "Failed getpeername: %s",
grpc_core::StrError(errno).c_str());
close(fd);
goto error;

Loading…
Cancel
Save