Use Redfish Http cache library to query Redfish service. Signed-off-by: Nickle Wang <nick...@nvidia.com> Cc: Abner Chang <abner.ch...@amd.com> Cc: Igor Kulchytskyy <ig...@ami.com> Cc: Nick Ramirez <nrami...@nvidia.com> --- .../MemoryCollectionDxe.inf | 2 ++ .../MemoryCollectionDxe/MemoryCollectionDxe.c | 24 +++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.inf b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.inf index 05e05712..67c38f62 100644 --- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.inf +++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.inf @@ -3,6 +3,7 @@ # Redfish MemoryCollection collection driver. # # (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP<BR> +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -40,6 +41,7 @@ UefiBootServicesTableLib EdkIIRedfishResourceConfigLib RedfishVersionLib + RedfishHttpCacheLib [Protocols] gEdkIIRedfishConfigHandlerProtocolGuid ## CONSUMED diff --git a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c index bebc605d..b42d7310 100644 --- a/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c +++ b/RedfishClientPkg/Features/MemoryCollectionDxe/MemoryCollectionDxe.c @@ -3,7 +3,7 @@ Redfish feature driver implementation - MemoryCollection (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP<BR> - Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -247,17 +247,17 @@ ReleaseCollectionResource ( // // Release resource // - if (Private->RedResponse.Payload != NULL) { + if (Private->Response.Payload != NULL) { RedfishFreeResponse ( - Private->RedResponse.StatusCode, - Private->RedResponse.HeaderCount, - Private->RedResponse.Headers, - Private->RedResponse.Payload + Private->Response.StatusCode, + Private->Response.HeaderCount, + Private->Response.Headers, + Private->Response.Payload ); - Private->RedResponse.StatusCode = NULL; - Private->RedResponse.HeaderCount = 0; - Private->RedResponse.Headers = NULL; - Private->RedResponse.Payload = NULL; + Private->Response.StatusCode = NULL; + Private->Response.HeaderCount = 0; + Private->Response.Headers = NULL; + Private->Response.Payload = NULL; } if (Private->CollectionJson != NULL) { @@ -289,13 +289,13 @@ CollectionHandler ( // // Query collection from Redfish service. // - Status = GetResourceByUri (Private->RedfishService, Private->CollectionUri, &Private->RedResponse); + Status = RedfishHttpGetResource (Private->RedfishService, Private->CollectionUri, &Private->Response, TRUE); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a, unable to get resource from: %s :%r\n", __func__, Private->CollectionUri, Status)); goto ON_RELEASE; } - Private->CollectionPayload = Private->RedResponse.Payload; + Private->CollectionPayload = Private->Response.Payload; ASSERT (Private->CollectionPayload != NULL); Private->CollectionJson = JsonDumpString (RedfishJsonInPayload (Private->CollectionPayload), EDKII_JSON_COMPACT); -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113075): https://edk2.groups.io/g/devel/message/113075 Mute This Topic: https://groups.io/mt/103500381/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-