Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 6a37b1c

Browse files
author
Jay Logue
committed
Support for WDM subscriptions over connections
-- Various changes supporting use of WDM subscriptions over connection-oriented transports. As part of this effort, a number of general bugs were also fixed. -- Use AutoRequestAck feature of ExchangeContext for all WRM subscription exchanges. This allows the code in SubscriptionClient and SubscriptionHandler classes to be neutral with regard to connection-oriented/conectionless transports when sending Weave messages. -- Re-wrote the handling of subscription termination in the SubscriptionClient and SubscriptionHandler classes. This greatly simplified the logic, making it easier to reason about the correctness of the code. This change also resolves WEAV-2367. -- Added code to detect binding failures and terminate any associated subscriptions. This ensures, for example, that a subscription is terminated whenever its underlying connection is lost. This change also fixed a long-standing bug related to connectionless subscriptions wherein a session failure would not immediate result in the failure of a subscription. -- Fixed a bug in SubscriptionClient where the OnSubscriptionTerminated event was not delivered to the application in certain cases. This left the application unaware that the underlying subscription was gone. This fix necessitated various changes to the WDM functional tests which had been coded to assume the erroneous behavior. -- Fixed a bug in SubscriptionClient and SubscriptionHandler where the standalone ACK for a StatusReport received in response to a SubscribeCancelRequest would never be sent. -- Revised ifdefs in SubscriptionClient and UdpateClient so that both can be built with WRM disabled. (Note that there are various hard dependencies on WRM in the test tools unrelated to subscription/update support. These were not addressed.) -- Added interface documentation describing new subscription termination behavior. -- Minor logging clean-ups in TraitData and StatusReportStr().
1 parent 82493b7 commit 6a37b1c

File tree

12 files changed

+598
-539
lines changed

12 files changed

+598
-539
lines changed

src/lib/profiles/data-management/Current/NotificationEngine.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,13 +1122,17 @@ WEAVE_ERROR NotificationEngine::SendNotify(PacketBuffer * aBuffer, SubscriptionH
11221122
{
11231123
WEAVE_ERROR err = WEAVE_NO_ERROR;
11241124

1125-
err = aSubHandler->SendNotificationRequest(aBuffer);
1126-
SuccessOrExit(err);
1127-
11281125
// We can only have 1 notify in flight for any given subscription - increment and break out.
11291126
mNumNotifiesInFlight++;
11301127

1128+
err = aSubHandler->SendNotificationRequest(aBuffer);
1129+
SuccessOrExit(err);
1130+
11311131
exit:
1132+
if (err != WEAVE_NO_ERROR)
1133+
{
1134+
mNumNotifiesInFlight--;
1135+
}
11321136
return err;
11331137
}
11341138

@@ -1584,7 +1588,7 @@ WEAVE_ERROR NotificationEngine::BuildSingleNotifyRequest(SubscriptionHandler * a
15841588
{
15851589
// abort subscription, squash error, signal to upper
15861590
// layers that the subscription is done
1587-
aSubHandler->HandleSubscriptionTerminated(err, NULL);
1591+
aSubHandler->TerminateSubscription(err, NULL, false);
15881592

15891593
aSubscriptionHandled = true;
15901594
err = WEAVE_NO_ERROR;

0 commit comments

Comments
 (0)