summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c39
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;
}
//