Skip to content

Commit

Permalink
More of the same + fixed a functest that missed some REGEX
Browse files Browse the repository at this point in the history
  • Loading branch information
kzangeli committed May 15, 2023
1 parent ea687e1 commit fb99288
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
16 changes: 12 additions & 4 deletions src/lib/mongoBackend/mongoSubCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,18 @@ int mongoSubCacheItemInsert(const char* tenant, const BSONObj& sub)
// IP, port and rest
cSubP->url = strdup(cSubP->httpInfo.url.c_str());
urlParse(cSubP->url, &cSubP->protocolString, &cSubP->ip, &cSubP->port, &cSubP->rest);
cSubP->protocol = protocolFromString(cSubP->protocolString);
cSubP->protocolString = strdup(cSubP->protocolString);
cSubP->rest = strdup(cSubP->rest);
cSubP->ip = strdup(cSubP->ip);

if (cSubP->protocolString != NULL)
{
cSubP->protocol = protocolFromString(cSubP->protocolString);
cSubP->protocolString = strdup(cSubP->protocolString);
}

if (cSubP->rest != NULL)
cSubP->rest = strdup(cSubP->rest);

if (cSubP->ip != NULL)
cSubP->ip = strdup(cSubP->ip);

// q
cSubP->qText = sub.hasField("ldQ")? strdup(getStringFieldF(&sub, "ldQ")) : NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld>; rel="http:/

03. See S1 in DB
================
MongoDB shell version v4.4.21
connecting to: mongodb://localhost:27017/ftest?compressors=disabled&gssapiServiceName=mongodb
MongoDB server version: 4.4.21
MongoDB shell version REGEX(.*)
connecting to: REGEX(.*)
MongoDB server version: REGEX(.*)
{
"_id" : "urn:S1",
"entities" : [
Expand Down Expand Up @@ -337,9 +337,9 @@ Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld>; rel="http:/

07. See S1 in DB
================
MongoDB shell version v4.4.21
connecting to: mongodb://localhost:27017/ftest?compressors=disabled&gssapiServiceName=mongodb
MongoDB server version: 4.4.21
MongoDB shell version REGEX(.*)
connecting to: REGEX(.*)
MongoDB server version: REGEX(.*)
{
"_id" : "urn:S1",
"entities" : [
Expand Down Expand Up @@ -462,9 +462,9 @@ Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld>; rel="http:/

11. See S1 in DB
================
MongoDB shell version v4.4.21
connecting to: mongodb://localhost:27017/ftest?compressors=disabled&gssapiServiceName=mongodb
MongoDB server version: 4.4.21
MongoDB shell version REGEX(.*)
connecting to: REGEX(.*)
MongoDB server version: REGEX(.*)
{
"_id" : "urn:S1",
"entities" : [
Expand Down

0 comments on commit fb99288

Please sign in to comment.