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>
This commit is contained in:
Wenyi Xie 2022-01-19 11:47:00 +08:00 committed by mergify[bot]
parent 772c5bb8dc
commit 7709988dd8
1 changed files with 18 additions and 21 deletions

View File

@ -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 {
DEBUG ((DEBUG_ERROR, "%a: Reset HTTP instance fail.\n", __FUNCTION__));
}
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;
}
} 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;
}
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;
}
//