Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug in pernotSubCacheLookup #1492

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ Fixed issues:
* #1418 - Performance - Faster startup when there are GeoProperties in DB
* #1478 - Fixed issue
* #1479 - Fixed problem with "operations" in registrations
* #280 - Fixed a bug in the lookup of pernot subscriptions
4 changes: 2 additions & 2 deletions src/lib/orionld/pernot/pernotSubCacheLookup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
//
PernotSubscription* pernotSubCacheLookup
(
const char* subscriptionId,
const char* tenant
const char* tenant,
const char* subscriptionId
)
{
for (PernotSubscription* pSubP = pernotSubCache.head; pSubP != NULL; pSubP = pSubP->next)
Expand Down
4 changes: 2 additions & 2 deletions src/lib/orionld/pernot/pernotSubCacheLookup.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
//
extern PernotSubscription* pernotSubCacheLookup
(
const char* subscriptionId,
const char* tenant
const char* tenant,
const char* subscriptionId
);

#endif // SRC_LIB_ORIONLD_PERNOT_PERNOTSUBCACHELOOKUP_H_
4 changes: 2 additions & 2 deletions src/lib/orionld/serviceRoutines/orionldGetSubscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static bool orionldGetSubscriptionFromDb(void)
}
else
{
PernotSubscription* pSubP = pernotSubCacheLookup(orionldState.wildcard[0], orionldState.tenantP->tenant);
PernotSubscription* pSubP = pernotSubCacheLookup(orionldState.tenantP->tenant, orionldState.wildcard[0]);
if (pSubP != NULL)
orionldSubCounters(apiSubP, NULL, pSubP);
}
Expand Down Expand Up @@ -265,7 +265,7 @@ bool orionldGetSubscription(void)
}

// pernot subscription?
PernotSubscription* pSubP = pernotSubCacheLookup(subscriptionId, orionldState.tenantP->tenant);
PernotSubscription* pSubP = pernotSubCacheLookup(orionldState.tenantP->tenant, subscriptionId);
if (pSubP != NULL)
{
orionldState.httpStatusCode = 200;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld>; rel="h
04. GET subs (from DB)
======================
HTTP/1.1 200 OK
Content-Length: 768
Content-Length: 840
Content-Type: application/json
Date: REGEX(.*)
Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"
Expand All @@ -217,7 +217,10 @@ Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld>; rel="h
"uri": "http://127.0.0.1:9997/notify"
},
"format": "normalized",
"status": "ok"
"lastNotification": "202REGEX(.*)Z",
"noMatch": 1,
"status": "ok",
"timesSent": 1
},
"origin": "database",
"q": "P3==1|P3==2",
Expand Down
Loading