diff options
author | Wenyi Xie <xiewenyi2@huawei.com> | 2022-01-19 11:47:00 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-01-20 13:26:51 +0000 |
commit | 7709988dd8f9a69eea456869f468120f1f0fc7cb (patch) | |
tree | 6d3ed01704fd3d9a1292d1605c37da8f47a81968 /RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c | |
parent | 772c5bb8dcb9841f1839dec02f33324e31b36d25 (diff) | |
download | edk2-7709988dd8f9a69eea456869f468120f1f0fc7cb.tar.gz edk2-7709988dd8f9a69eea456869f468120f1f0fc7cb.tar.bz2 edk2-7709988dd8f9a69eea456869f468120f1f0fc7cb.zip |
RedfishPkg/RedfishRestExDxe:Simplify status check
Remove redundant determine statements.
No functional change.
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com>
Diffstat (limited to 'RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c')
-rw-r--r-- | RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c index eb1d8b8fa2..952e9d103a 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c @@ -44,7 +44,7 @@ ResetHttpTslSession ( }
/**
- This function check
+ This function check Http receive status.
@param[in] Instance Pointer to EFI_REST_EX_PROTOCOL instance for a particular
REST service.
@@ -67,37 +67,34 @@ RedfishCheckHttpReceiveStatus ( if (!EFI_ERROR (HttpIoReceiveStatus)) {
ReturnStatus = EFI_SUCCESS;
- } else if (EFI_ERROR (HttpIoReceiveStatus) && (HttpIoReceiveStatus != EFI_CONNECTION_FIN)) {
+ } else if (HttpIoReceiveStatus != EFI_CONNECTION_FIN) {
if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY) == 0) {
DEBUG ((DEBUG_ERROR, "%a: TCP error, reset HTTP session.\n", __FUNCTION__));
Instance->Flags |= RESTEX_INSTANCE_FLAGS_TCP_ERROR_RETRY;
gBS->Stall (500);
Status = ResetHttpTslSession (Instance);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
- ReturnStatus = EFI_DEVICE_ERROR;
- } else {
+ if (!EFI_ERROR (Status)) {
return EFI_NOT_READY;
}
- } else {
- ReturnStatus = EFI_DEVICE_ERROR;
+
+ DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
}
- } else {
- if (HttpIoReceiveStatus == EFI_CONNECTION_FIN) {
- if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TLS_RETRY) != 0) {
- DEBUG ((DEBUG_ERROR, "%a: REST_EX Send and receive fail even with a new TLS session.\n", __FUNCTION__));
- ReturnStatus = EFI_DEVICE_ERROR;
- }
- Instance->Flags |= RESTEX_INSTANCE_FLAGS_TLS_RETRY;
- Status = ResetHttpTslSession (Instance);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
- ReturnStatus = EFI_DEVICE_ERROR;
- }
+ ReturnStatus = EFI_DEVICE_ERROR;
+ } else {
+ if ((Instance->Flags & RESTEX_INSTANCE_FLAGS_TLS_RETRY) != 0) {
+ DEBUG ((DEBUG_ERROR, "%a: REST_EX Send and receive fail even with a new TLS session.\n", __FUNCTION__));
+ ReturnStatus = EFI_DEVICE_ERROR;
+ }
- return EFI_NOT_READY;
+ Instance->Flags |= RESTEX_INSTANCE_FLAGS_TLS_RETRY;
+ Status = ResetHttpTslSession (Instance);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
+ ReturnStatus = EFI_DEVICE_ERROR;
}
+
+ return EFI_NOT_READY;
}
//
|