Skip to content

Commit

Permalink
Notification delivery: fixed regression in delivering notification to…
Browse files Browse the repository at this point in the history
… non-devices (such as ping to vdchost)

This was broken by 6d66ecd (Notification delivery: refactored to support broadcast to zone_id/group and prepared vdc grouped delivery.)

The regression caused that pings to the vdchost caused not pong back, which in turn caused the vdSM to consider the connection broken.
  • Loading branch information
plan44 committed Mar 16, 2018
1 parent 8b04501 commit e6da3a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vdc_common/vdchost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,12 +837,12 @@ void VdcHost::addTargetToAudience(NotificationAudience &aAudience, DsAddressable
for (NotificationAudience::iterator pos = aAudience.begin(); pos!=aAudience.end(); ++pos) {
if (pos->vdc==vdc) {
// vdc group already exists, add device
pos->members.push_back(dev);
pos->members.push_back(aTarget);
return;
}
}
// vdc group does not yet exist, create it
aAudience.push_back(NotificationGroup(vdc, dev));
aAudience.push_back(NotificationGroup(vdc, aTarget));
return;
}

Expand Down Expand Up @@ -897,10 +897,10 @@ void VdcHost::deliverToAudience(NotificationAudience &aAudience, VdcApiConnectio
// For now, notification is just passed to all targets
for (NotificationAudience::iterator gpos = aAudience.begin(); gpos!=aAudience.end(); ++gpos) {
if (gpos->vdc) {
LOG(LOG_NOTICE, "=== Delivering notifications for devices in vDC %s", gpos->vdc->shortDesc().c_str());
LOG(LOG_INFO, "=== Delivering notification '%s' to %lu devices in vDC %s", aNotification.c_str(), gpos->members.size(), gpos->vdc->shortDesc().c_str());
}
else {
LOG(LOG_NOTICE, "=== Delivering notifications for non-devices");
LOG(LOG_INFO, "=== Delivering notification '%s' to %lu non-devices", aNotification.c_str(), gpos->members.size());
}
for (DsAddressablesList::iterator apos = gpos->members.begin(); apos!=gpos->members.end(); ++apos) {
(*apos)->handleNotification(aApiConnection, aNotification, aParams);
Expand Down

0 comments on commit e6da3a8

Please sign in to comment.