From: "Nickle Wang via groups.io" <nicklew=nvidia.com@groups.io>
To: <devel@edk2.groups.io>
Cc: Abner Chang <abner.chang@amd.com>, Igor Kulchytskyy <igork@ami.com>
Subject: [edk2-devel] [edk2-redfish-client][PATCH 06/13] RedfishClientPkg/RedfishVersionLib: ues RedfishHttpLib
Date: Thu, 29 Feb 2024 16:54:27 +0800 [thread overview]
Message-ID: <20240229085427.112372-1-nicklew@nvidia.com> (raw)
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib
Signed-off-by: Nickle Wang <nicklew@nvidia.com>
Cc: Abner Chang <abner.chang@amd.com>
Cc: Igor Kulchytskyy <igork@ami.com>
---
.../RedfishVersionLib/RedfishVersionLib.inf | 3 +--
.../RedfishVersionLib/RedfishVersionLib.c | 24 +++----------------
2 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf b/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf
index 10e335af3..5c3f4de39 100644
--- a/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf
+++ b/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf
@@ -36,9 +36,8 @@
DebugLib
MemoryAllocationLib
PcdLib
- RedfishLib
+ RedfishHttpLib
JsonLib
- RedfishHttpCacheLib
[Protocols]
diff --git a/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c b/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c
index 828693766..a55238d22 100644
--- a/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c
+++ b/RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.c
@@ -14,11 +14,10 @@
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/PcdLib.h>
-#include <Library/RedfishLib.h>
+#include <Library/RedfishHttpLib.h>
#include <Library/JsonLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/RedfishVersionLib.h>
-#include <Library/RedfishHttpCacheLib.h>
#define REDFISH_VERSION_DEFAULT_STRING L"v1"
#define REDFISH_ROOT_URI L"/redfish"
@@ -112,22 +111,12 @@ RedfishGetVersion (
Status = RedfishHttpGetResource (
Service,
REDFISH_ROOT_URI,
+ NULL,
&Response,
TRUE
);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a, RedfishGetByService to %s failed: %r\n", __func__, REDFISH_ROOT_URI, Status));
- if (Response.Payload != NULL) {
- RedfishDumpPayload (Response.Payload);
- RedfishFreeResponse (
- NULL,
- 0,
- NULL,
- Response.Payload
- );
- Response.Payload = NULL;
- }
-
goto ON_ERROR;
}
@@ -156,14 +145,7 @@ ON_ERROR:
VersionString = REDFISH_VERSION_DEFAULT_STRING;
}
- if (Response.Payload != NULL) {
- RedfishFreeResponse (
- Response.StatusCode,
- Response.HeaderCount,
- Response.Headers,
- Response.Payload
- );
- }
+ RedfishHttpFreeResponse (&Response);
DEBUG ((DEBUG_MANAGEABILITY, "%a: Redfish version - %s\n", __func__, VersionString));
return AllocateCopyPool (StrSize (VersionString), VersionString);
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116146): https://edk2.groups.io/g/devel/message/116146
Mute This Topic: https://groups.io/mt/104640227/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
reply other threads:[~2024-02-29 8:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240229085427.112372-1-nicklew@nvidia.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox