Merge pull request #19848 from AspirinSJL/server_address

Fix ServerAddress move assignment
pull/19852/head
Juanli Shen 5 years ago committed by GitHub
commit a914d1c421
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/core/ext/filters/client_channel/server_address.cc
  2. 2
      src/core/ext/filters/client_channel/server_address.h

@ -20,8 +20,6 @@
#include "src/core/ext/filters/client_channel/server_address.h"
#include <string.h>
namespace grpc_core {
//
@ -39,7 +37,7 @@ ServerAddress::ServerAddress(const void* address, size_t address_len,
address_.len = static_cast<socklen_t>(address_len);
}
bool ServerAddress::operator==(const grpc_core::ServerAddress& other) const {
bool ServerAddress::operator==(const ServerAddress& other) const {
return address_.len == other.address_.len &&
memcmp(address_.addr, other.address_.addr, address_.len) == 0 &&
grpc_channel_args_compare(args_, other.args_) == 0;

@ -24,7 +24,6 @@
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/gprpp/inlined_vector.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/uri/uri_parser.h"
// Channel arg key for a bool indicating whether an address is a grpclb
// load balancer (as opposed to a backend).
@ -68,6 +67,7 @@ class ServerAddress {
}
ServerAddress& operator=(ServerAddress&& other) {
address_ = other.address_;
grpc_channel_args_destroy(args_);
args_ = other.args_;
other.args_ = nullptr;
return *this;

Loading…
Cancel
Save