|
|
|
@ -895,8 +895,7 @@ class AdsServiceImpl : public std::enable_shared_from_this<AdsServiceImpl> { |
|
|
|
|
&subscription_state, &resource_state, |
|
|
|
|
update_queue) || |
|
|
|
|
ClientNeedsResourceUpdate(resource_type_state, resource_state, |
|
|
|
|
client_resource_type_version, |
|
|
|
|
&subscription_state)) { |
|
|
|
|
client_resource_type_version)) { |
|
|
|
|
gpr_log(GPR_INFO, "ADS[%p]: Sending update for type=%s name=%s", this, |
|
|
|
|
request.type_url().c_str(), resource_name.c_str()); |
|
|
|
|
resources_added_to_response.emplace(resource_name); |
|
|
|
@ -942,11 +941,9 @@ class AdsServiceImpl : public std::enable_shared_from_this<AdsServiceImpl> { |
|
|
|
|
auto& resource_name_map = resource_type_state.resource_name_map; |
|
|
|
|
auto it = subscription_name_map.find(resource_name); |
|
|
|
|
if (it != subscription_name_map.end()) { |
|
|
|
|
SubscriptionState& subscription_state = it->second; |
|
|
|
|
ResourceState& resource_state = resource_name_map[resource_name]; |
|
|
|
|
if (ClientNeedsResourceUpdate(resource_type_state, resource_state, |
|
|
|
|
sent_state->resource_type_version, |
|
|
|
|
&subscription_state)) { |
|
|
|
|
sent_state->resource_type_version)) { |
|
|
|
|
gpr_log(GPR_INFO, "ADS[%p]: Sending update for type=%s name=%s", this, |
|
|
|
|
resource_type.c_str(), resource_name.c_str()); |
|
|
|
|
response->emplace(); |
|
|
|
@ -1060,8 +1057,7 @@ class AdsServiceImpl : public std::enable_shared_from_this<AdsServiceImpl> { |
|
|
|
|
// the resource.
|
|
|
|
|
static bool ClientNeedsResourceUpdate( |
|
|
|
|
const ResourceTypeState& resource_type_state, |
|
|
|
|
const ResourceState& resource_state, int client_resource_type_version, |
|
|
|
|
SubscriptionState* /*subscription_state*/) { |
|
|
|
|
const ResourceState& resource_state, int client_resource_type_version) { |
|
|
|
|
return client_resource_type_version < |
|
|
|
|
resource_type_state.resource_type_version && |
|
|
|
|
resource_state.resource_type_version <= |
|
|
|
|