Skip to content

Commit

Permalink
Merge pull request #1485 from FIWARE/hardening/functest
Browse files Browse the repository at this point in the history
A few improvements
  • Loading branch information
kzangeli authored Dec 2, 2023
2 parents 41c5e9d + 977033c commit fa57d5b
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 74 deletions.
34 changes: 17 additions & 17 deletions src/lib/orionld/serviceRoutines/orionldGetEntities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,25 +258,25 @@ bool orionldGetEntities(void)
orionldError(OrionldResourceNotFound, "Entity Map Not Found", orionldState.uriParams.entityMap, 404);
return false;
}
}

if (orionldState.uriParams.reset == true)
{
LM_T(LmtSR, ("Deleting entity map '%s'", orionldEntityMapId));
orionldEntityMapRelease();
orionldEntityMap = NULL;
orionldEntityMapCount = 0;
orionldState.uriParams.entityMap = NULL;
entityMap = NULL;
}
else
if (orionldState.uriParams.reset == true)
{
LM_T(LmtSR, ("Deleting entity map '%s'", orionldEntityMapId));
orionldEntityMapRelease();
orionldEntityMap = NULL;
orionldEntityMapCount = 0;
orionldState.uriParams.entityMap = NULL;
entityMap = NULL;
}
else if (orionldState.uriParams.entityMap != NULL)
{
// No query params can be used when asking for pages in an entity map
if ((id != NULL) || (type != NULL) || (idPattern != NULL) || (q != NULL) ||
(geometry != NULL) || (attrs != NULL) || (orionldState.uriParams.local == true))
{
// No query params can be used when asking for pages in an entity map
if ((id != NULL) || (type != NULL) || (idPattern != NULL) || (q != NULL) ||
(geometry != NULL) || (attrs != NULL) || (orionldState.uriParams.local == true))
{
orionldError(OrionldBadRequestData, "Query parameters present", "not allowed when paginating using an entity map", 400);
return false;
}
orionldError(OrionldBadRequestData, "Query parameters present", "not allowed when paginating using an entity map", 400);
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,6 @@ static void distOpMatchIdsRequest(DistOp* distOpList)
// Await all responses, if any
if (forwards > 0)
distOpsReceive(distOpList, idListResponse, orionldEntityMap, forwards);


}


Expand Down
Loading

0 comments on commit fa57d5b

Please sign in to comment.