Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib Signed-off-by: Nickle Wang <nick...@nvidia.com> Cc: Abner Chang <abner.ch...@amd.com> Cc: Igor Kulchytskyy <ig...@ami.com> --- .../BootOptionCollectionDxe.inf | 5 ++-- .../BootOptionCollectionDxe.c | 26 ++++--------------- 2 files changed, 7 insertions(+), 24 deletions(-)
diff --git a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.inf b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.inf index 7977fa461..90aae8e9e 100644 --- a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.inf +++ b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.inf @@ -3,7 +3,7 @@ # Redfish BootOptionCollection collection driver. # # (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 # @@ -35,13 +35,12 @@ ConverterCommonLib MemoryAllocationLib RedfishFeatureUtilityLib - RedfishLib + RedfishHttpLib UefiLib UefiDriverEntryPoint UefiBootServicesTableLib EdkIIRedfishResourceConfigLib RedfishVersionLib - RedfishHttpCacheLib UefiBootManagerLib DevicePathLib diff --git a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c index 54cabcbe8..4f94a4495 100644 --- a/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c +++ b/RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.c @@ -3,7 +3,7 @@ Redfish feature driver implementation - BootOptionCollection (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP<BR> - Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -169,7 +169,7 @@ MarkBootOptionProcessed ( // Get boot option reference attribute // ZeroMem (&Response, sizeof (REDFISH_RESPONSE)); - Status = RedfishHttpGetResource (RedfishService, Uri, &Response, TRUE); + Status = RedfishHttpGetResource (RedfishService, Uri, NULL, &Response, TRUE); if (EFI_ERROR (Status) || (Response.Payload == NULL)) { DEBUG ((DEBUG_ERROR, "%a: failed to get resource from %s: %r", __func__, Uri, Status)); return Status; @@ -212,12 +212,7 @@ MarkBootOptionProcessed ( ON_RELEASE: - RedfishFreeResponse ( - Response.StatusCode, - Response.HeaderCount, - Response.Headers, - Response.Payload - ); + RedfishHttpFreeResponse (&Response); return Status; } @@ -436,18 +431,7 @@ ReleaseCollectionResource ( // // Release resource // - if (Private->Response.Payload != NULL) { - RedfishFreeResponse ( - Private->Response.StatusCode, - Private->Response.HeaderCount, - Private->Response.Headers, - Private->Response.Payload - ); - Private->Response.StatusCode = NULL; - Private->Response.HeaderCount = 0; - Private->Response.Headers = NULL; - Private->Response.Payload = NULL; - } + RedfishHttpFreeResponse (&Private->Response); if (Private->CollectionJson != NULL) { FreePool (Private->CollectionJson); @@ -478,7 +462,7 @@ CollectionHandler ( // // Query collection from Redfish service. // - Status = RedfishHttpGetResource (Private->RedfishService, Private->CollectionUri, &Private->Response, TRUE); + Status = RedfishHttpGetResource (Private->RedfishService, Private->CollectionUri, NULL, &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; -- 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116148): https://edk2.groups.io/g/devel/message/116148 Mute This Topic: https://groups.io/mt/104640231/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-