Skip to content

Commit

Permalink
Merge pull request #1492 from FIWARE/bug/pernot-lookup
Browse files Browse the repository at this point in the history
Fixed a bug in pernotSubCacheLookup
  • Loading branch information
kzangeli authored Dec 9, 2023
2 parents 886ae2a + 270ecd9 commit 238ac6c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
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

0 comments on commit 238ac6c

Please sign in to comment.