Merge pull request #14887 from ericgribkoff/socklen_asserts

drop unnecessary/invalid asserts
pull/14902/head
Eric Gribkoff 7 years ago committed by GitHub
commit c958b70219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      src/core/lib/iomgr/socket_utils_linux.cc
  2. 1
      src/core/lib/iomgr/socket_utils_posix.cc
  3. 1
      src/core/lib/iomgr/tcp_server_utils_posix_common.cc
  4. 1
      src/core/lib/iomgr/udp_server.cc

@ -34,7 +34,6 @@ int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
int cloexec) {
int flags = 0;
GPR_ASSERT(sizeof(socklen_t) <= sizeof(size_t));
GPR_ASSERT(resolved_addr->len <= (socklen_t)-1);
flags |= nonblock ? SOCK_NONBLOCK : 0;
flags |= cloexec ? SOCK_CLOEXEC : 0;
return accept4(sockfd, reinterpret_cast<grpc_sockaddr*>(resolved_addr->addr),

@ -35,7 +35,6 @@ int grpc_accept4(int sockfd, grpc_resolved_address* resolved_addr, int nonblock,
int cloexec) {
int fd, flags;
GPR_ASSERT(sizeof(socklen_t) <= sizeof(size_t));
GPR_ASSERT(resolved_addr->len <= (socklen_t)-1);
fd = accept(sockfd, (grpc_sockaddr*)resolved_addr->addr,
(socklen_t*)&resolved_addr->len);
if (fd >= 0) {

@ -170,7 +170,6 @@ grpc_error* grpc_tcp_server_prepare_socket(int fd,
err = grpc_set_socket_no_sigpipe_if_possible(fd);
if (err != GRPC_ERROR_NONE) goto error;
GPR_ASSERT(addr->len < ~(socklen_t)0);
if (bind(fd, reinterpret_cast<grpc_sockaddr*>(const_cast<char*>(addr->addr)),
addr->len) < 0) {
err = GRPC_OS_ERROR(errno, "bind");

@ -381,7 +381,6 @@ static int prepare_socket(grpc_socket_factory* socket_factory, int fd,
}
}
GPR_ASSERT(addr->len < ~(socklen_t)0);
if (bind_socket(socket_factory, fd, addr) < 0) {
char* addr_str;
grpc_sockaddr_to_string(&addr_str, addr, 0);

Loading…
Cancel
Save